Skip to content

feat: ACP - stream bash output and synthetic pending events#14079

Merged
Hona merged 4 commits intoanomalyco:devfrom
noamzbr:feat/13338-acp-stream-bash-content
Feb 24, 2026
Merged

feat: ACP - stream bash output and synthetic pending events#14079
Hona merged 4 commits intoanomalyco:devfrom
noamzbr:feat/13338-acp-stream-bash-content

Conversation

@noamzbr
Copy link
Contributor

@noamzbr noamzbr commented Feb 18, 2026

closes #13338

What does this PR do?

  1. issue updates for bash that include current bash output (client is expected to updated pre-existing content in place)
  2. create synthetic "pending" updates at the start of each tool call per protocol
  3. add tool raw output to the failed case
  4. avoid emitting redundant bash updates when hitting max output size by caching hash of previously emitted update

@rekram1-node I'll be honest, I initially set out to do only 1 (this is what the issue is about), but while doing so I saw that 2 and 3 also are required to get a really good experience with acp across live streaming and reply:

  • 2 is how the protocol is supposed to behave, and it helps clients update status of tool calls when live
  • 3 is useful so that you know what was the tool output even when it failed - especially during replay when the last status is the only thing you get

Item 4, the dedup, is not really a must it just prevents emitting many heavy updates that are the same when bash hits the length limit opencode defines. LMK if you want me to drop it. I will strongly recommend keeping 2 & 3 (our client depends on them, and I expect them to be useful and protocol-correct for other clients)

How did you verify your code works?

  • tested in our in-house acp client - was able to consume updates for user & agent initiated bash commands while in progress
  • tests added

Stream running bash output snapshots to the frontend via ACP tool_call_update,
with dedup to avoid sending identical content. Emit a synthetic pending event
when a tool jumps straight to running without a prior pending.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found a potential duplicate:

Related PR: feat(acp): stream bash tool output during execution - PR #13589

Why it's related: This PR (#13589) appears to address the same feature - streaming bash tool output during execution for ACP. It overlaps significantly with the goals of PR #14079, which also aims to stream bash output. You should verify whether these are addressing the same issue or if they have complementary/conflicting changes.

@noamzbr
Copy link
Contributor Author

noamzbr commented Feb 18, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found a potential duplicate:

Related PR: feat(acp): stream bash tool output during execution - PR #13589

Why it's related: This PR (#13589) appears to address the same feature - streaming bash tool output during execution for ACP. It overlaps significantly with the goals of PR #14079, which also aims to stream bash output. You should verify whether these are addressing the same issue or if they have complementary/conflicting changes.

IMO (as far as I understand the acp sdk) for updates we should prefer content to rawOutputs (which are used for completed / failed state)

@rekram1-node
Copy link
Collaborator

/review

@rekram1-node
Copy link
Collaborator

Hm u do have some merge conflicts it looks like

@github-actions
Copy link
Contributor

lgtm

…bash-content

# Conflicts:
#	packages/opencode/src/acp/agent.ts
@noamzbr
Copy link
Contributor Author

noamzbr commented Feb 21, 2026

Hm u do have some merge conflicts it looks like

sry was away, merged dev

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

lgtm

@Hona Hona merged commit 888b123 into anomalyco:dev Feb 24, 2026
6 of 8 checks passed
@Hona
Copy link
Member

Hona commented Feb 24, 2026

looks good to me @noamzbr

image

is there validity to this?

@noamzbr
Copy link
Contributor Author

noamzbr commented Feb 24, 2026

looks good to me @noamzbr

image is there validity to this?

yes seems valid. Will open a followup pr

@Hona
Copy link
Member

Hona commented Feb 24, 2026

yeah checks out - please ping me I'll review for you :D

@noamzbr
Copy link
Contributor Author

noamzbr commented Feb 24, 2026

yeah checks out - please ping me I'll review for you :D

Here it is #14916

Bun 404 seem unrelated..

lanej pushed a commit to lanej/opencode that referenced this pull request Feb 24, 2026
…o#14079)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
kcelia pushed a commit to concrete-security/private-opencode that referenced this pull request Feb 25, 2026
…o#14079)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
jonathanmiddleton pushed a commit to jonathanmiddleton/opencode that referenced this pull request Mar 10, 2026
…o#14079)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: ACP - enable terminal streaming by including bash outputs in tool updates

3 participants