mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 22:57:32 +00:00
7586126797
Follow-up messages failed with HTTP 400 on Anthropic once a thread held an answer that thought: the API binds each thinking block to everything the request sends before it and refuses the request when any of that changed. It changes in normal use: a tool group loaded later in the turn, an earlier tool answer cut short once a new question follows, a held change applied since, a trip card that moved on. Each recorded step now keeps a fingerprint of what its request sent before it (model, system blocks, tools, history). On replay its thinking blocks go back only while that fingerprint still matches; otherwise the step goes back without them, which the API accepts. Records written before this change carry no fingerprint and go back without their thinking. A refusal from Anthropic is now logged with the path its message names (such as messages.1.content.0), without the rest of the message. Closes #3094