Repository navigation
fix(config): warn when configured model primary is not in catalog - #40355
dsantoreis wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds a lightweight advisory validation pass — Findings:
Confidence Score: 4/5
Last reviewed commit: 31c52ea |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31c52ea7de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: current main still lacks a generic warning for invalid configured agent model refs, and this focused PR remains useful, but the current head is not merge-ready because it can miss the linked bad-config case, warn on valid alias configs, omit fallbacks, print unsanitized config text, and lacks real doctor output proof. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main accepts agent model refs structurally and only has catalog-backed doctor validation for Is this the best way to solve the issue? No, not as written. Advisory validation is the right direction, but this implementation needs runtime-equivalent resolution, trusted catalog semantics, fallback coverage, sanitizer handling, and real doctor-output proof. Security review: Security review needs attention: The diff introduces config-derived terminal output without routing warning paths and messages through the existing sanitizer path.
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d7a078f1962b. |
Add collectModelConfigWarnings() to validation.ts that checks agents.defaults.model.primary and agents.list[].model against the model catalog. Returns warnings (not errors) to preserve forward compatibility with models that may not be available yet. Wire the check into the doctor health flow as a new "doctor:model-config" contribution, sitting alongside the existing hooks.gmail.model check. Reuses the model catalog loader. 6 targeted tests cover: valid model, unknown default primary, string-form config, per-agent model, no model configured, and empty catalog. Closes openclaw#39811
|
Codex review: found issues before merge. What this changes: The PR adds a config-validation helper, a doctor health contribution, and tests to warn when Maintainer follow-up before merge: This is an active contributor PR with concrete review findings, but the remaining action is maintainer/product review of model-catalog semantics plus author follow-up, not a safe autonomous replacement or close action. Review findings:
Review detailsBest possible solution: Land a focused doctor or shared validation path that resolves model refs the same way runtime/model-picker paths do, distinguishes provider/runtime/static catalog rows from user-declared config rows when warning about unsupported models, keeps catalog inspection read-only where possible, sanitizes terminal output, and covers aliases plus the Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
When a user sets
agents.defaults.model.primaryoragents.list[].modelto a model name that does not exist in the runtime catalog (e.g.openai-codex/gpt-5.4-codexbefore the Codex provider ships it), the config is accepted silently. Every cron job and heartbeat then fails at runtime withFailoverError: Unknown model, and the user has no indication why without reading raw error logs.This adds a lightweight validation pass that checks configured model primaries against the loaded model catalog and surfaces warnings through
openclaw doctor. Warnings, not errors, because forward-compat model names are intentional and the model may appear later.What changed
collectModelConfigWarnings(config, catalog)insrc/config/validation.ts: iteratesagents.defaults.model.primaryand eachagents.list[].model, resolves them through the existingresolveModelRefFromStringpath, and returnsConfigValidationIssue[]when any ref is absent from the catalog.src/commands/doctor.ts: loads the model catalog once and callscollectModelConfigWarnings. Reuses the same catalog instance for the existinghooks.gmail.modelcheck to avoid a redundantloadModelCatalogcall.What did NOT change
No runtime behavior, no config schema, no model resolution logic, no failover paths. This is purely an advisory check surfaced through
doctor.Linked Issues
Validation
Tests
6 targeted tests in
src/config/validation.model-warnings.test.ts: