Repository navigation
fix(xai): canonicalize OAuth model during setup verification - #132487
AndrewEAUS wants to merge 12 commits into
Conversation
(cherry picked from commit 8890e1b)
(cherry picked from commit 2c3a54f)
* fix(codex): update managed runtime to 0.150.1 * test(codex): refresh newer runtime fixtures (cherry picked from commit c45cc17)
…nclaw#131515) * fix(gateway): keep config writes pending through watcher handoff * fix(gateway): import reload plan from its owning module (cherry picked from commit e0edb3a)
Discover the authenticated xAI OAuth catalog during device login and carry its canonical auto mapping only into the immediate setup execution config. Keep durable xai/auto dynamic, switch to the OAuth CLI proxy safely, and scrub stale credential-bearing provider and model overrides.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
|
Codex review: needs real behavior proof before merge. Reviewed September 5, 2026, 12:44 PM ET / 16:44 UTC. ClawSweeper reviewWhat this changesThe branch adds authenticated xAI catalog data to temporary setup verification while retaining the durable xai/auto selector, alongside inherited release, localization, installer, and Codex runtime updates. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 16 items remain The setup-specific fix remains useful, but the branch has three blocking defects: credential cleanup does not survive merging, successful canonical-model replies are rejected, and OAuth re-login discards existing model settings. The supplied validation stops before the changed behavior runs. Priority: P1 Review scores
Verification
How this fits togetherModel Setup stages provider credentials and tests inference before saving the selected route. The xAI plugin supplies authentication and model discovery; shared setup code verifies the response and commits the durable configuration. flowchart TD
A[Existing settings] --> D[Prepare setup candidate]
B[Device approval] --> C[Authenticated xAI catalog]
C --> D
D --> E[Isolated inference probe]
E --> F{Expected model and credential?}
F -->|Yes| G[Save durable auto selector]
F -->|No| H[Show setup failure]
Decision needed
Why: The new SDK contract bypasses the existing selected-route projection, so its permanent scope should be intentional. Before merge
Findings
Agent review detailsSecurityNeeds attention: Credential cleanup is ineffective after the real configuration merge, leaving old authentication material attached to the new OAuth route. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one selected-provider preparation flow to carry the exact canonical probe identity and catalog, preserve safe settings, and apply explicit credential deletions before changing origins. Do we have a high-confidence way to reproduce the issue? Yes, from source: applying the OAuth result to a configuration containing old headers preserves them, and a canonical-model response fails the setup winner check. These paths were traced, not executed. Is this the best way to solve the issue? No. Discovering metadata at the auth owner is appropriate, but the implementation misses the merge and response-validation boundaries; extending the existing scoped preparation flow is more maintainable. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d0137988844d. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Thanks for investigating. Closing this PR as superseded by #140610 ( |
Summary
Fix xAI OAuth pairing in Model Setup when the stable
xai/autoselector is verified before its authenticated live catalog metadata has reached the isolated setup runtime.The observed failure was a literal
autorequest sent tohttps://api.x.ai/v1/responses, returning 404 and surfacing as:This is adjacent to #122872, but the affected composition is the transactional provider-auth setup flow: a fresh staged OAuth credential plus the read-only inference verification runtime.
Root cause
xAI device login durably selects
xai/auto, which is correct. Its concrete target and OAuth proxy transport come from authenticated live discovery. During setup, the newly staged credential was not represented in the catalog used by the isolated verification run, so the route retained the static API origin and forwardedautoliterally.Thinking level is not causal: setup verification intentionally uses thinking/reasoning
off.Fix
inferenceProbeConfigPatchto provider auth results.xai/autodynamic; do not persist its point-in-time canonical model.Security and transaction boundaries
Tests
git diff --checkpassed.pnpm buildpassed in the reviewed composite build.Regression coverage includes fresh OAuth mapping, dynamic defaults, hostile/stale provider and model overrides, credential/header scrubbing, durable-versus-probe separation, setup activation/persistence, API-key non-regression, and failure transactionality.
Live validation
Validated from a source-built package on
2026.9.1-beta.1/1d96e5aee2d: the Model Setup xAI Pair action now reaches the device-code sign-in dialog instead of failing before authentication; ordinary xAI Grok 4.6 and explicit OpenAI subscription routes also complete without fallback. Final device approval remains intentionally interactive.