Repository navigation
fix(core): reject malformed tool arguments and settle unfinished calls - #53685
Merged
Merged
Conversation
2 of 6 tasks
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.
Reject broken arguments without delaying valid calls
flowchart TD A[Tool arguments stream] --> B[Partial preview stays available] A --> C{Final arguments decode as complete JSON?} C -->|Yes| D[Execute immediately on tool-call] C -->|No| E[AI emits tool-input-error] E --> F[Core records failure: not executed] G[Stream ends with an uncalled local tool] --> F F --> H[Existing tool-error continuation allows a corrected call]Ownership:
packages/aidecodes arguments and emits call/error events.packages/corepersists terminal tool state and owns continuation; its closeout sweep catches calls that parsers never finalized.Unchanged: streaming previews, eager execution, empty input for zero-argument tools, and hosted-tool/refusal/transport handling. A completed valid call may already have executed before a later refusal or output limit. Text-only truncation continuation is out of scope.
Verification
Npm.addGit-subdirectory installation test exceeded its 5-second timeout.Related issues
Fixes #52553