fix(desktop): Claude model picks + agent avatars after restart - #2701
fix(desktop): Claude model picks + agent avatars after restart#2701Chessing234 wants to merge 4 commits into
Conversation
|
Heads up: #2695 (opened earlier today, also fixing #2692) carries this same fix —
No attachment to whose lands — happy to close #2695 if you'd rather fold the const + readiness dedup in here (the avatar fix bundled in this PR is orthogonal either way), or rebase mine if you prefer to split. Maintainers' call. |
…itch (#2795) ## Summary Fixes #2794. Related: #2692. `resolve_model_switch_method()` reads the `configId` key from each `session/new` `configOptions` entry and skips entries that lack it. `claude-agent-acp` (v0.61.0) keys its entries with `id`, so every model-category entry was skipped, the desired model never matched, and Claude Code sessions fell back to the CLI default from the user's `~/.claude/settings.json`. The only trace was a `pool::model` WARN that never reaches the per-agent log files. This is the ACP-side half of the symptom reported in #2692. The open desktop-side PRs (#2695, #2701, #2696) inject `ANTHROPIC_MODEL` at spawn, which masks the problem for spawn-time selection but leaves the config-option switch path broken. ## Changes - `resolve_model_switch_method()` accepts either `configId` or `id` when extracting the config id. The set request is unchanged: the ACP SDK schema takes `configId` as the request param and the adapter resolves it against its `id`-keyed entries, so only the read side needed fixing. - Regression test with an `id`-keyed `configOptions` payload mirroring the real adapter response (including `models: null`, so the unstable fallback path cannot rescue the match). - Doc comment on `extract_model_config_options()` notes the key drift. ## Testing `cargo test -p buzz-acp --lib`: 599 passed, 0 failed. The new test fails on main and passes with this change. Verified against the real adapter: a stdio JSON-RPC probe of the bundled `claude-agent-acp` 0.61.0 confirms `session/new` returns `id`-keyed config options with `opus[1m]` present as a value, and the SDK's `SetSessionConfigOptionRequest` schema accepts `{sessionId, configId, value}` as sent by `session_set_config_option()`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: chillerno1 <gh.chiller@pm.me> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
b0b2db9 to
e6c5769
Compare
Wire the claude runtime's model_env_var so Edit Agent selections reach spawned sessions, and treat ANTHROPIC_MODEL as a derived key. Closes block#2692 Signed-off-by: Taksh <takshkothari09@gmail.com>
Prefer the managed agent avatar URL before the profile query cache so custom icons don't flash to monograms on cold start. Closes block#2576 Signed-off-by: Taksh <takshkothari09@gmail.com>
Single const for discovery, derived-key filter, and readiness so the key cannot drift; pin claude runtime shape with a regression test. Signed-off-by: Taksh <takshkothari09@gmail.com>
Move the regression test into a sibling module so discovery/tests.rs does not grow past the over-limit baseline. Signed-off-by: Taksh <takshkothari09@gmail.com>
e6c5769 to
63a2c01
Compare
|
Rebased onto latest CI workflows are waiting on maintainer approval for this fork push — please Approve and run workflows when you can. |
|
@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance? |
…itch (block#2795) ## Summary Fixes block#2794. Related: block#2692. `resolve_model_switch_method()` reads the `configId` key from each `session/new` `configOptions` entry and skips entries that lack it. `claude-agent-acp` (v0.61.0) keys its entries with `id`, so every model-category entry was skipped, the desired model never matched, and Claude Code sessions fell back to the CLI default from the user's `~/.claude/settings.json`. The only trace was a `pool::model` WARN that never reaches the per-agent log files. This is the ACP-side half of the symptom reported in block#2692. The open desktop-side PRs (block#2695, block#2701, block#2696) inject `ANTHROPIC_MODEL` at spawn, which masks the problem for spawn-time selection but leaves the config-option switch path broken. ## Changes - `resolve_model_switch_method()` accepts either `configId` or `id` when extracting the config id. The set request is unchanged: the ACP SDK schema takes `configId` as the request param and the adapter resolves it against its `id`-keyed entries, so only the read side needed fixing. - Regression test with an `id`-keyed `configOptions` payload mirroring the real adapter response (including `models: null`, so the unstable fallback path cannot rescue the match). - Doc comment on `extract_model_config_options()` notes the key drift. ## Testing `cargo test -p buzz-acp --lib`: 599 passed, 0 failed. The new test fails on main and passes with this change. Verified against the real adapter: a stdio JSON-RPC probe of the bundled `claude-agent-acp` 0.61.0 confirms `session/new` returns `id`-keyed config options with `opus[1m]` present as a value, and the SDK's `SetSessionConfigOptionRequest` schema accepts `{sessionId, configId, value}` as sent by `session_set_config_option()`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: chillerno1 <gh.chiller@pm.me> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
63a2c01 to
532a10b
Compare
Summary
ANTHROPIC_MODELat spawnTest plan
just ciCloses #2692
Closes #2576
Made with Cursor