Skip to content

fix(capture): keep array tool results for tools in includeTools - #154

Open
Dhravya wants to merge 1 commit into
mainfrom
capy/keep-array-tool-results
Open

Dhravya wants to merge 1 commit into
mainfrom
capy/keep-array-tool-results

Conversation

@Dhravya

@Dhravya Dhravya commented Oct 24, 2026

Copy link
Copy Markdown
Member

Fixes #152.

Claude Code stores Agent and MCP tool results in the transcript as an array of content blocks rather than a string. formatUserMessage passed block.content straight to cleanContent, which returns '' for non-strings, so those results were dropped from the Stop capture even when the tool was listed in includeTools.

Array results now have their text blocks joined with newlines before the usual cleaning and 500-character truncation. Non-text blocks such as images are skipped. String results and tools not in includeTools behave as before.

Adds a capture-hook test with an Agent result containing two text blocks and an image block, which fails without the fix.

Open in Capy

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.

Automatic capture drops Agent and MCP tool results listed in includeTools

1 participant