Skip to content

fix: legacy Codex model miss no longer suggests invalid config#100161

Closed
zhangguiping-xydt wants to merge 2 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-issue-100066
Closed

fix: legacy Codex model miss no longer suggests invalid config#100161
zhangguiping-xydt wants to merge 2 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-issue-100066

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #100066

What Problem This Solves

Fixes an issue where operators who referenced a legacy openai-codex/* model in agents.defaults.models could receive an Unknown model recovery hint that told them to add models.providers["openai-codex"].models[]. Following that hint can produce a startup validation failure because openai-codex is a legacy provider id and current config validation rejects that provider overlay without baseUrl.

Why This Change Was Made

The recovery hint now treats openai-codex as a legacy Codex route instead of a custom provider registration target. It points operators at openclaw doctor --fix, openclaw models status, and OpenAI/Codex OAuth re-authentication instead of suggesting a models.providers["openai-codex"] edit. This intentionally does not expand the config schema or make openai-codex a new valid provider overlay.

User Impact

Operators no longer get guidance that can turn an unknown-model runtime error into a gateway startup crash-loop. The suggested recovery path now matches the existing legacy migration and auth/status workflows.

Evidence

Real OpenClaw CLI proof with isolated home/state and a valid config containing agents.defaults.models["openai-codex/gpt-5.4"] = {} but no models.providers["openai-codex"] overlay:

$ HOME=[isolated] OPENCLAW_HOME=[isolated] OPENCLAW_CONFIG_PATH=[proof-config] OPENCLAW_STATE_DIR=[isolated-state] pnpm -C [worktree] openclaw infer model run --local --model openai-codex/gpt-5.4 --prompt ping
Error: Unknown model: openai-codex/gpt-5.4. Found agents.defaults.models["openai-codex/gpt-5.4"], but "openai-codex" is a legacy Codex provider id. Do not add models.providers["openai-codex"] without baseUrl; current config validation rejects that legacy provider overlay. Run `openclaw doctor --fix`, then check `openclaw models status` and re-authenticate with `openclaw models auth login --provider openai` if no OpenAI/Codex OAuth profile is available. Use the repaired openai/gpt-5.4 route with Codex runtime metadata. See https://docs.openclaw.ai/concepts/model-providers.
[ELIFECYCLE] Command failed with exit code 1.

[proof] command exit status: 1
[proof] verified real CLI emitted migration/auth recovery hint and did not emit the stale provider-registration hint.

Red/green source-level repro:

  • Added a regression test for agents.defaults.models["openai-codex/gpt-5.4"] with no provider model row. Before the fix, the test failed because the error still said to add models.providers["openai-codex"].models[].
  • After the fix, the same path returns migration/auth recovery guidance instead.
[test] starting test/vitest/vitest.agents.config.ts

 RUN  v4.1.8 [local path redacted]

[vitest] still running with no output for 30000ms (test/vitest/vitest.agents.config.ts).

 Test Files  1 passed (1)
      Tests  121 passed (121)
   Start at  10:32:43
   Duration  57.96s (transform 11.29s, setup 982ms, import 13.49s, tests 43.10s, environment 0ms)

[test] passed 1 Vitest shard in 68.87s

Validator contract unchanged:

[test] starting test/vitest/vitest.runtime-config.config.ts

 RUN  v4.1.8 [local path redacted]

 Test Files  2 passed (2)
      Tests  18 passed (18)
   Start at  10:34:07
   Duration  5.61s (transform 7.45s, setup 281ms, import 10.19s, tests 67ms, environment 0ms)

[test] passed 1 Vitest shard in 15.62s

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 1:58 AM ET / 05:58 UTC.

Summary
The branch adds a legacy openai-codex branch to embedded-agent missing-model hint generation and a focused regression test for that recovery text.

PR surface: Source +5, Tests +21. Total +26 across 2 files.

Reproducibility: yes. at source level: current main still emits the generic models.providers[...] hint for unresolved configured openai-codex refs, and current validation rejects that overlay without baseUrl. The PR body also includes redacted terminal output from a real CLI run showing the corrected after-fix hint.

Review metrics: 1 noteworthy metric.

  • Open candidate fixes: 3 open, 1 closed unmerged. Multiple live branches change the same missing-model hint path, so maintainers need one canonical implementation before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/agents/embedded-agent-runner/model.test.ts, migration/backfill/repair: src/agents/embedded-agent-runner/model.ts, vector/embedding metadata: src/agents/embedded-agent-runner/model.test.ts, vector/embedding metadata: src/agents/embedded-agent-runner/model.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #100066
Summary: This PR is one candidate fix for the canonical contradictory openai-codex model-not-found guidance bug; sibling PRs address the same root cause with slightly different wording or test scope.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] Three proof-positive open PRs target the same linked crash-loop recovery bug, so maintainers should select one canonical branch before merging to avoid duplicate hint and test churn.
  • [P1] The changed text is operator-facing OpenAI/Codex recovery guidance, so the final wording should stay aligned with doctor migration, openclaw models status, and canonical openai auth.

Maintainer options:

  1. Select one canonical recovery hint (recommended)
    Land the preferred narrow branch after confirming the final doctor/status/OpenAI auth wording, then close the sibling candidate PRs as duplicates.
  2. Ask one branch to align wording
    If no current branch has the exact desired recovery copy, ask one contributor to align the message and tests before selection.
  3. Pause this branch if another is chosen
    If maintainers choose a sibling PR as canonical, this branch can be paused or closed after that replacement remains viable.

Next step before merge

  • [P2] The branch is a valid candidate, but it overlaps two other proof-positive open PRs, so a maintainer should choose the canonical branch before merge.

Security
Cleared: The diff only changes TypeScript error-message branching and a colocated test; it adds no dependency, workflow, secret, permission, network, or package-execution surface.

Review details

Best possible solution:

Land one canonical narrow hint fix that keeps openai-codex legacy-only, preserves custom-provider guidance, points to doctor/status/OpenAI auth recovery, 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 models.providers[...] hint for unresolved configured openai-codex refs, and current validation rejects that overlay without baseUrl. The PR body also includes redacted terminal output from a real CLI run showing the corrected after-fix hint.

Is this the best way to solve the issue?

Yes, this is the right narrow owner boundary: the shared missing-model hint helper owns the bad recovery text, and the PR avoids reviving openai-codex as a live provider overlay. The remaining decision is which overlapping PR maintainers want as canonical.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 913311845ebd.

Label changes

Label changes:

  • add merge-risk: 🚨 auth-provider: The diff changes operator-facing recovery guidance for a legacy OpenAI/Codex auth route, where wrong wording sends users to the wrong provider/auth recovery path.

Label justifications:

  • P0: The linked bug can move a gateway into a startup crash-loop after an operator follows OpenClaw's own model-provider recovery hint.
  • merge-risk: 🚨 auth-provider: The diff changes operator-facing recovery guidance for a legacy OpenAI/Codex auth route, where wrong wording sends users to the wrong provider/auth recovery path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes redacted terminal output from a real openclaw infer model run --local --model openai-codex/gpt-5.4 run showing the corrected migration/auth hint and absence of the stale provider-registration hint.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted terminal output from a real openclaw infer model run --local --model openai-codex/gpt-5.4 run showing the corrected migration/auth hint and absence of the stale provider-registration hint.
Evidence reviewed

PR surface:

Source +5, Tests +21. Total +26 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 26 0 +26

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/agents/embedded-agent-runner/model.test.ts.
  • [P1] node scripts/run-vitest.mjs src/config/validation.allowed-values.test.ts src/config/config.model-ref-validation.test.ts.

What I checked:

Likely related people:

  • sweetcornna: Commit 1532b46 changed the generic configured-model registration hint text that now misleads legacy openai-codex users. (role: introduced current generic hint behavior; confidence: high; commits: 1532b46e2a63; files: src/agents/embedded-agent-runner/model.ts, src/agents/embedded-agent-runner/model.test.ts)
  • RomneyDa: Commit 9388550 added the nearby runtime-bound model hint branch and test coverage in the same helper. (role: recent adjacent contributor; confidence: high; commits: 938855082ade; files: src/agents/embedded-agent-runner/model.ts, src/agents/embedded-agent-runner/model.test.ts)
  • openperf: Commit e06f6ff added recent doctor migration work for safely merging legacy openai-codex model/provider config into canonical openai, which this PR points operators toward. (role: legacy migration contributor; confidence: medium; commits: e06f6ffc3e87; files: src/commands/doctor/shared/legacy-config-migrations.runtime.models.ts)
  • Pluviobyte: Commit b01e612 recently touched bundled provider overlay validation, the validator boundary that rejects models.providers.openai-codex without baseUrl. (role: adjacent config validation contributor; confidence: medium; commits: b01e6127d96c; files: src/config/zod-schema.core.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (4 earlier review cycles)
  • reviewed 2026-07-05T03:12:58.843Z sha 4c2f25d :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T03:20:18.442Z sha 4c2f25d :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T05:02:37.421Z sha 4c2f25d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T05:09:57.114Z sha 4c2f25d :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Jul 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Thanks @zhangguiping-xydt. The real CLI proof and focused regression made this a credible candidate.

We landed #100120 as the canonical fix for the same openai-codex recovery-hint bug and #100066 is now closed by that merge. I’m closing this sibling PR to avoid carrying duplicate changes in the same helper and test surface.

If there is a concrete case covered here but not by the merged branch, call out the exact difference and we can reopen.

@vincentkoc vincentkoc added the close:duplicate Closed as duplicate label Jul 6, 2026
@vincentkoc vincentkoc closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling close:duplicate Closed as duplicate merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Provider model registration error prescribes a config fix that the config validator rejects (contradictory guidance, gateway crash-loop)

2 participants