Skip to content

fix(acp): spell out every bb skill chip the agent did not advertise - #5815

Open
SawyerHood wants to merge 1 commit into
acp-fu-3-calendar-versionsfrom
acp-fu-4-skill-chips
Open

SawyerHood wants to merge 1 commit into
acp-fu-3-calendar-versionsfrom
acp-fu-4-skill-chips

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A bb skill chip reaches an ACP agent as literal /name text. OpenCode reads a leading /name as one of its own commands and ends the turn without calling the model (#4923).

The rebuilt bridge rewrote a chip only in narrow cases:

  • only a chip at the very start of the first text item,
  • only once the agent had advertised its commands.

A chip on the first turn, mid-message, in a later text item, or next to an advertised command still went through raw.

What changed

textWithBbSkillCommandsSpelledOut (bridge.ts) replaces textWithoutUnknownLeadingSkillCommand:

  • What it rewrites: every slash chip whose name is a configured bb skill (skills/configure roots), in every text item.
  • How: to Use the bb skill "name", with a trailing colon when the chip leads further text. Chips are processed right to left, skipping overlapping or mismatched ranges.
  • What it leaves alone: the agent's own advertised commands, chips that are not bb skills, and unmarked slash text.

This follows #5055 by @timurkhakhalev (credited as co-author), rebuilt on the new bridge.

How you verified

  • The rewritten bridge test covers six turns:
    • first-turn chip,
    • two chips mid-message,
    • a non-bb chip next to a bb chip in a second text item,
    • a mismatched range,
    • after the agent advertises commands,
    • an advertised command next to a bb chip.
  • Under the previous rule, the first-turn, mid-message and mixed cases come out raw.
  • pnpm exec turbo run test lint typecheck --filter=@bb/provider-bridge-acp --filter=@bb/provider-parity: bridge 522 passed, parity 59 passed.
  • Live with opencode 1.18.35: a message with a project skill chip in the middle ("First, follow /e2e-greet …") got the skill's exact reply.

Fixes #4923. Supersedes #5055.

AGENT GENERATED

A bb skill chip reaches an ACP agent as literal `/name` text. OpenCode reads a
leading `/name` as one of its own commands and ends the turn without calling
the model (#4923). The rebuilt bridge rewrote only a chip at the very start of
the first text item, and only once the agent had advertised its commands, so
a chip on the first turn, in the middle of a message, in a later text item, or
next to an advertised command still went through raw.

The bridge now rewrites every slash chip whose name is a configured bb skill
(skills/configure roots) to `Use the bb skill "name"` (with a colon when it
leads further text), in every text item, right to left, skipping overlapping
or mismatched ranges. It leaves the agent's own advertised commands, chips
that are not bb skills, and unmarked slash text alone. This follows the
approach of #5055 by @timurkhakhalev, rebuilt on the new bridge.

Fixes #4923

Co-authored-by: Timur Khakhalev <timurkhakhalev@users.noreply.github.com>
@SawyerHood
SawyerHood added this pull request to stack #5818 October 20, 2026 00:50

This branch has not been deployed

No deployments
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.

1 participant