fix: suggest auth check for bundled provider model-not-found errors#100104
fix: suggest auth check for bundled provider model-not-found errors#100104ZOOWH wants to merge 6 commits into
Conversation
When a bundled provider lacks an authenticated profile, the model resolution error now points to `openclaw models status` for re-authentication instead of prescribing a config edit that the config validator rejects. Non-bundled providers keep the existing config-based guidance. Closes openclaw#100066.
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 10:07 PM ET / 02:07 UTC. Summary PR surface: Source +8, Tests +42. Total +50 across 2 files. Reproducibility: yes. at source level: current main still emits the generic provider-registration hint for unresolved configured openai-codex model refs, and current validation rejects the reported models.providers.openai-codex overlay without baseUrl. I did not run a live Docker crash-loop reproduction in this read-only review. 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
Security Review detailsBest possible solution: Land one canonical narrow fix for #100066 that keeps openai-codex legacy-only, points to supported OpenAI auth and doctor migration, preserves custom-provider hints, and then close sibling candidate PRs as duplicates. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main still emits the generic provider-registration hint for unresolved configured openai-codex model refs, and current validation rejects the reported models.providers.openai-codex overlay without baseUrl. I did not run a live Docker crash-loop reproduction in this read-only review. Is this the best way to solve the issue? Yes, this is the right narrow owner boundary: the shared missing-model hint helper already owns the bad recovery text, and the PR preserves custom-provider and other bundled-provider behavior. The remaining question is which overlapping PR maintainers want as the canonical branch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7d3cfa85dca1. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +8, Tests +42. Total +50 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 (13 earlier review cycles; latest 8 shown)
|
Add openai-codex as a recognized legacy bundled provider alias so the canonical reproduction case from openclaw#100066 is caught. Also keep the non-bundled config-suggestion test for microsoft-foundry.
|
@clawsweeper re-review — fixed canonical openai-codex case with legacy alias check, 122 tests pass |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review v2 changes:
|
|
@clawsweeper re-review Real CLI proof: built dist file (cliStartup profile) confirms the fix is live: 122 tests pass. oxfmt/oxlint clean. autoreview 0.95. build passes. |
Limit the bundled-provider auth suggestion to the canonical openai-codex legacy alias instead of all 77 built-in providers. Other built-in providers (microsoft-foundry, ollama, etc.) keep the existing config registration hint which is the correct recovery path for them.
|
@clawsweeper re-review v3: narrowed blast radius from 77 built-in providers → 1 legacy alias (openai-codex).
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Terminal proof — error path for canonical openai-codex/gpt-5.4: v3 narrows the auth hint to ONLY legacy openai-codex (not all 77 built-in providers). oxfmt/oxlint/autoreview 0.95 all clean. |
|
@clawsweeper re-review — real CLI proof: direct production function call triggers the exact openai-codex error path This terminal output exercises the exact error path from the issue (#100066). The script imports resolveModelAsync from our modified source, passes openai-codex/gpt-5.4 with no auth, and prints the corrected hint message. 122 tests pass. oxfmt/oxlint/autoreview 0.95 clean. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review — fixed auth command syntax: |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review — PR body updated with fresh production-function proof (current HEAD): resolveModelAsync("openai-codex", "gpt-5.4") output confirmed with --provider flag, doctor --fix, legacy alias, docs link all PASS |
|
Thanks @ZOOWH. This was a solid fix candidate, and the production-path proof helped validate the supported recovery direction. We selected and merged #100120 as the canonical implementation. It covers the same legacy If the merged fix missed behavior unique to this branch, point us at that exact delta and we can reopen. |
What Problem This Solves
When
openai-codex(legacy alias folded intoopenai) has no auth profile, the runtime error prescribes a config edit the validator rejects — brickwalling the gateway. Fix: detect legacy alias, point to OAuth login or doctor migration.Closes #100066.
Fix (4 lines)
src/agents/embedded-agent-runner/model.ts: checknormalizeProviderId === "openai-codex"before generic config hint. Blast radius: 1 alias.Evidence
Real behavior proof — production function call (current HEAD)
The proof script imports
resolveModelAsync(the same function the CLI gateway uses), passesopenai-codex/gpt-5.4with no auth profile — the exact scenario from #100066 — and asserts the corrected hint message contains all required guidance.Test suite (122 tests)
Before/After
openclaw models auth login --provider openai"Pre-submit
oxfmt/oxlint clean | autoreview 0.95 | 122 tests
Change Type
Bug fix | model-resolution | 2 files, +50/-1, XS