Skip to content

Replay thinking that a compatible server signs with an empty signature - #425

Merged
mattt merged 1 commit into
mainfrom
mattt/fix-anthropic-empty-signature
Nov 18, 2026
Merged

mattt merged 1 commit into
mainfrom
mattt/fix-anthropic-empty-signature

Conversation

@mattt

@mattt mattt commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes multi-turn sessions with AnthropicLanguageModel against a server that signs thinking blocks with an empty signature, such as llama-server's /v1/messages. The server sends "signature": "" on a thinking block, or an empty signature_delta when it streams. The package stored that as a missing signature, so the next turn threw Transcript.ReasoningReplayError.invalidSignature before it sent a request.

The package now keeps a signature that the server sent, even an empty one, and replays it unchanged. A thinking entry with no signature still throws invalidSignature, as does a streamed block whose start has an empty signature and that gets no signature_delta. Redacted thinking with empty data also still throws. One thing changes for other servers: a transcript that holds an empty signature is now sent as it is, where the old code threw before the request.

@mattt
mattt merged commit a07fa00 into main Nov 18, 2026
14 checks passed
@mattt
mattt deleted the mattt/fix-anthropic-empty-signature branch November 18, 2026 01:17
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