Skip to content

feat(acp): stream shell output as v2 terminals - #209

Merged
danielkov merged 2 commits into
mainfrom
fix/154-terminal-stream
Sep 13, 2026
Merged

danielkov merged 2 commits into
mainfrom
fix/154-terminal-stream

Conversation

@danielkov

@danielkov danielkov commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

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; Observed remains 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/outputIncomplete metadata; 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/outputIncomplete metadata before invalidating their cards.

@danielkov
danielkov enabled auto-merge (squash) September 13, 2026 15:43

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminal streaming can invalidate ACP v1 tool cards under output bursts and accumulate output in unbounded ACP v2 transport queues for slow clients.

Comment thread src/protocols/acp.rs Outdated
Comment thread src/tools/shell.rs

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@danielkov
danielkov merged commit 00868d2 into main Sep 13, 2026
7 checks passed
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.

Stream shell output as v2 terminal updates

1 participant