Skip to content

Fix OpenCode question routing in ACP sessions - #4695

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-github-issue-4530-thr_ddiqvs2udm
Oct 2, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-github-issue-4530-thr_ddiqvs2udm

Conversation

@ymichael

@ymichael ymichael commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

OpenCode can expose its native question tool in ACP sessions even though BB has no handler for that question extension. Calling it never creates a BB interaction and can leave the turn waiting indefinitely.

What changed

Launch OpenCode sessions with OPENCODE_CLIENT=acp and OPENCODE_ENABLE_QUESTION_TOOL=false after merging inherited and custom launch environment values. This removes the unsupported native tool while preserving the ask-user-question plugin’s AskUserQuestion tool. The shared path covers new, resumed, forked, and rebuilt sessions, including custom agents declaring the OpenCode dialect. Other ACP dialects and user configuration files are unchanged. Updated provider guide, skill, and configuration documentation. No API, CLI, database, or server/daemon wire changes.

How you verified

  • Process-launch regression fails before the fix and passes afterward, with an unchanged generic ACP control.
  • pnpm exec turbo run test lint typecheck --filter=@bb/provider-bridge-acp: 332 tests passed, 4 skipped; lint and typecheck passed.
  • ACP recorded parity: 10 passed, 1 skipped using an empty allowlist (the repository allowlist contains historical changes already present on both sides).
  • Real OpenCode 1.18.15 isolated tool listing: native question is present under the control environment and absent under the fixed environment.
  • Real isolated BB build on pushed head with OpenCode 1.18.15 and opencode/mimo-v2.6-flash-free: clicked Teal in the question card, received RECEIVED_COLOR=Teal; follow-up Square returned RECEIVED_SHAPE=Square.
  • Native question absent at initial launch and after stop/resume despite enabling it in user/project/inline config and custom launch environment. Follow-up provider output reports it unavailable. Normalized user/project config SHA-256 hashes unchanged.
  • Cursor ACP control: its question tool still returned RECEIVED_COLOR=Amber. Duplicate response rejected with HTTP 409; cancelling a recovery question records interrupted/user, and a subsequent question works.
  • Final-head CI: 24 successful checks, 3 skipped; no failures or pending checks.
  • Review fixture: https://ymichael--19027.getbb.app/projects/proj_wfr6nt6h5k/threads/thr_5zcrimsyfh (owner-authorized BB Connect access).
  • Limitations: reported OpenCode 2.0.18 desktop flow and real pre-fix native-question hang not reproduced; initial paid OpenAI attempt stopped for exhausted API credit. An initial fixture config gained OpenCode’s normal $schema field before the normalized hash baseline. No personal OpenCode config was changed.

Fixes #4530

AGENT GENERATED

@ymichael
ymichael marked this pull request as ready for review October 2, 2026 05:37
@ymichael
ymichael merged commit 1f73cd7 into main Oct 2, 2026
27 checks passed
@ymichael
ymichael deleted the bb/fix-github-issue-4530-thr_ddiqvs2udm branch October 2, 2026 06:08
SawyerHood pushed a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

The built-in Grok ACP provider inherited the ACP default of
`supportsManualCompaction: false`. The server rejected compaction with
HTTP 409 before dispatching to the ACP bridge. The verified
[reproduction and root-cause
report](https://get-bb.github.io/reports/issues/4378.html) records the
failure in two clean checkouts.

## What changed

Enabled manual compaction for the built-in Grok ACP provider, extended
the public thread compaction test to cover its request, updated the
existing provider expectation, and documented the CLI behavior in the
ACP provider skill. No protocol or wire fields changed. The bridge
already sends `/compact` as a `session/prompt` for every ACP agent and
treats `end_turn` as completed for the `grok` dialect, so no bridge
change is needed.

Rebased onto current `main` (`95ec22f22c`) to resolve a conflict in the
ACP provider skill doc with the OpenCode question-tool paragraph added
in #4695. Both paragraphs are kept.

## How you verified

- Before the fix (capability line removed, rebased tree): `routes
acp-grok compaction onto the bridge's /compact turn` fails with
`{"code":"invalid_request","message":"Provider \"acp-grok\" does not
support manual context compaction"}: expected 409 to be 200`.
- After the fix: `public-thread-compaction.test.ts` and
`first-party-provider-plugins.test.ts` pass (2 files, 8 tests).
- `bb-plugin-provider-acp` tests pass (68), and
`@bb/provider-bridge-acp` tests pass (348 passed, 4 skipped).
- `pnpm exec turbo run lint typecheck` passes for `@bb/server`,
`bb-plugin-provider-acp`, and `@bb/provider-bridge-acp`.
- `git diff --check origin/main` passes.

Not verified: a live, long Grok Build session compacting end to end.
Grok's reply text for failures or "nothing to compact" is untested, so
the `grok` dialect reports any `end_turn` as completed.

Fixes #4378

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: bb-slop-cop[bot] <316425484+bb-slop-cop[bot]@users.noreply.github.com>
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.

OpenCode native question tool hangs under bb: no UI, turn stalls, stop reports a fake "user dismissed"

1 participant