Skip to content

[PROTOTYPE] tool result formatters#946

Draft
LasmarKhalifa wants to merge 1 commit into
mainfrom
06-15/tool-result-formatter-prototype
Draft

[PROTOTYPE] tool result formatters#946
LasmarKhalifa wants to merge 1 commit into
mainfrom
06-15/tool-result-formatter-prototype

Conversation

@LasmarKhalifa

@LasmarKhalifa LasmarKhalifa commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Prototype for tool_result formatters. 



Example outputs for tool results to illustrate the proposed design: 

image.png

We use Nokogiri here, an XML parser to parse the message for TaskOutput, which can look something like: 
"<retrieval_status>success</retrieval_status>\n\n<task_id>adfgh456b87d647</task_id>\n\n<task_type>local_agent</task_type>\n\n<status>completed</status>\n\n<output>\nThe total count is 0.\n\nNo existing issues found.\n\nThere are no GitHub issues in this org with the special label that mention Class::Special.\n</output>”. 

This allows us to robustly extract the parts we want (retrieval status and status). 



We have 2 versions in this prototype: 

tool_result.rb and tool_result_dry.rb

The dry version focuses on minimizing repetition and lines of code, while the other one is explicit and localizes all the code for each formatter in its own method.
I think a hybrid approach is best, where we take the tool_result.rb but move the error lines in the formatter as well as create a helper method (like the ok method in the dry version) for formatters that repeat the same output format, but I’m open to other suggestions!

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@LasmarKhalifa LasmarKhalifa changed the title Tool result formatter prototype [PROTOTYPE] tool result formatters Jun 15, 2026
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.

1 participant