Skip to content

Conversation

@gsabran
Copy link
Contributor

@gsabran gsabran commented Oct 27, 2025

Use the _meta field for tool calls to forward:

  • the original tool name (ie Bash etc)
  • the structured output of the tool call

The output is received by using the PostToolUse hook from the SDK. The tool_call_update for the tool result is now only sent when both the hook callback and the original tool result (plain text) have been received.

Claude Code describes in its documentation the expected structure of the output for each tools. Unfortunately those are not part of the SDK, and empirically I've found that there was some differences. Still I've found that having this structured output was useful for my client to provide a richer UX. Maybe Zed will too.

I was not sure how to add tests for this change, given the current setup

@cla-bot cla-bot bot added the cla-signed label Oct 27, 2025
@maxdeviant maxdeviant changed the title Ddd metadata to tool calls, including structured tool output Add metadata to tool calls, including structured tool output Oct 27, 2025
Copy link
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

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

We shoudn't have to cache the results, we should be able to send this as multiple tool_call_updates to the same tool call, only updating the fields we are about

@gsabran
Copy link
Contributor Author

gsabran commented Oct 30, 2025

makes sense. I'll update

@gsabran
Copy link
Contributor Author

gsabran commented Nov 1, 2025

Updated, let me know if this is what you expected. There's now a new update that is only relevant as it contains structured output data in the meta parameter.

Copy link
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

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

Looks great thanks!

@benbrandt benbrandt merged commit 2835f03 into zed-industries:main Nov 13, 2025
2 checks passed
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.

2 participants