Skip to content

feat(xai): GUI opt-in switch for the Grok Responses lane (doc 130) - #2266

Merged
lidge-jun merged 2 commits into
devfrom
codex/xai-responses-optin
Aug 21, 2026
Merged

feat(xai): GUI opt-in switch for the Grok Responses lane (doc 130)#2266
lidge-jun merged 2 commits into
devfrom
codex/xai-responses-optin

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

The doc-130 unit: the xAI Responses implementation stays reachable through an explicit GUI opt-in switch (like the x_search opt-in), now that #2255 made Chat the OAuth default.

  • Server: provider PATCH gains the split write/read contract — WRITE xaiResponsesOptIn: boolean sets/clears BOTH grok-4.6 and grok-4.5 modelAdapters entries in one config transaction, preserving unrelated overrides; READ xaiResponsesOptInState: true | false | "mixed" (partial pre-existing state reads mixed; the first boolean write normalizes). xai-only; other providers rejected.
  • GUI: one switch in the provider workspace auth panel (visible for both OAuth and API-key sections of the single xai provider), indeterminate for mixed, PATCH round-trip from the echoed effective state; 9 GUI locales.
  • No tier behavior in the switch: the OAuth tier policy is already unconditional (fix(xai): Chat default for Grok 4.5/4.6 OAuth + unconditional tier policy (doc 100 unit) #2255); API-key keeps current dev semantics.
  • fix(responses): routed-destination sanitize + opaque-state recovery series (#2254 rebased) #2258's sanitize/recovery layers arm exactly this opt-in lane.

Verification

  • Server suites 73/0; fastwire/adapter 250/0; GUI focused 6/0; tsc, lint:gui, lint:i18n, privacy:scan, GUI build (245 modules), docs build (393 pages) green.
  • Full suite at branch: 14015 pass / 1 fail — the single failure was pre-existing at base and fixed separately (test(xai): declare the web-search field capability in the raw streaming config #2263); rebased onto that dev, focused re-verify 312/0.
  • LIVE GUI observation on a running proxy (fresh isolated home): the switch renders in the xai Accounts panel; clicking ON persists {grok-4.6: openai-responses, grok-4.5: openai-responses} atomically; OFF clears both (aria-pressed round-trip observed); final ON state re-verified in the persisted config. Screenshot below.

xai responses opt-in switch

Checklist

  • Targets dev
  • GUI change includes a screenshot
  • Focused + full-suite verification

Summary by CodeRabbit

  • New Features
    • Added an xAI Responses opt-in toggle to provider settings.
    • The toggle manages Grok 4.5 and 4.6 together and shows a mixed state for partial configurations.
    • Added localized interface text across supported languages.
  • Documentation
    • Updated provider configuration references and architecture documentation to describe the new setting and its behavior.
  • Tests
    • Added coverage for toggle rendering, updates, mixed states, validation, persistence, and adapter behavior.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 21, 2026 05:07
@lidge-jun lidge-jun added the enhancement New feature or request label Aug 21, 2026
@lidge-jun
lidge-jun merged commit 6aecc8f into dev Aug 21, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5f7683a-e3a1-4433-942b-18e83e02c6ff

📥 Commits

Reviewing files that changed from the base of the PR and between 6f1229a and 148290e.

⛔ Files ignored due to path filters (1)
  • .github/pr-assets/xai-responses-optin-switch.png is excluded by !**/*.png
📒 Files selected for processing (35)
  • docs-site/src/content/docs/fr/reference/configuration/providers.md
  • docs-site/src/content/docs/ja/reference/configuration/providers.md
  • docs-site/src/content/docs/ko/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/ru/reference/configuration/providers.md
  • docs-site/src/content/docs/tr/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-tw/reference/configuration/providers.md
  • gui/src/components/provider-workspace/ProviderAuthPanel.tsx
  • gui/src/components/provider-workspace/ProviderDetails.tsx
  • gui/src/components/provider-workspace/ProviderOverview.tsx
  • gui/src/components/provider-workspace/ProviderSettings.tsx
  • gui/src/components/provider-workspace/types.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/fr.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/tr.ts
  • gui/src/i18n/zh-TW.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/providers-shared.ts
  • gui/src/pages/use-providers-crud.ts
  • gui/src/provider-workspace/catalog.ts
  • gui/src/styles.css
  • gui/src/styles/provider-workspace-settings.css
  • gui/src/ui.tsx
  • gui/tests/provider-xai-responses-optin.test.tsx
  • gui/tests/use-providers-crud-update.test.tsx
  • src/providers/xai-responses-opt-in.ts
  • src/server/auth-cors.ts
  • src/server/management/provider-routes.ts
  • structure/04_transports-and-sidecars.md
  • tests/management-provider-validation.test.ts

📝 Walkthrough

Walkthrough

Adds an xAI Responses opt-in control for Grok 4.5 and 4.6. The backend manages both model adapters atomically and reports enabled, disabled, or mixed state. The GUI renders and updates the control. Tests and documentation cover the behavior.

Changes

xAI Responses opt-in

Layer / File(s) Summary
Backend opt-in management
src/providers/xai-responses-opt-in.ts, src/server/management/provider-routes.ts, src/server/auth-cors.ts
The backend derives opt-in state, validates xAI-only boolean updates, sets or clears the two supported model adapters, and returns the resulting state.
GUI state contract and wiring
gui/src/components/provider-workspace/types.ts, gui/src/pages/providers-shared.ts, gui/src/provider-workspace/catalog.ts, gui/src/pages/use-providers-crud.ts, gui/src/components/provider-workspace/ProviderDetails.tsx, gui/src/components/provider-workspace/ProviderOverview.tsx, gui/src/components/provider-workspace/ProviderSettings.tsx
Shared types carry the opt-in patch and effective state through provider data, update handling, and workspace components.
GUI opt-in control and presentation
gui/src/components/provider-workspace/ProviderAuthPanel.tsx, gui/src/ui.tsx, gui/src/styles.css, gui/src/styles/provider-workspace-settings.css, gui/src/i18n/*
The authentication panel renders the xAI control with mixed, saving, and error states. The switch styling and translations support the new control.
Validation and runtime resolution
tests/management-provider-validation.test.ts, gui/tests/provider-xai-responses-optin.test.tsx, gui/tests/use-providers-crud-update.test.tsx
Tests cover provider validation, persistence, mixed-state reporting, adapter resolution, unrelated adapter preservation, rendering, PATCH payloads, and echoed update state.
Configuration documentation
docs-site/src/content/docs/*/reference/configuration/providers.md, structure/04_transports-and-sidecars.md
The documentation describes the xAI-only dashboard switch, atomic adapter updates, mixed state, and unchanged unrelated overrides.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant ProviderAuthPanel
  participant useProvidersCrud
  participant providerRoutes
  participant ProviderConfig

  Dashboard->>ProviderAuthPanel: Render xAI opt-in state
  ProviderAuthPanel->>useProvidersCrud: Update xaiResponsesOptIn
  useProvidersCrud->>providerRoutes: PATCH provider update
  providerRoutes->>ProviderConfig: Set or clear Grok 4.5 and 4.6 adapters
  ProviderConfig-->>providerRoutes: Persisted configuration
  providerRoutes-->>useProvidersCrud: xaiResponsesOptInState
  useProvidersCrud-->>ProviderAuthPanel: Effective state
  ProviderAuthPanel-->>Dashboard: Updated switch state
Loading

Suggested reviewers: ingwannu, wibias, chrisae9

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/xai-responses-optin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This was referenced Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant