Repository navigation
fix(core): preserve every reasoning episode's signature during history consolidation #8260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
c23d899
b7fe21c
2a76e3e
da4b3e3
8a2a7ed
c403fb3
f907a0f
a7f4df4
11b7458
9b84e79
13867dc
60d4103
ad1c54b
2fe2ee3
6b3e68a
14292a7
36cdca8
ce58a20
345f0f9
19dcebf
60672b8
891d04c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -802,6 +802,12 @@ export class AnthropicContentGenerator implements ContentGenerator { | |
| dropUnsignedAssistantThinking, | ||
| stripAssistantThinking, | ||
| stripTrailingAssistantPrefill, | ||
| // Manual (non-adaptive) extended thinking requires an assistant | ||
| // turn to begin with a thinking block whenever a tool_use remains | ||
| // in it; adaptive thinking relaxes this. Applied to every such turn | ||
| // in history, not just the latest -- see | ||
| // ensureLeadingAssistantThinking's doc in the converter. | ||
| ensureLeadingAssistantThinking: thinking?.type === 'enabled', | ||
|
netbrah marked this conversation as resolved.
Resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and fixed in Applied your exact gate mutation (deriving from Added a third generator-level test using |
||
| enableCacheControl, | ||
| useGlobalCacheScope, | ||
| cacheRetention, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in
2fe2ee32b.You were right that the assertion doesn't depend on the unrealistic tail. Appended the
functionResponseuser turn fort1, mirroring the manual-mode sibling: the request now ends on atool_result, no synthetic'Continue.'is appended, and the latest assistant is still['text','thinking','tool_use'].The assertion is byte-identical — the commit is 293 insertions with zero deletions, so nothing existing was weakened. Also agree on the forward-compatibility point: had
cleanOrphanedToolCallslater been re-run after the prefill pass, the old fixture would have started failing for a reason unrelated to what it tests.