mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
fix(assistant): replay an Anthropic answer that thought with its thinking blocks
Sonnet 5.5 and Opus 5.5 think by default and write what they say between tool calls into thinking blocks, which they want back unchanged with the rest of the turn. The client dropped those blocks (and their signatures) and rebuilt the turn from its text and calls, so after a tool result the next step came back empty and the assistant gave up with empty_answer. A turn that thought is now replayed block by block like one that searched the web; the cache mark before the question skips a thinking block, and replayed blocks are copies so a mark never sticks to the stored answer. Closes #2789
This commit is contained in:
@@ -370,7 +370,7 @@ const aiProviderStateSchema = z.discriminatedUnion('adapter', [
|
||||
adapter: z.literal('openai-responses'),
|
||||
items: z.array(z.record(z.string(), z.unknown())),
|
||||
}),
|
||||
// Anthropic's content blocks of an answer that searched the web, replayed with their search results.
|
||||
// Anthropic's content blocks of an answer that searched the web or thought, replayed as they came.
|
||||
z.object({
|
||||
adapter: z.literal('anthropic-messages'),
|
||||
blocks: z.array(z.record(z.string(), z.unknown())),
|
||||
|
||||
Reference in New Issue
Block a user