Repository navigation
fix: use the configured runtime when switching model providers - #203973
vyctorbrzezowski merged 2 commits into
Conversation
OpenClaw-Publication: e9c20c63-2537-49bc-8876-d2d068ff6baa
|
🦞👀 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 clears an inherited session runtime pin when switching providers so the selected model uses its configured route. Example: Switch from openai/gpt-5.6-sol with an openclaw runtime pin to anthropic/claude-sonnet-4-6 configured for claude-cli.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-authored draft open: the provider-switch change is coherent, remains absent from current main, and introduces no definite code defect found in review. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherChat directives, Gateway patches, and SDK selections resolve model and runtime intent before validating and persisting the session selection used by subsequent turns. flowchart TD
A[Chat directives] --> D[Runtime selection rule]
B[Gateway model patch] --> D
C[SDK model selection] --> D
D --> E[Configured route preparation]
E --> F[Session persistence]
F --> G[Next agent turn]
Technical reviewBest possible solution: Keep provider-change handling in the existing shared resolver and prepare the configured route without the previous provider's inherited pin. Do we have a high-confidence way to reproduce the issue? Current-main source preserves an openclaw pin across an OpenAI-to-Anthropic switch because openclaw is universally compatible; the PR also reports a failing-base/passing-head handler reproduction, which was not rerun during this read-only review. Is this the best way to solve the issue? The patch is a focused implementation of the maintainer-approved policy: existing callers supply previous-provider context and route preparation consumes the cleared selection before resolving capabilities. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 90ed7ec5ff01. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +14, Tests +47, Docs 0. Total +61 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 23, 2026, 2:18 AM ET / 07:18 UTC. |
|
Merged via squash.
|
…law#203973) * fix: use the configured runtime when switching model providers * fix: use the configured runtime when switching model providers OpenClaw-Publication: e9c20c63-2537-49bc-8876-d2d068ff6baa
* fix: use the configured runtime when switching model providers * fix: use the configured runtime when switching model providers OpenClaw-Publication: e9c20c63-2537-49bc-8876-d2d068ff6baa (cherry picked from commit 5434992)
…chiving (#205026) * fix(sessions): keep inactive chats eligible for cold storage after archiving * test(sessions): align archive fixtures and identity baseline * test(sessions): create a private cold backup restore target (cherry picked from commit 81d69df) Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; ece7a74 improve(workboard): apply the Control UI glossary and style to Workboard copy [not selected for this narrow backport]; b616036 refactor(subagents): simplify ACP spawn relay ownership (#207023) [not selected for this narrow backport]; 93ca762 improve: reduce allocations when preparing session rows (#207109) [not selected for this narrow backport]; 9993328 refactor(subagents): simplify kill claim and ownership handling (#207025) [not selected for this narrow backport]; 97815bd refactor(subagents): consolidate registry cleanup and publication guards (#207064) [not selected for this narrow backport]; e94f799 refactor(subagents): centralize requester turn matching (#206584) [not selected for this narrow backport]; ea77ca3 refactor: report update failures from recorded runs (#206700) [not selected for this narrow backport]; 4d7e00b fix: let started participant runs and requests finish after an access change (#206747) [not selected for this narrow backport]; f89ae43 refactor(subagents): use cleanup and terminal owners in sweeps (#206533) [not selected for this narrow backport]; a882e0f fix(agents): preserve task answers when sessions are reused (#126263) [not selected for this narrow backport]; 81fc833 refactor(subagents): own dormant child Stop decisions (#206479) [not selected for this narrow backport]; 91d4912 fix(update): stop using foreign recovery records as admission (#206295) [not selected for this narrow backport]; be3c73e fix(subagents): finish claimed stops after session rotation (#206405) [not selected for this narrow backport]; ed8b883 fix(update): settle after plugins and share one completion summary (#205987) [not selected for this narrow backport]; 1de306e fix: pause interrupted shell turns when their result is unknown (#205859) [separately ordered lane row]; 16a6aa4 fix(memory): keep a child's memory audience after its parent resets (#205887) [not selected for this narrow backport]; 50a7368 feat: let agents snooze a conversation after replying [not selected for this narrow backport]; 40f3903 fix(ci): remove unused role and workflow exports (#205720) [not selected for this narrow backport]; e43debf refactor(state): migrate in place and remove copy-and-swap (#205165) [not selected for this narrow backport]; 8027293 refactor(plugins): plugin tools take the turn's owner bit; delete the requester-owner continuation (OA2 PR 6j) (#205483) [not selected for this narrow backport]; 13e2ec3 feat: let participants publish through the session's shared GitHub account (#204914) [not selected for this narrow backport]; 5434992 fix: use the configured runtime when switching model providers (#203973) [not selected for this narrow backport]; 5271519 fix(feishu): honor the filename override on sent attachments (#205287) [not selected for this narrow backport]; ca087d4 refactor(admission): drop the replay automationAdmin bit and the R7 source re-check (#205268) [not selected for this narrow backport] Co-authored-by: RomneyDa <[email protected]>
* fix: use the configured runtime when switching model providers * fix: use the configured runtime when switching model providers OpenClaw-Publication: e9c20c63-2537-49bc-8876-d2d068ff6baa (cherry picked from commit 5434992) Release adaptation: Pass the previous provider alongside the stable resolved model and preserve the stable admitted-operator fixture; keep explicit requests atomic across directives, session patch and picker. Initial gateway shard reported 39 failures (35 passed): the donor referenced an undefined previousModel binding on stable. Resolve it once using the stable fallback owner and rerun all selected shards unchanged. Companion audit: PR #203973 is the selected owner change; no later follow-up is required for the selected scope. Co-authored-by: RomneyDa <[email protected]>
Related: #180830 (same-model runtime re-selection).
What Problem This Solves
When a chat already has a runtime selected and you switch to a model from another provider, the chat can keep using the old runtime. For example, an OpenClaw chat switched to Anthropic can try API credentials even when Claude CLI is configured, so the next message fails to start.
User Impact
Switching providers without choosing a runtime now uses the new model's configured route. Picking a runtime explicitly still honors that choice if it is available, and compatible selections stay in place for model changes within the same provider.
Why This Change Was Made
The shared model-selection rule clears an inherited runtime pin on a provider change before preparing the new route. The Gateway applies the rule before committing the patch, and command and SDK selections use it too. No config or schema change is needed.
Evidence
openclaw. With the fix, the Gateway replaces that pin with the configuredclaude-cliroute. An explicit, available runtime still takes precedence. A compatible choice survives a model change within the same provider; an incompatible explicit choice leaves the previous selection intact.9efeeb5b2a09, an isolated Gateway with real native catalogs switched providers usingsessions.patch. The nextchat.senddid not specify a runtime and completed through Claude CLI. The reply matched in Gateway history, the native transcript, and the transport log. An external test reader reported the previous model after a later turn; repeatedsessions.describecalls and fresh SQLite reads showed the new model and runtime.git diff --checkpassed. Independent review found no actionable source changes. No full UI end-to-end run was claimed.🦞 Made with OpenClaw