fix: validate tool_use input and improve runtime robustness#579
Merged
fix: validate tool_use input and improve runtime robustness#579
Conversation
ba24579 to
62c5245
Compare
- Fix contextWindowUsage calculation to use per-call usage instead of cumulative usage - Make storeJob/retrieveJob async for non-blocking filesystem I/O - Remove continueTimeoutMs from TUI execution, use useRun's isComplete for cleaner completion detection - Improve create-expert testing guide with practical verification steps - Add delegate persistence and validation in SkillManager - Remove stopRunByDelegate from STOP_EVENT_TYPES Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0c7572c to
fce4e3a
Compare
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.
Summary
ensureRecordhelper to safely coerce unknown tool call inputs toRecord<string, unknown>, preventing"Input should be a valid dictionary"API errors when the AI SDK returns invalid inputs (strings, nulls, etc.). Applied at both entry point (classifyToolCalls) and API exit point (toolCallPartToCoreToolCallPart) as defense-in-depth.generating-tool-call,generating-run-result, andmachinestates.storeJob/retrieveJobasync for non-blocking filesystem I/O across runtime, filesystem, and delegation-executor packages.continueTimeoutMsand exit timeout logic; useuseRun'sisCompletefor cleaner completion detection.Test plan
pnpm typecheck— all 23 packages passpnpm test— all 1107 tests pass (including 9 newensureRecordtests)pnpm format-and-lint— no new warnings🤖 Generated with Claude Code