Skip to content

Commit 6e43dd4

Browse files
lsr911claude
andcommitted
fix(agents): detect C1 control characters in hasControlCharacter
hasControlCharacter() checked for C0 control characters (0x00-0x1f) and DEL (0x7f) but did not check for C1 controls (0x80-0x9f). The C1 range includes the CSI introducer (0x9b) and other control codes that should not appear in user-facing error text. Add the C1 range to the check. Same pattern as the C1 fixes in sanitizeForConsole (#103226) and renderTerminalBufferText (#103274). Co-Authored-By: Claude <[email protected]>
1 parent 05d1728 commit 6e43dd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/agents/failover-error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ export function buildProviderReauthCommand(
686686
function hasControlCharacter(value: string): boolean {
687687
for (let i = 0; i < value.length; i += 1) {
688688
const code = value.charCodeAt(i);
689-
if (code < 0x20 || code === 0x7f) {
689+
if (code < 0x20 || code === 0x7f || (code >= 0x80 && code <= 0x9f)) {
690690
return true;
691691
}
692692
}

0 commit comments

Comments
 (0)