feat(acp): stream shell output as v2 terminals - #209
Merged
Merged
Conversation
danielkov
enabled auto-merge (squash)
September 13, 2026 15:43
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.
Summary
Stream local shell stdout and stderr as ACP v2 terminal output and attach the terminal to its existing projected inner tool call. Preserve the structured shell result and keep ACP v1 unchanged.
Closes #154.
Technical details
Terminal IDs reuse
ToolRequest.call_id. Independently base64-encoded chunks preserve arbitrary bytes. Separate bounded protocol queues exclude terminal traffic from v1 before admission;Observedremains the sole owner of call lifecycle, and session finalization retains its projection drain barrier.Each session projection subscription admits at most 128 output chunks and a cumulative 1 MiB of encoded output and optional command/cwd metadata. The budget persists across calls and turns, bounding streamed payloads even when the SDK's outgoing queue stalls. Further output carries
kit/outputIncompletemetadata; terminal exits and call completion are not charged against the preview budget. Structured shell capture is unchanged.Normal completion reports the shell exit code. Cancellation, timeout, and errors mark the terminal exited before the call ends without inventing an exit code. Projection bus loss exits visible terminals with
kit/outputIncompletemetadata before invalidating their cards.