| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Anthropic thinking blocks carry a cryptographic signature in providerMetadata that must survive every turn of a multi-turn conversation. The differentModel guard was correctly stripping provider-specific metadata from text and tool parts, but incorrectly doing the same for reasoning parts, causing Anthropic to reject the request with 'thinking blocks cannot be modified'. Fixes anomalyco#22813
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs that address similar issues with reasoning/thinking blocks and providerMetadata: Potentially Related PRs:
These PRs all address similar concerns around preserving thinking block integrity and metadata. However, PR #22818 (the current PR) appears to be the specific fix for issue #22813, so it's likely a unique solution rather than a duplicate of the older PRs. |
Sorry, something went wrong.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #22813
What
Always preserve providerMetadata on reasoning parts when reconstructing conversation history, regardless of the differentModel flag.
Why
The differentModel guard exists to prevent provider-specific metadata (e.g. OpenAI itemId) from leaking into other providers — correct for text and tool parts. But Anthropic thinking blocks carry a cryptographic signature inside providerMetadata that Anthropic verifies on every subsequent turn. Stripping it causes the API to reject the message with "thinking blocks cannot be modified".
How I verified it