Repository navigation
Description
Summary
ACP-native model discovery changes the connected agent's saved settings. To read reasoning levels, bb selects every model in turn with session/set_config_option and never restores the original. An agent that saves ACP selections, as Prime Agent documents, ends each discovery with its global default model (and thinking level) set to the last model probed. Expected: listing models is read-only for the agent.
Versions and environment
- bb desktop 0.44.0 (latest release), macOS 26 (darwin 25.6.0), local daemon, default data dir.
- Code path unchanged on
mainatb23150d88ecc42bcd0e8f96386be0db23f0b1fe4. - ACP agent: Prime Agent 0.9.6 (
prime-agent --mode acp) as a custom agent, 65 models in its ACPmodeloption.
Steps to reproduce
- Install Prime Agent 0.9.6 with at least two models configured. Note
defaultProvider,defaultModelanddefaultThinkingLevelin~/.prime/agent/settings.json. - Register it without
modelCli:bb plugin config provider-acp set customAgents '[{"id":"prime","displayName":"Prime Agent","command":"prime-agent","args":["--mode","acp"]}]'
- Trigger a catalog refresh, wait a few seconds for the background refresh, then read the settings again:
bb provider models acp-prime --json >/dev/null; sleep 15 python3 -c 'import json,os;s=json.load(open(os.path.expanduser("~/.prime/agent/settings.json")));print(s["defaultProvider"],s["defaultModel"],s["defaultThinkingLevel"])'
Expected vs actual
Expected: the three values are unchanged.
Actual: defaultModel becomes the last model in the agent's model option (here anthropic/claude-opus-4-6-thinking). When that model does not support the previous thinking level, defaultThinkingLevel is clamped and saved too (here medium → high). Every new Prime session, inside or outside bb, then starts on that model.
Evidence
- Observed 54 times between 2026-09-27T00:22Z and 2026-09-28T19:25Z on 0.44.0. Each burst of 25–67 model selections (one
model_selectper probe step in Prime's extension log; median 2.7 s, max 5.0 s) started 0.6–10 s after bb opened a Prime session in<data dir>/provider-maintenance-workspace. 54 of 54 bursts matched such a session, and no burst had any other source. Bursts shorter than the full model list are consistent with the discovery timeout. - Steps 1–3 describe the configuration under which those 54 occurrences were recorded. I did not re-run them after applying the workaround, to avoid changing the live default again.
- The probe loop selects each model and returns without restoring the original value:
packages/provider-bridge-acp/src/bridge/bridge.ts#L935-L1016, called fromloadSessionDiscoveredModels(#L816) wheneverlistCommandis undefined (#L2393). The session runs in the maintenance workspace fromapps/host-daemon/src/runtime-manager.ts#L1121. - Prime Agent documents the persistence (
docs/acp.md, "Model and reasoning effort pickers"): "Changes use the same session and saved preferences as Prime Agent's own model and effort controls." In Prime 0.9.6,setModel()callssettingsManager.setDefaultModelAndProvider()on every change, andsetThinkingLevel()saves the level whenever a model switch clamps it.
What you ruled out
- Not a duplicate of ACP model catalog: one failed reasoning probe drops efforts for every later model #4154, ACP reasoning discovery covers ~80 models, so most omp models show a fake single "Medium" that is then sent to the agent #4367 or ACP-native model discovery lists effort-suffixed variants as separate models; only the
modelClipath collapses them #2958. Those concern the accuracy of the discovered catalog. This one concerns the probe's side effect on the agent's saved state. - Inferred, not tested: this is not Prime-specific. Any ACP agent that treats
session/set_config_optionas a user preference change is affected. Zed-style clients select one model at a time, on user action; discovery selects all of them, unattended. - A custom agent with
modelCli(listArgsplusselectFlag) avoids the probe entirely and resolves it. With a list command whose first line isacp-default - …, unpinned threads launch with no model flag and the agent keeps its own default. This is our workaround, verified on 0.44.0.
Suggested priority and effort
Medium. Every catalog refresh silently changes the default model and thinking level for all of the user's sessions of that agent, including sessions outside bb. There is a workaround, but it needs a wrapper script. A likely small fix: after the loop, restore the model option's original currentValue (and the original thought_level), or send a session/set_config_option back to them in a finally. That brings the agent's saved preference back to where it started.
AGENT GENERATED. Investigation from a local Claude Code session; no public thread. Evidence is reproduced above.
Activity
SawyerHood commentedon Sep 30, 2026
Reproduction report: REPRODUCED at the ACP bridge boundary, high root-cause confidence. A synthetic agent that persists accepted selections retained the final discovery model in two clean checkouts at
adbce963ae138ba077afbe011edb414ade4dcf26, repeated by the same agent. Real Prime Agent settings and thinking-level changes remain unverified. The complete regression and both outputs are inline. No production fix or PR.anesthetised commentedon Oct 5, 2026
Same probe pattern from the agent side, different agent: acp-bridge (a fork of BlakeHung/acp-bridge — anesthetised/acp-bridge@d261ed1) advertising 552 backend models in its
modeloption — bb desktop 0.45.0, macOS 27.0.1.session/set_config_optionrequests in ~1 s, all accepted by the agent — matches the per-model probe loop and discovery-timeout behavior described above._metaflag on the request) would let agents skip persistence without bb needing to restore anything.ACP: stop switching models to list them, and restore settings after a…