-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Consolidate ACP Tool Call Events from 3 to 2 #4155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
OhadRubin
wants to merge
3
commits into
anomalyco:dev
Choose a base branch
from
OhadRubin:consolidate-acp-tool-events
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+4
−17
Conversation
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
Remove redundant pending event emission. The pending state has no input parameters by design (part.state.input is empty {} when status is "pending"). Only emit tool call events during running and completed states when actual data is available.
This reduces noise in the ACP event stream without losing any information.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
…sage - Include locations via toLocations() when sending running event - Fix error message to say "in_progress" instead of "pending" - Remove trailing whitespace 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
@OhadRubin but the first party supported agents by zed set this, so why shouldn't we do the same to be consistent with them? Also it is part of the spec to set it isn't it |
Author
|
I mean sure it's part of the spec, but the event is nothing useful, you are
logging no useful information by emitting this event, just that *some* tool
id.
Either we log the actual arguments for the tool call via a 'pending' call
(but it's set later) or remove it.
…On Mon, Nov 10, 2025, 6:36 PM Aiden Cline ***@***.***> wrote:
*rekram1-node* left a comment (anomalyco/opencode#4155)
<#4155 (comment)>
@OhadRubin <https://github.com/OhadRubin> but the first party supported
agents by zed set this, so why shouldn't we do the same to be consistent
with them?
Also it is part of the spec to set it isn't it
—
Reply to this email directly, view it on GitHub
<#4155 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAOKQQ4B5Y2JMZUBWHCET334C5IBAVCNFSM6AAAAACLU7VIYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMJSG4ZDQNRTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Author
|
Also,
I was comparing the interface with the other zed acp adapter and this is
the only implementation where tool_call did not have the arguments of the
tool call.
So take that as you will
…On Mon, Nov 10, 2025, 7:13 PM Ohad Rubin ***@***.***> wrote:
I mean sure it's part of the spec, but the event is nothing useful, you
are logging no useful information by emitting this event, just that *some*
tool id.
Either we log the actual arguments for the tool call via a 'pending' call
(but it's set later) or remove it.
On Mon, Nov 10, 2025, 6:36 PM Aiden Cline ***@***.***>
wrote:
> *rekram1-node* left a comment (anomalyco/opencode#4155)
> <#4155 (comment)>
>
> @OhadRubin <https://github.com/OhadRubin> but the first party supported
> agents by zed set this, so why shouldn't we do the same to be consistent
> with them?
>
> Also it is part of the spec to set it isn't it
>
> —
> Reply to this email directly, view it on GitHub
> <#4155 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABAOKQQ4B5Y2JMZUBWHCET334C5IBAVCNFSM6AAAAACLU7VIYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMJSG4ZDQNRTGE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Use GITHUB_HEAD_REF or GITHUB_REF_NAME to push to the correct branch when in detached HEAD state in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
f1dc981 to
3e15a39
Compare
f8ee907 to
6a9856d
Compare
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.
Consolidate ACP Tool Call Events from 3 to 2
Summary
Reduce tool call event emissions from 3 events (pending → running → completed) to 2 events (running → completed) by removing the redundant pending event.
Problem
Currently, we send 3 ACP events per tool call:
tool_callevent with no input parameters (empty{})tool_call_updateevent with the actual input parameterstool_call_updateevent with resultsThe pending event provides no useful information since
part.state.inputis empty by design, creating unnecessary noise in the ACP event stream.Root Cause Analysis
The pending event has no input content by design. In
src/session/prompt.ts:1076, when the "tool-input-start" event occurs, the tool part is created with:The input parameters are only populated when the tool transitions to "running" status. This means:
part.state.inputis empty ({})part.state.inputcontains actual parametersIn
src/acp/agent.ts, when we receive the pending event viathis.config.sdk.event.subscribe, thepart.state.inputfield is empty.Conclusion: The pending event is inherently empty and provides no useful information beyond the tool ID. The original 2-event approach (skip pending, only send running + completed) is correct.
Solution
Skip the pending state and only emit 2 events:
tool_callevent with input parameters andstatus: "in_progress"tool_call_updateevent with resultsChanges
In
src/acp/agent.ts:150-165:breakin pending case (no-op)status: "in_progress"instead of separate pending/running eventsTesting
Tested with the latest version of Zed and it works.