fix: suggest checking auth for bundled providers in model-not-found error (fixes #100066)#100086
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this branch still misses the linked legacy Canonical path: Land one canonical legacy-alias hint fix from the proof-positive sibling work, keep So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Land one canonical legacy-alias hint fix from the proof-positive sibling work, keep Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows Is this the best way to solve the issue? No. The narrow owner boundary is the shared missing-model hint helper, but the best fix must handle the legacy Security review: Security review cleared: The diff only changes TypeScript error-message branching and focused tests; it adds no dependency, workflow, permission, secret, network, or package-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against b34c188f8f0d. |
…rror When a bundled provider model is missing from the registry, the error message previously told operators to add a models.providers[] config entry. This is actively harmful: the config validator rejects overlays without baseUrl for non-bundled provider ids, creating contradictory guidance that leads to gateway crash-loops (issue openclaw#100066). Now the error detects bundled providers via isBuiltInModelProviderOverlayId and suggests running openclaw models status to check auth instead.
ea2ce5f to
79cd6cf
Compare
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
When a bundled provider (e.g.
anthropic,openai,microsoft-foundry) has no authenticated profile, requesting one of its models produces an error message that tells operators to add amodels.providers[]config entry. Following that advice causes the config validator to reject the config (if the provider id isn't recognized as bundled) or produces a no-op overlay (if it is). Either way, the operator is stuck in a loop: the runtime says "add config" → the validator says "that's wrong" → the gateway crash-loops.This contradictory guidance was reported in issue #100066 where an operator using
openai-codexfollowed the error message verbatim and ended up with a gateway that wouldn't boot.Why This Change Was Made
Bundled providers are registered automatically at startup — they don't need
models.providers[]config entries. When a model from a bundled provider is missing, the most likely cause is a missing or expired auth profile, not a missing config entry.The fix adds a check using
isBuiltInModelProviderOverlayId()and a legacy provider id set before generating the error message. For bundled providers and legacy provider ids (e.g.openai-codex), the message now suggests runningopenclaw models statusto check provider auth. For non-bundled (custom) providers, the existing config-entry guidance is preserved.User Impact
Operators who encounter model-not-found errors for bundled providers or legacy provider ids will now get actionable guidance pointing to the actual cause (missing auth) instead of misleading config instructions that crash the gateway.
Changes Made
src/agents/embedded-agent-runner/model.ts: AddLEGACY_PROVIDER_IDS_AUTH_HINTset with normalizedopenai-codex, extend the auth-check hint branch to cover legacy provider ids alongside built-in overlay idssrc/agents/embedded-agent-runner/model.test.ts: Add regression test foropenai-codex/gpt-5.4model-not-found path, update existing bundled provider test to match unified message formatEvidence
node scripts/run-vitest.mjs run src/agents/embedded-agent-runner/model.test.ts— all 122 tests passedReal behavior proof
node scripts/run-vitest.mjs run src/agents/embedded-agent-runner/model.test.ts— all 122 tests passed including the newopenai-codexregression testObserved result after fix: Bundled providers and legacy provider ids show auth-check guidance; non-bundled providers show config guidance
What was not tested: Full gateway startup scenario with bundled provider lacking auth
AI-assisted (Hermes Agent)