Repository navigation
fix(acp): preserve model config errors - #2924
Closed
GantisStorm wants to merge 4 commits into
Closed
GantisStorm wants to merge 4 commits into
GantisStorm wants to merge 4 commits into
Conversation
Author
|
This remains an independent ACP bridge fix. Please review it independently. |
Contributor
|
Thanks @GantisStorm for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
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
BB can select an ACP agent's model by one of two agent-specific interfaces:
modelconfig option, selected with the standardsession/set_config_optionrequest.session/set_modelextension.The bridge used the first interface when present, but caught every error from that request and unconditionally retried with the second. That retry was unsafe: advertising a model config option does not imply support for
session/set_model.OMP exposes the first interface and correctly rejects the second. A failed config-option request therefore became the misleading visible error:
The original config-option error was discarded, making diagnosis impossible. This was a BB ACP bridge compatibility and error-handling bug, not an OMP credential, model-role, or Command Code configuration defect.
Scope
This is an independently reviewable ACP bridge correction. It follows the interface each ACP agent advertises and preserves the original configuration error when that interface fails; it does not alter Browser behavior, OMP credentials, model roles, or Command Code configuration.
Why it appeared to break Command Code
Command Code is the model route selected inside the OMP ACP session; it was never reached during the failed startup. Selecting
command-code/deepseek/deepseek-v4-flashcaused BB to create an OMP session and request that model through OMP's advertised config option. When that request threw, BB issued the unsupported fallback and aborted startup before OMP could send a prompt to Command Code.The failure was therefore in BB's ACP setup layer, not Command Code. The subsequent DeepSeek Flash/high thread completed through the same OMP route, confirming that OMP and Command Code are healthy.
What changed
selectAcpNativeModelnow follows the selection mechanism the agent advertises:session/set_config_optionand preserve its result or error.session/set_modelonly when the agent exposes session-model state without a model config option.This is intentionally narrow. Successful config-option selection is unchanged. Agents that use the session-models-only route retain the existing fallback behavior. Reasoning-level and service-tier selection are untouched.
The replaced regression test simulates an agent with a model config option whose selection fails. It verifies that
thread/startreturns the originalmodel config probe failederror rather than issuingsession/set_model.Why this is correct
ACP model-selection implementations vary by agent. BB must use the interface the agent actually advertises rather than infer an optional extension from an unrelated failure. Returning the original ACP error gives users and diagnostics the actionable cause if a real model-configuration failure happens again.
The initial OMP config-option failure could not be attributed after the fact because the previous bare catch discarded it. Subsequent direct OMP ACP selection and BB end-to-end validation both succeeded, so there is no evidence of a persistent OMP or Command Code configuration problem.
How you verified
pnpm exec turbo run typecheck test --filter=@bb/provider-bridge-acp --forcemodelconfig option tocommand-code/deepseek/deepseek-v4-flash; OMP accepted it.acp-ompBB thread withcommand-code/deepseek/deepseek-v4-flashandhighreasoning. It completed with the exact expected responsecommand-code-deepseek-v4-flash-high-ok, then completed a normal follow-uphiturn.Fixes #2925