Skip to content

Steer: OpenCode agents take agent steers at a tool boundary instead of an abort - #70

Open
erikcostlow wants to merge 4 commits into
nmamano:mainfrom
erikcostlow:opencode-native-steer
Open

erikcostlow wants to merge 4 commits into
nmamano:mainfrom
erikcostlow:opencode-native-steer

Conversation

@erikcostlow

@erikcostlow erikcostlow commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #69

OpenCode receivers now take agent steers at a tool boundary instead of being aborted, using OpenCode 2.2.5's own steering. Isomux sends the steer with delivery: "steer" and resume: false. If the steer misses the turn, it stays in OpenCode's queue without starting a run; Isomux cancels it at turn end (or on abort) and sends it once as the next turn. This is the same push path Codex uses (steer-delivery-design.md §3.4); the new §3.5 has the details and the 48-trial probe.

Changes:

  • server/backends/opencode/transport.ts, adapter.ts: steer(), delivery tracking, and cancelling steers that were never picked up; the OpenCode backend declares toolBoundaryDelivery.
  • fake-opencode-v2.ts: inbox and steer routes.
  • Tests: 9 unit tests (transport, adapter) and 3 live tests in agent-manager.opencode.live.test.ts against the pinned 2.2.5 binary with the mock provider: a steer during a shell call, a steer that misses the turn, and an abort with a steer waiting.
  • Docs: steer-delivery-design.md, message-steering-design.md, and agent-reference/messaging.md (it no longer says OpenCode agents are interrupted).

Verified:

  • Unit tests: 138 pass.
  • ISOMUX_TEST_OPENCODE=1 bun test server/test-support/agent-manager.opencode.live.test.ts: 5 pass, run 5 times in a row.
  • bun run test:opencode:ci: 38 pass.
  • Manual run on a test office: a Claude agent steered an OpenCode agent during a 60 s shell loop. All 30 steps ran, the steer arrived 3 ms after the loop's result with no interruption, and the agent acted on it in the same turn.

Upstream: OpenCode's own suite already checks that resume: false never wakes the session ("only records the prompt when resume is false" in packages/core/test/session-prompt.test.ts). I proposed a test for the other half, that the steer stays pending and can be cancelled, in anomalyco/opencode#63356, and the maintainers closed it as not planned because they prefer to keep the existing test. So for that half, the live tests in this PR are the guard. §3.5 now says to run bun run test:opencode on every OpenCode version bump.

Not covered: a steer surviving an OpenCode server restart (listed in §6), and bun run test:conformance was not run.

Note: transport.ts was already over the 3000-line lint limit, and this adds about 140 lines.

Checked on: OpenCode 2.2.5. The Claude and Codex paths are unchanged.

🤖 Generated with Claude Code

erikcostlow and others added 3 commits November 11, 2026 12:11
…h the session inbox, no abort (steer-delivery-design.md §3.5)
…-in at the boundary, the cancelled miss, abort with a parked steer (steer-delivery-design.md §3.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@erikcostlow
erikcostlow requested a review from nmamano as a code owner November 11, 2026 19:15
…ream tests, and which our live tests guard

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nmamano pushed a commit that referenced this pull request Nov 12, 2026
… (task e71a4589, PR #70, closes #69)

On the pinned @opencode/cli 2.2.5, a steer goes in through OpenCode's session
inbox with delivery "steer", resume false, so the running turn folds it in at
the next tool boundary instead of being aborted. Steers that miss the turn are
cancelled at the terminal frame (and at the interrupted frame after an abort),
on the failed turn's stop chain, on close(), and before the next prompt; the
turn-end flush delivers them. Steers are refused once the turn's end begins.
abort() does not cancel, since 2.2.5's interrupt is fire and forget. The test
fake now scopes replies per turn. Docs: steer-delivery-design.md,
message-steering-design.md and the messaging agent reference.

Contributed by Erik Costlow in PR #70; review fixes and tests by the Isomux
loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

Steer OpenCode agents without aborting them (OpenCode 2.2.5 inbox steer)

1 participant