fix(desktop): honor the composer's provider/model at session spawn - #813
Merged
Conversation
serve built ONE spawn closure at startup with the config default provider and
reused it for every session — the provider/model/effort the desktop sends in
session.create were silently ignored. Consequence: if the default provider is
broken (an expired Claude subscription, a missing key), the app is unusable
and switching the model in the composer does NOT help, because the new
session still boots the broken default and fails at build:
agent-server failed to start: Claude OAuth request failed (400):
invalid_grant — Refresh token not found or invalid
Now DesktopServeState carries the base AgentServerConfig and builds a
per-session spawn (dataclasses.replace + make_spawn_agent) honoring the
create params' provider/model/reasoning_effort; an empty selection falls
back to the shared default spawn. So selecting a provider with a working key
(e.g. deepseek) actually runs on it.
Verified live: session.create {provider: deepseek, model: deepseek-v4-flash}
spawns deepseek-v4-flash with no OAuth error (previously booted anthropic).
2 new pytest cases (override reaches the spawn; no-override uses the base
spawn); 60 desktop tests green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agentforce314
enabled auto-merge (squash)
August 8, 2026 16:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug you hit
Two things were going on:
default_providerisanthropicon a Claude subscription (no API key), and the OAuth refresh token has expired/invalidated — so the subscription session is dead.clawcodex servebuilt one spawn closure at startup with the config's default provider and reused it for every session — theprovider/model/reasoning_effortthe composer sends insession.createwere silently ignored. So a new session always re-booted the broken default and failed at build.Fix
DesktopServeStatenow carries the baseAgentServerConfigand builds a per-session spawn (dataclasses.replace+make_spawn_agent) honoring the create params' provider/model/effort. An empty selection falls back to the shared default spawn.Verified live
session.create {provider: deepseek, model: deepseek-v4-flash}now spawns deepseek-v4-flash with no OAuth error (previously booted anthropic and died). 2 new pytest cases; 60 desktop tests green.🤖 Generated with Claude Code