fix: capture extended thinking signatures for tool use continuations #10351
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.
Summary
Fixes ROO-312
When extended thinking is enabled, Anthropic's API returns
signature_deltaevents that contain cryptographic signatures for thinking blocks. These signatures are required when passing thinking blocks back to the API for tool use continuations.Reference: Anthropic Extended Thinking Documentation
The Problem
Without the signature, thinking blocks were stored as generic 'reasoning' blocks which get filtered out by
anthropic-filter.ts, causing the API validation error:Before (Bug)
After (Fixed)
Relevant Documentation Sections
From Anthropic Extended Thinking Docs:
{ "type": "thinking", "thinking": "Let me analyze this step by step...", "signature": "WaUjzkypQ2mUEVM36O2TxuC06KN8xyfbJwyem2dw3URve/op91XWHOEBLLqIOMfFG/UvLEczmEsUjavL...." }signaturefield. This field is used to verify that thinking blocks were generated by Claude when passed back to the API."Changes
lastThinkingSignatureproperty to store captured signaturegetThoughtSignature()method to expose signature to Task.tssignature_deltaevents incontent_block_deltathinking_completechunk when thinking block finishes with signatureTesting