feat: add xAI OAuth web search and provider timeouts#85182
Conversation
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-22 07:45 UTC / May 22, 2026, 3:45 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. for the feature as a whole. For the prior fallback defect, latest-head source and regression-test evidence show the stale API-key profile path now reaches env/API-key fallback. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Merge a maintainer-accepted version after redacted live xAI OAuth/API web_search proof, preserving the repaired fallback behavior and documenting the accepted SDK/provider contract. Do we have a high-confidence way to reproduce the issue? Not applicable for the feature as a whole. For the prior fallback defect, latest-head source and regression-test evidence show the stale API-key profile path now reaches env/API-key fallback. Is this the best way to solve the issue? Unclear until maintainer approval and proof: the implementation is coherent and the known fallback defect is fixed, but the new public provider contracts and live xAI behavior still need explicit acceptance and real runtime evidence. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0e47815e6ec9. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Behavior proof: xAI OAuth web_search onboardingBehavior addressed: onboarding can select Grok (xAI) for Real environment tested: local source checkout with isolated OpenClaw state under Exact steps or command run after this patch: openclaw onboard --flow advanced --mode local --auth-choice skip --workspace <isolated-proof-workspace> --accept-risk --skip-daemon --skip-channels --skip-skills --skip-hooks --skip-health --skip-ui --skip-bootstrap --secret-input-mode plaintext
pnpm test src/wizard/setup.finalize.test.ts src/flows/search-setup.test.ts extensions/xai/web-search.test.ts
pnpm exec oxfmt --check --threads=1 src/wizard/setup.finalize.ts src/wizard/setup.finalize.test.ts src/wizard/i18n/locales/en.ts src/wizard/i18n/locales/zh-CN.ts src/wizard/i18n/locales/zh-TW.ts
pnpm test src/wizard/setup.finalize.test.ts
git diff --check
AUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode localEvidence after fix:
Observed result after fix: Grok-backed What was not tested: live xAI web_search network execution from this onboarding run; the provider/runtime test coverage remains focused on the existing xAI web_search credential path. Sanitized proof bundle: https://gist.github.com/fuller-stack-dev/25f1005f74d30b467d6064acbd7b21c9 |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fde1518 to
3127008
Compare
|
Maintainer proof for landing: Behavior addressed: Grok Exact local commands run after fix:
Evidence after fix:
What was not tested: no live xAI credential call; covered with mocked provider-auth/fetch regression tests. Thanks @fuller-stack-dev. |
Summary
web_searchduring setup/runtime, with API-key/env/plugin config fallback after stale OAuth refresh.grok-build-0.1to the xAI catalog and normalize Grok Code Fast aliases.web_searchso non-default agent xAI OAuth/API-key profiles are used.web_searchas enabled in the final onboarding summary when an xAI auth profile already exists.Verification
pnpm test extensions/xai/web-search.test.ts extensions/xai/model-id.test.ts extensions/xai/onboard.test.ts extensions/xai/image-generation-provider.test.ts extensions/xai/video-generation-provider.test.ts extensions/speech-core/src/tts.test.ts src/flows/search-setup.test.ts src/web-search/runtime.test.ts src/agents/model-auth.profiles.test.ts src/image-generation/runtime.test.ts src/video-generation/runtime.test.ts src/agents/tools/web-search.test.ts src/agents/tools/web-search.late-bind.test.ts src/agents/tools/web-search.signal.test.ts src/agents/tools/web-tools.enabled-defaults.test.tspnpm test src/agents/tools/pdf-tool.model-config.test.ts src/agents/tools/image-tool.test.ts src/agents/tools/media-tool-shared.test.tspnpm test src/wizard/setup.finalize.test.ts src/flows/search-setup.test.ts extensions/xai/web-search.test.tspnpm exec oxfmt --check --threads=1 $(git diff --name-only upstream/main...HEAD -- '*.ts' '*.json')pnpm exec oxfmt --check --threads=1 src/wizard/setup.finalize.ts src/wizard/setup.finalize.test.ts src/wizard/i18n/locales/en.ts src/wizard/i18n/locales/zh-CN.ts src/wizard/i18n/locales/zh-TW.tspnpm plugin-sdk:api:checkpnpm config:docs:checknode scripts/format-docs.mjs --checkgit diff --check upstream/main...HEADgit diff --checknode scripts/check-web-search-provider-boundaries.mjsnode scripts/check-extension-plugin-sdk-boundary.mjs --mode=src-outside-plugin-sdk extensions/xainode scripts/check-extension-plugin-sdk-boundary.mjs --mode=plugin-sdk-internal extensions/xaipnpm buildAUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode localAUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode commit --commit HEADReal behavior proof
Behavior addressed: Grok
web_searchcan be selected during onboarding/config when xAI OAuth already exists, runtime prefers OAuth, retries refreshed OAuth on 401, and falls back to xAI API-key auth/profile/env/config when OAuth remains stale. The active session agent directory is now threaded into web_search provider selection and execution, so non-default agents use their own xAI OAuth/API-key auth profiles. xAI catalog now includesgrok-build-0.1; xAI image/video provider defaults use a 600s operation timeout. The final onboarding summary now treats an existing xAI OAuth auth profile as a validweb_searchcredential instead of reporting a missing API key.Real environment tested: Local macOS source checkout on branch
codex/xai-oauth-web-search, Node/pnpm repo toolchain, plus an isolated onboarding proof state seeded with a fake xAI OAuth auth profile. No real credentials were used.Exact steps or command run after this patch: Ran the Verification commands listed above, then ran
openclaw onboard --flow advanced --mode local --auth-choice skip --workspace <isolated-proof-workspace> --accept-risk --skip-daemon --skip-channels --skip-skills --skip-hooks --skip-health --skip-ui --skip-bootstrap --secret-input-mode plaintextagainst isolated state with Grok selected for web_search.Evidence after fix: Focused Vitest shards passed; SDK/config baseline checks passed; docs/format/boundary/build gates passed; final local and current-HEAD autoreview runs were clean. Onboarding screenshot proof is attached in #85182 (comment), with sanitized proof bundle at https://gist.github.com/fuller-stack-dev/25f1005f74d30b467d6064acbd7b21c9.
Observed result after fix: OAuth-backed Grok web_search tests use xAI OAuth before configured API-key fallback, refresh on 401, fall back to a non-OAuth API-key auth profile when stale OAuth remains first, and pass active
agentDirthrough generic web_search auto-detect and provider execution. Onboarding skips the API-key prompt when xAI OAuth exists and the final summary reportsCredential: existing xAI OAuth sign-in..What was not tested: Live xAI OAuth/API calls were not run from the onboarding proof; behavior is covered with mocked provider-auth and HTTP responses plus local onboarding proof using a fake OAuth profile.