Repository navigation
ACP: stop switching models to list them, and restore settings after a selected-model probe - #7646
Merged
Merged
Conversation
ACP model discovery calls session/set_config_option for each model to read its reasoning options. It did not set the model back afterwards, so an agent that saves accepted selections kept the last probed model as its default. After the probe loop, discovery now sets the model option back to the currentValue that the agent reported at session start. Discovery also does this when single probes fail. When the discovery timeout fires, the bridge kills the connection, so no restore request is sent. If the restore request fails, the bridge writes the error to stderr and returns the catalog. Fixes #4478
Listing an ACP agent's models switched the agent through every model in its model option to read each one's reasoning levels. Agents that save each switch as the user's default, such as Prime Agent, ended every catalog refresh on the last model probed, often with a clamped reasoning level saved too. Listing models now reads only what the agent reports for its current model and never switches. Other models stay "unknown" until the user selects one; the existing selected-model discovery then switches to just that model. Afterwards it sets the session's starting model back and then every other option whose value changed (reasoning level, Fast), within a 10 second budget, including after a failed or timed-out probe. The reasoning probe priority list only ordered the removed sweep, so it is removed from the Cursor and Grok profiles and the bridge options. Fixes #4478 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Picking a model whose reasoning levels are not known yet hid the Reasoning section and the trigger's level label until selected-model discovery returned, so the picker looked like the model had no reasoning and then grew. useThreadCreationOptions now reports isLoadingReasoning while that discovery query is pending, and the picker keeps the Reasoning heading with skeleton toggles and shows a skeleton in the trigger. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexburlis
added a commit
to alexburlis/omnyo
that referenced
this pull request
Nov 27, 2026
…model Port the applicable ACP fixes from get-bb/bb#7788 and get-bb/bb#7646. Preserve existing session restoration, model preferences, and model-specific settings.
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.
Human comments
What was wrong
To read each model's reasoning levels, ACP-native model discovery switched the agent through every model in its
modelconfig option withsession/set_config_option(discoverAcpNativeModelSupportinpackages/provider-bridge-acp/src/bridge/bridge.ts), and never switched back. ACP has no read-only way to ask about another model, so a catalog refresh became up to one settings write per model. Agents that save each switch as the user's default, as Prime Agent documents, ended every refresh on the last model probed. A reasoning level clamped during a switch was saved too. The 5 s sweep budget also meant large catalogs were only partly probed, so models beyond the budget already relied on the selected-model discovery added in #6486.T3 Code never switches models to discover them. It reads the session's initial configuration, takes per-model levels from model metadata when present, and otherwise learns them from real sessions.
This supersedes #7503 by @lanjak. That PR restores the model after the sweep, but the restore is skipped when the 5 s timeout fires (the reporter's bursts reached it), and the clamped reasoning level is not restored. Their commit is kept on this branch.
What changed
packages/provider-bridge-acp/src/bridge/bridge.ts:session/set_config_option. Other models reportreasoningDiscovery: "unknown", which the server and picker already handle: selecting such a model triggers selected-model discovery.reasoningProbePriorityModelIds, which only ordered the removed sweep. It is gone from the Cursor and Grok known-agent profiles, the plugin's bridge options and the bridge option schema. The bridge schema is passthrough, so an older plugin that still sends the field is accepted.plugins/provider-acp/skills/acp-provider/SKILL.mddescribes the new discovery and restore behavior.apps/app): this change sends more models through selected-model discovery. While it ran, the picker hid the Reasoning section and the trigger's level label, so the model looked like it had no reasoning, and the popup grew when the levels arrived.useThreadCreationOptionsnow returnsisLoadingReasoningwhile that query is pending (false once it settles, including when it returns no levels).ExecutionControlsandPluginProviderModelPickerpass it toModelReasoningPicker, which keeps the Reasoning heading with three skeleton toggles of the buttons' height and shows a skeleton in place of the trigger's level label.No server/daemon wire change:
selectedModelalready exists (protocol 258), and provider options are opaque to the daemon.Behavior change: right after a catalog refresh, only the agent's current model shows reasoning choices. Other models show them once selected, after one short probe. Models past the old 5 s budget already worked this way.
How you verified
origin/main'sbridge.tsand pass with this change:session/set_config_option, and only the current model's levels are known;model=<starting>theneffort=<starting>;pnpm exec turbo run lint lint:type-aware typecheck test --filter=@bb/provider-bridge-acp --filter=bb-plugin-provider-acp: 590 passed / 4 skipped, and 85 passed; 0 lint warnings.oxfmt --checkis clean.pnpm start:worktreeinstance with a custom ACP agent that saves each model switch and clamped reasoning level to a settings file, as Prime does:bb provider models acp-saverchanged the saved default fromacme/alphatoacme/delta.bb provider modelssent no switches, and settings were unchanged.--selected-model acme/deltaloggedset model acme/delta,clamped effort high,set model acme/alpha,set effort medium. It ended atalpha/mediumwith delta's levels["high"].--selected-model acme/gammarestored only the model, because nothing was clamped.useThreadCreationOptions.test.tsxnow checks thatisLoadingReasoningis true while selected-model discovery is pending, false once the levels arrive, and false when discovery returns no levels.turbo run typecheck lint --filter=@bb/apppasses, and the 17 affected app test files pass (378 tests). In the worktree instance, with an agent that takes 3 s per change, picking an unchecked model showed 3 menu skeletons and 1 trigger skeleton with no reasoning radios. About 9 s later it showed the 3 real radios and no skeletons, and the popup kept its height.Fixes #4478
🤖 Generated with Claude Code