Skip to content

fix(acp): preserve model config errors - #2924

Closed
GantisStorm wants to merge 4 commits into
get-bb:mainfrom
GantisStorm:fix/acp-model-config-fallback
Closed

GantisStorm wants to merge 4 commits into
get-bb:mainfrom
GantisStorm:fix/acp-model-config-fallback

Conversation

@GantisStorm

@GantisStorm GantisStorm commented Sep 2, 2026 •

Copy link
Copy Markdown

Human comments

What was wrong

BB can select an ACP agent's model by one of two agent-specific interfaces:

  1. An advertised model config option, selected with the standard session/set_config_option request.
  2. Session model state, selected through the optional session/set_model extension.

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:

Unknown ACP ext method: session/set_model

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-flash caused 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

selectAcpNativeModel now follows the selection mechanism the agent advertises:

  • When a model config option exists, use session/set_config_option and preserve its result or error.
  • Use session/set_model only 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/start returns the original model config probe failed error rather than issuing session/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 --force
    • Typecheck passed.
    • 17 test files and 300 tests passed.
  • Directly initialized OMP 18.1.2 ACP and set the advertised model config option to command-code/deepseek/deepseek-v4-flash; OMP accepted it.
  • After updating the local BB package, started an acp-omp BB thread with command-code/deepseek/deepseek-v4-flash and high reasoning. It completed with the exact expected response command-code-deepseek-v4-flash-high-ok, then completed a normal follow-up hi turn.

Fixes #2925

AGENT GENERATED

@GantisStorm

GantisStorm commented Sep 2, 2026 •

Copy link
Copy Markdown
Author

This remains an independent ACP bridge fix. Please review it independently.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
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.

@github-actions github-actions Bot closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP bridge retries model config errors through unsupported session/set_model

1 participant