Repository navigation
Discover selected ACP reasoning and preserve unset execution levels - #6486
Merged
Merged
Conversation
ymichael
force-pushed
the
bb/4367-selected-reasoning-complete
branch
2 times, most recently
from
October 28, 2026 22:25
0902333 to
33eb9a8
Compare
Port the complete approach from PR #4391 to current main, preserving current environment contribution, session catalog, service tier, and queued-message behavior. Probe a selected unadvertised ladder on demand and preserve absent inferred reasoning through server, runtime, queue, retry, and fork paths. Keep explicit CLI/SDK levels. Includes migration, protocol 258, and Plugin SDK 0.6.99.
ymichael
force-pushed
the
bb/4367-selected-reasoning-complete
branch
from
October 28, 2026 22:58
5a8aa05 to
d935791
Compare
…eftovers The provider boundary no longer requires reasoningDiscovery to be "known": a level is sent when the cached catalog lists it, or when the model is not in the cache (cold or ephemeral-host catalogs keep their existing behaviour). reasoningDiscovery now only decides whether the picker probes a model. Restore required ReasoningLevel types in the app, stop persisting an empty reasoning preference, revert unrelated formatting churn, and bump the plugin SDK and host-daemon protocol one step above main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…obes - Full refreshes and live-session catalogs keep a model's discovered reasoning when they report it unknown; a selected-model probe that settles after a concurrent refresh is no longer discarded. - A probe the agent answers without levels is not repeated until the catalog is invalidated; failures keep the 30 s cooldown. - reasoningDiscovery defaults to "known", so only providers that mark models unknown (ACP) are probed. - ACP selected-model discovery gets the normal 30 s startup budget and a full 5 s probe. - The send-time catalog lookup is synchronous, skips plugin env resolution, creates no cache entries, and falls back to the project checkout catalog for new worktrees. - Declare selectedModel on the daemon listModels type and reuse the base catalog selection when no discovered catalog replaces it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Nov 3, 2026
Sync Aleph to upstream bb 9f7c6eb (get-bb#6486, resolves plugin-api-docs surfaces.ts)
ymichael
added a commit
that referenced
this pull request
Nov 17, 2026
… selected-model probe (#7646) ## Human comments ## What was wrong To read each model's reasoning levels, ACP-native model discovery switched the agent through every model in its `model` config option with `session/set_config_option` (`discoverAcpNativeModelSupport` in `packages/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`: - Listing models reads only the levels the agent reports for its current model and sends no `session/set_config_option`. Other models report `reasoningDiscovery: "unknown"`, which the server and picker already handle: selecting such a model triggers selected-model discovery. - Selected-model discovery switches to that one model (same 5 s budget, and the same one retry for an unconfirmed reply). It then sets the session's starting model back, followed by every other option whose value changed (reasoning level, Fast). This runs after success, failure and timeout, within a 10 s restore budget, before the existing session teardown. - Removed `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.md` describes the new discovery and restore behavior. - Model picker (`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. `useThreadCreationOptions` now returns `isLoadingReasoning` while that query is pending (false once it settles, including when it returns no levels). `ExecutionControls` and `PluginProviderModelPicker` pass it to `ModelReasoningPicker`, 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: `selectedModel` already 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 - New bridge tests, which fail against `origin/main`'s `bridge.ts` and pass with this change: - listing a 3-model catalog sends no `session/set_config_option`, and only the current model's levels are known; - after a selected probe that changes the model and clamps the reasoning level, the bridge sends `model=<starting>` then `effort=<starting>`; - the model is restored after a failed probe; - the model and effort are restored after a timed-out probe. - Sweep-only tests removed. The stale-reply, Cursor and empty-thought-level tests now use selected-model discovery. - `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 --check` is clean. - Live in a `pnpm start:worktree` instance with a custom ACP agent that saves each model switch and clamped reasoning level to a settings file, as Prime does: - Before (main): one `bb provider models acp-saver` changed the saved default from `acme/alpha` to `acme/delta`. - After: server start and `bb provider models` sent no switches, and settings were unchanged. - `--selected-model acme/delta` logged `set model acme/delta`, `clamped effort high`, `set model acme/alpha`, `set effort medium`. It ended at `alpha/medium` with delta's levels `["high"]`. - `--selected-model acme/gamma` restored only the model, because nothing was clamped. - Picker skeleton: `useThreadCreationOptions.test.tsx` now checks that `isLoadingReasoning` is 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/app` passes, 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. - Known limit: with an agent that takes 5.5 s per setting change, the model was restored but the reasoning-level restore exceeded the 10 s budget. Fixes #4478 > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: rufi <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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
ACP's bounded catalog scan (five seconds) reaches only part of a large model list. For models it didn't reach, BB showed a fabricated single "Medium" reasoning choice and sent that setting to the agent, replacing the agent's own reasoning setting with a level the user never chose. Replaces #6477.
What changed
bb provider models --selected-modeland the SDKselectedModelquery.AvailableModel.reasoningDiscovery: "unknown" | "known": distinguishes "not checked yet" from "checked, no selectable levels". Defaults to"known", so only providers that mark models unknown (ACP) get probed. This flag only drives probing; it has no effect on what is sent.reasoningDiscoveryfield andselectedModelmodel-list param); host-daemon protocol 258 (provider.list_models.selectedModel, andoptions.reasoningLevelmay be absent).No database migration.
NewThreadRequest.reasoningLeveland queued-message reasoning stay required.Behaviour changes
How you verified
thread-command-reasoning.test.tscovers start and follow-up commands across unknown, unprobed-with-levels, confirmed-empty, unsupported, supported and uncatalogued models, plus host/workspace catalog scoping. Against the previous discovery-gated rule it fails (unprobed-with-levels: expected undefined to be 'high'); it passes with this change.Fixes #4367
🤖 Generated with Claude Code