Repository navigation
fix(agent): preserve tool arguments and recover malformed calls - #48
Merged
Merged
Conversation
NiceCode666
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tool arguments longer than 1,200 characters were omitted during history replay. Malformed streamed arguments could also become empty executable defaults or abort the entire model round, losing valid sibling calls.
This change preserves complete arguments in both current-turn and session history. Each identifiable malformed call produces a failed tool result with its original argument text, allowing the agent to repair that call while valid siblings execute normally. Anthropic uses raw streaming events so SDK JSON parsing cannot discard later calls. Normal text replies, cancellation, permission handling, and internal-tool visibility retain their existing behavior.
The desktop CI exposed an existing order-dependent test leak: WordHostApp applies English to the shared translator, and two presentation suites also switch to English without restoring it. Their teardown now restores the test suite's Chinese baseline in
finally, without changing production behavior.Validation: