Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,10 @@ function tryParsePartialToolInput(raw: string | undefined): unknown {
return raw;
}

return parsePartialJson(raw);
try {
// Certain patterns, especially partially-generated unicode escape sequences, cause this to throw.
return parsePartialJson(raw);
} catch {
return undefined;
}
Comment on lines +239 to +244
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes a crash path, but there’s no unit test coverage for the new behavior. Consider adding a test that feeds a copilotToolCallStreamUpdates delta whose arguments includes an invalid/partial unicode escape (the known throw case) and asserts doProcessResponse doesn’t throw and continues streaming (e.g., updateToolInvocation is safely ignored or partialInput becomes undefined).

Copilot uses AI. Check for mistakes.
}