fix(agents): detect bundled and legacy providers in model-not-found hint#100120
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 2:10 AM ET / 06:10 UTC. Summary PR surface: Source +6, Tests +63. Total +69 across 2 files. Reproducibility: yes. at source level: current main still emits the generic Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land one canonical narrow hint fix that keeps Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main still emits the generic Is this the best way to solve the issue? Yes, this is the right narrow fix shape: the shared missing-model hint helper owns the bad recovery text, and the PR keeps AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 241c761d0036. Label changesLabel justifications:
Evidence reviewedPR surface: Source +6, Tests +63. Total +69 across 2 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
Review history (8 earlier review cycles)
|
…und hint In buildMissingProviderModelRegistrationHint, add an early-return check for the legacy openai-codex alias (via normalizeProviderId). Instead of suggesting a models.providers[] config entry that the config validator rejects without baseUrl, the hint now points operators to run openclaw doctor --fix for migration or check provider auth. Fixes openclaw#100066 Co-Authored-By: Claude <[email protected]>
872aadc to
7b9ec53
Compare
|
@clawsweeper re-review Narrowed the fix to only the legacy openai-codex alias (removed the broad isBuiltInModelProviderOverlayId check). Added real behavior proof via tsx script running the production resolveModelAsync function. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review CI green now. Narrowed to only legacy openai-codex with real behavior proof. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
81ab7f6 to
7b9ec53
Compare
…int (openclaw#100120) * [AI] fix(agents): detect legacy openai-codex provider in model-not-found hint In buildMissingProviderModelRegistrationHint, add an early-return check for the legacy openai-codex alias (via normalizeProviderId). Instead of suggesting a models.providers[] config entry that the config validator rejects without baseUrl, the hint now points operators to run openclaw doctor --fix for migration or check provider auth. Fixes openclaw#100066 Co-Authored-By: Claude <[email protected]> * fix(agents): cover legacy Codex provider config hint --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…int (openclaw#100120) * [AI] fix(agents): detect legacy openai-codex provider in model-not-found hint In buildMissingProviderModelRegistrationHint, add an early-return check for the legacy openai-codex alias (via normalizeProviderId). Instead of suggesting a models.providers[] config entry that the config validator rejects without baseUrl, the hint now points operators to run openclaw doctor --fix for migration or check provider auth. Fixes openclaw#100066 Co-Authored-By: Claude <[email protected]> * fix(agents): cover legacy Codex provider config hint --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
When a legacy
openai-codexprovider reference (e.g.openai-codex/gpt-5.4) is found inagents.defaults.models, the runtime error prescribes amodels.providers["openai-codex"]config entry that the config validator rejects withoutbaseUrl, creating contradictory guidance and a gateway crash-loop.buildMissingProviderModelRegistrationHintunconditionally suggests adding amodels.providers[]entry for the legacyopenai-codexalias. Sinceopenai-codexis not in the built-in provider overlay allowlist, the config validator rejects the overlay, bricking the gateway.openai-codexalias before the generic config-entry suggestion. The new hint points operators toopenclaw doctor --fixto migrate to the current OpenAI provider format, or to check provider auth.src/agents/embedded-agent-runner/model.ts(+9 lines — new check + comment),src/agents/embedded-agent-runner/model.test.ts(+42 lines — 2 new tests)BUILT_IN_MODEL_PROVIDER_OVERLAY_IDSset; bundled provider hint paths (unchanged); non-bundled/custom provider hint path (unchanged);agentRuntimeIdhint path (unchanged); doctor migration codeChange Type
Scope
Linked Issue/PR
Motivation
The issue reporter followed the runtime's error message verbatim and ended up with a gateway that would not boot. The root cause is that the hint function doesn't account for the legacy
openai-codexalias, which has been folded into theopenaiprovider. For this legacy alias, the correct fix is to runopenclaw doctor --fixfor config migration or to re-authenticate the provider — not to add amodels.providers[]overlay that the validator will reject.Evidence
openai-codexprovider model-not-found errorsfix/bundled-provider-auth-hint-100066, OpenClaw local checkout$ npx tsx scripts/pr-100066-proof.tsThe test suite also exercises this path via the production
resolveModelAsyncfunction:Before/after matrix:
openai-codex/gpt-5.4(legacy)"...no matching models.providers["openai-codex"].models[] entry. Add { "id": "gpt-5.4", "name": "gpt-5.4" }..."→ validator rejects → crash-loop""openai-codex" is a legacy provider ID. Run \openclaw doctor --fix`..."`microsoft-foundry/Kimi-K2.6-1(bundled)"...no matching models.providers["microsoft-foundry"].models[] entry..."custom-provider/some-model(custom)"...no matching models.providers["custom-provider"].models[] entry..."openai-codexnow shows doctor migration + auth guidance instead of misleading config-entry advicemicrosoft-foundry) retain the existing config-entry guidance — overlays work correctly for themopenai-codexlacking auth (the error message change is the fix; the gateway no longer receives a contradictory config); existing real-world configs withopenai-codexmodel refs are handled byopenclaw doctor --fixmigrationRoot Cause
buildMissingProviderModelRegistrationHint(introduced in1ee2733b2f, Vincent Koc, 2026-06-17) lacked awareness of the legacyopenai-codexalias. The function always fell through to the genericmodels.providers[]config-entry suggestion, which the config validator rejects foropenai-codexbecause it is not inBUILT_IN_MODEL_PROVIDER_OVERLAY_IDS.User-visible / Behavior Changes
Operators encountering model-not-found errors for the legacy
openai-codexprovider will now see actionable guidance pointing toopenclaw doctor --fixfor migration or auth check, instead of misleading config instructions that crash the gateway.Security Impact
Compatibility / Migration
Best-fix Verdict
openai-codexalias, and doesn't affect bundled providers whose overlay path works correctly.openai-codextoBUILT_IN_MODEL_PROVIDER_OVERLAY_IDS— rejected because repository policy treatsopenai-codexas legacy-only input, not a valid new provider overlay.Risks and Mitigations
Highest risk area: None. The change only affects error message text for the legacy
openai-codexalias. Bundled providers, custom providers, and theagentRuntimeIdpath are completely unchanged.No compatibility risk — only error message text changes for a single legacy code path, no runtime behavior modification.