Skip to content

Centralize tool result error handling in format with error_line helper#948

Draft
LasmarKhalifa wants to merge 1 commit into
mainfrom
06-15/tool-result-error-handling
Draft

Centralize tool result error handling in format with error_line helper#948
LasmarKhalifa wants to merge 1 commit into
mainfrom
06-15/tool-result-error-handling

Conversation

@LasmarKhalifa

Copy link
Copy Markdown
Contributor

No description provided.

@juniper-shopify juniper-shopify 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.

Nice foundation PR! The error-handling centralization is clean — pulling the error path into an early-return at the top of format means every downstream formatter only needs to think about the success case. Makes the rest of your stack cleaner.

Two small things to address:

  1. The error_line doc comment could use a couple of examples (see inline comment).
  2. A test for error_line when content is nil would round out the edge-case coverage.

And lets switch to the xml parser we had talked about

Comment thread lib/roast/cogs/agent/providers/claude/tool_result.rb
Comment thread test/roast/cogs/agent/providers/claude/tool_result_test.rb
Comment thread lib/roast/cogs/agent/providers/claude/tool_result.rb
@LasmarKhalifa LasmarKhalifa force-pushed the 06-15/tool-result-error-handling branch from d0ec520 to dca3a40 Compare June 19, 2026 18:42
@LasmarKhalifa LasmarKhalifa force-pushed the 06-15/tool-result-error-handling branch from dca3a40 to 504729d Compare June 19, 2026 20:41
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.

2 participants