Repository navigation
fix(agents): subagent spawn rejects configured ClawRouter models as not chat-capable - #186596
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR stops converting plain discovered chat grants into chat vetoes when configured model routes differ. Example: Spawn a subagent using clawrouter/openai/gpt-6.1-sol configured with baseUrl https://clawrouter.openclaw.ai.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR fixes a source-confirmed subagent admission bug still present on main, but its added tests trigger the test-line ratchet. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherProvider discovery and authored configuration enter the shared model merge; its metadata feeds model registries and prepared catalogs used by subagent admission before runtime transport resolution. flowchart LR
A[Credential scoped discovery] --> C[Shared provider merge]
B[Authored model configuration] --> C
C --> D[Model registry]
D --> E[Prepared model catalog]
E --> F[Subagent admission]
F --> G[ClawRouter runtime resolution]
Technical reviewBest possible solution: Keep the focused shared-merge repair and consolidate its regressions into the existing ClawRouter coverage so the test-line gate passes. Do we have a high-confidence way to reproduce the issue? Source inspection connects credential-scoped discovery's chat:true metadata to the off-route merge veto and the resolver's chat:false rejection; the PR reports a before-failing regression, but no target code was executed during this review. Is this the best way to solve the issue? The production change is the smallest focused repair in the existing merge owner: it restores unknown legacy-chat semantics for plain grants while preserving explicit configuration and typed-route rejection. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd566f3b1d1d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +3, Tests +246. Total +249 across 3 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 28, 2026, 2:58 AM ET / 06:58 UTC. |
|
Merged via squash.
|
…ot chat-capable (openclaw#186596) * fix(agents): allow subagent spawns on configured ClawRouter models * test(agents): fold ClawRouter route-change regression into existing grant test
…aw#201513) Static dual chat/Decision rows keep chat on a changed route through the catalog overlay; mergeProviderModels keeps vetoing discovered decision-bearing grants on another route (openclaw#186596), so a typed-only ClawRouter Luna stays refused on the refreshed catalog. Replace the resolver table with one overlay regression.
#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main fd4807a turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes #201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and #186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main fd4807a; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: #201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]>
openclaw#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main 07aa1df turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes openclaw#201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (openclaw#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and openclaw#186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main 07aa1df; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: openclaw#201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]>
#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main fd4807a turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes #201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and #186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main fd4807a; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: #201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 39a215a) Companion disposition: bundled dual chat/Decision row and catalog overlay/matching contracts are present-equivalent. Codex d32063f96c models-manager/models.json:700 and app-server/src/models.rs:16 confirm the subscription route exposes Luna as a normal model; no Codex fork changes needed. No later same-path or PR follow-ups. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes:
sessions_spawnrejects configured ClawRouter models with "Model clawrouter/ does not support chat inference". This happens even when the same model runs fine as the main session model.User Impact
Subagents can spawn on configured ClawRouter models again, for example
clawrouter/anthropic/claude-opus-5-5andclawrouter/openai/gpt-6.1-sol. This works whether the model is passed as an override or inherited from the parent session. These rows also reappear in model lists that hide chat-incapable entries.Known limit: a typed-only row such as
clawrouter/openai/gpt-6-luna, configured on the bare service root, is still refused for chat. This is unchanged and is the conservative behavior.Why This Change Was Made
ClawRouter discovery marks each granted row
inference: { chat: true }on its own endpoint, such as…/v1or…/v1/native/anthropic. Configured rows usually take the provider's rootbaseUrl, so the merge saw a route change. On a route change,mergeProviderModelsreplaced the discovered grant with an explicit{ chat: false }veto. ClawRouter then moves those rows back onto the granted route at runtime, but the veto stayed on them.Main turns never check
inference.chat. Spawn admission does, which is why only subagents failed.After this change, a plain chat grant on a different route becomes unknown, just as if discovery had not matched the row. A row that was never vetoed is now accepted. Typed or non-chat inference, such as decision-capable rows, still becomes
{ chat: false }on a route change. Typed routes therefore never turn into legacy chat. Explicitly configuredinferencestill wins.Evidence
utility-completion.clawrouter.test.ts. It runs the real bundled plugin, credential-scoped discovery, the configured-row merge, the registry and the prepared catalog, with only HTTP faked. A new case configures the provider on the service root (https://clawrouter.openclaw.ai) and adds a plain chat row (GPT-6.1 Sol):main's merge code the new case fails with "does not support chat inference"; with the fix it passes.main).utility-completion.clawrouter,models-config.merge,model-runtime-choice, andextensions/clawrouter;pnpm tsgo:core:testand oxlint on the changed files are clean.provider baseUrl: https://clawrouter.openclaw.ai, configured Opus 5.5, GPT-6.1 Sol and GPT-6 Astra rows.pnpm check:changed: typecheck and lint pass for the changed files. The dead-export scan was skipped because it currently flags unrelated exports onmain.