Repository navigation
Description
Problem: Model switch in same session breaks all tool calls (2026.6.10 regression)
After switching the LLM model within the same session using /model, all tool calls (including web_fetch, exec,
ead, web_search) immediately fail with errors. The issue does not occur in version 2026.4.22. A brand new session with the target model works fine, confirming the problem is specific to the model-switch code path.
Affected Version: 2026.6.10 (latest)
Working Version: 2026.4.22
Model Transition Tested: Kimi 2.6 (multimodal) ? Step-3.5-Flash (text-only)
Reproduction Steps
- Open a session with a model (e.g., Kimi 2.6).
- Verify tools work: web_fetch https://example.com ? success.
- Switch model: /model step-3.5-flash.
- Immediately try tool calls again:
- web_fetch https://example.com ? (Command exited with code 1) no output
- exec --help ? same error
- web_search test ? "web_search is disabled or no provider is available."
ead .\README.md ? likely fails
5. Open a brand new session (default Step-3.5-Flash) ? tools work normally.
Expected Behavior
After switching model, tool calls should work normally with the new model. The session should re-negotiate tool schemas and re-initialize tool context.
Actual Behavior
All tools become non-functional. The tool provider registry appears cleared or disabled, causing every tool call to abort or report disabled state.
Error Examples
Tool error (Command exited with code 1) Tool error: "web_search is disabled or no provider is available." Web Fetch Error: Operation aborted
Likely Root Cause
The 2026.6.10 release introduced several state-management changes (fast-mode, channel origin reset, trusted policies) that may inadvertently clear or fail to reinitialize the tool context during model switch. The session likely retains stale tool schema cache that is incompatible with the new model (e.g., multimodal fields for a text-only model), or provider plugins are unloaded without re-registration.
Relevant Changelog (2026.6.10)
- PR feat: fast talks auto mode #85104: fast-mode state persistence
- PR fix(sessions): reset stale per-channel origin fields on channel switch #95328: reset stale per-channel origin fields on channel switch
- PR fix: keep trusted policies with hook registry #94545: trusted policies survive hook composition
- PR fix(zai): fall back to manifest baseUrl for synthesized GLM-5 models #94461 / fix(agents): classify Zhipu GLM overload as overloaded for failover #93241: Zai/GLM model catalog and failover
None explicitly address model-switch tool renegotiation, suggesting a regression.
Workaround
Avoid switching models in an active session. Instead, start a new session with the desired model.
Request
Investigate the model-switch code path (/model command handler) to ensure it properly:
- Clears tool context cache
- Re-discovers the new model's tool-calling capabilities
- Re-registers all enabled providers
- Initializes a fresh tool execution pipeline
Reported by user Supreshone via assistant Xiao Wei on 2026-07-01.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 1, 2026
ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed July 1, 2026, 12:10 AM ET / 04:10 UTC.
Summary
Codex review failed: timeout (exit 0).
Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.
Ways to help us reproduce this
Next step
Review did not complete, so no work-lane recommendation was made.
Review details
Best possible solution:
Retry the Codex review after fixing the execution failure.
Do we have a high-confidence way to reproduce the issue?
Unclear. The review failed before ClawSweeper could establish a reproduction path.
Is this the best way to solve the issue?
Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.
AGENTS.md: unclear because the file could not be read completely.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 21d1e1f0fc9d.
Label changes
Label changes:
issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.Evidence reviewed
What I checked:
Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.yetval commentedon Jul 1, 2026
I tried to confirm this on current
main(be2c4c65ab) and could not reproduce a model-switch that breaks tool calls. Sharing what I traced in case it helps narrow the repro, plus a few specifics that would let someone reproduce it.The
/modelswitch path re-derives tool state on every attempt rather than reusing a cached one:sessions.patch->applyModelOverrideToSessionEntry(src/sessions/model-overrides.ts) setsliveModelSwitchPendingand clears the cachedcontextTokens/contextBudgetStatusand stale runtimemodel/modelProviderfields.shouldSwitchToLiveModel(src/agents/live-model-switch.ts) throwsLiveSessionModelSwitchError, and the retry loop insrc/agents/agent-command.tsreassigns provider/model and re-runs.createOpenClawCodingTools, and the managedweb_searchsuppression (applyModelProviderToolPolicy) is recomputed per attempt from config/auth, not from the model. The per-attempt provider runtime handle inattempt.tsis memoized on the current attempt's provider/model, so a switch starts a new attempt with a fresh handle. I did not find a module-level tool-schema or capability cache keyed on the model.One thing that looks inconsistent in the report:
web_fetchis listed as working before the switch, butweb_search is disabled or no provider is available.is then cited as a post-switch failure. Those are different tools with different requirements. That specific message (src/web-search/runtime.ts) is emitted when no web_search provider resolves, which is a config/provider condition independent of the active model, so it would surface the same way before a switch.To reproduce this I would need:
web_searchwas ever actually available./modelstep showing the switch and the first failing tool call (ideally withLiveSessionModelSwitchErrorand the tool error in context).main, since the referenced2026.6.10differs from HEAD.Happy to take a fix if there is a concrete repro against
main; right now I cannot get the described breakage to occur.openclaw-barnacle commentedon Jul 16, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
Supreshone commentedon Jul 17, 2026
Going back through my full session logs from around when I opened this — I owe everyone an honest update.
The web_search failure I saw was real, but it was a "SearXNG base URL is not configured" error, i.e. a missing-config condition that would have shown up the same way regardless of which model was active. The web_fetch calls in the same session worked fine because they don't need that provider. So my original write-up bundled two unrelated things into "the /model switch broke tools", and that was my mistake. yetval called it correctly on that point.
The session itself ended cleanly (exit 0, no LiveSessionModelSwitchError in the trace), so I can't honestly claim a model-switch regression on current main either.
If I hit this again I'll keep logs and a concrete repro before reopening. For now I'm closing this out — sorry for the noise on the maintainers' queue.