From 5c953d1f5104cc156b86a12eec875bb4232b1e67 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Sun, 5 Jul 2026 18:34:45 -0300 Subject: [PATCH] fix(quality): type the 7 net-new 'as any' casts from #6292 (Lint red on the release tip) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #6292 rewrote/added zero-width-marker tests with 7 new 'as any' result casts, pushing the file past its frozen suppression (84) — and when violations exceed the suppressed count ESLint reports ALL of them, so the ci.yml Lint job went red with 90 errors. The 7 new sites get typed shapes (delta / arguments / choices / output accessors — same pattern as fecf888fd); the pre-existing debt stays frozen at the exact new count (83). 50/50 tests green, file lint-clean under the suppressions baseline. --- config/quality/eslint-suppressions.json | 2 +- tests/unit/response-sanitizer.test.ts | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/config/quality/eslint-suppressions.json b/config/quality/eslint-suppressions.json index c74f3b1b34..73470409b5 100644 --- a/config/quality/eslint-suppressions.json +++ b/config/quality/eslint-suppressions.json @@ -1964,7 +1964,7 @@ }, "tests/unit/response-sanitizer.test.ts": { "@typescript-eslint/no-explicit-any": { - "count": 84 + "count": 83 } }, "tests/unit/responses-parse-once-4041.test.ts": { diff --git a/tests/unit/response-sanitizer.test.ts b/tests/unit/response-sanitizer.test.ts index 84305e6555..7fecd106fd 100644 --- a/tests/unit/response-sanitizer.test.ts +++ b/tests/unit/response-sanitizer.test.ts @@ -898,7 +898,7 @@ test("sanitizeStreamingChunk strips zero-width joiners from native response.func const sanitized = sanitizeStreamingChunk({ type: "response.function_call_arguments.delta", delta: '{"command":"o\u200d', - }) as any; + }) as unknown as { delta: string }; const output = JSON.stringify(sanitized); assert.equal(sanitized.delta, '{"command":"o'); @@ -909,7 +909,7 @@ test("sanitizeStreamingChunk strips zero-width joiners from native response.func const sanitized = sanitizeStreamingChunk({ type: "response.function_call_arguments.done", arguments: '{"command":"o\u200dpencode"}', - }) as any; + }) as unknown as { arguments: string }; const output = JSON.stringify(sanitized); assert.equal(sanitized.arguments, '{"command":"opencode"}'); @@ -940,7 +940,9 @@ test("sanitizeStreamingChunk strips zero-width joiners from OpenAI chat tool-cal }, }, ], - }) as any; + }) as unknown as { + choices: { delta: { tool_calls: { function: { arguments: string } }[] } }[]; + }; const output = JSON.stringify(sanitized); assert.equal( @@ -974,7 +976,9 @@ test("sanitizeOpenAIResponse strips zero-width joiners from non-stream tool-call }, }, ], - }) as any; + }) as unknown as { + choices: { message: { tool_calls: { function: { arguments: string } }[] } }[]; + }; const output = JSON.stringify(sanitized); assert.equal( @@ -999,7 +1003,7 @@ test("sanitizeResponsesApiResponse strips zero-width joiners from native functio arguments: '{"command":"o\u200dpencode"}', }, ], - }) as any; + }) as unknown as { output: { arguments: string }[] }; const output = JSON.stringify(sanitized); assert.equal(sanitized.output[0].arguments, '{"command":"opencode"}'); @@ -1026,7 +1030,9 @@ test("sanitizer leaves normal tool arguments byte-identical (no parse/restringif }, }, ], - }) as any; + }) as unknown as { + choices: { delta: { tool_calls: { function: { arguments: string } }[] } }[]; + }; assert.equal(streamed.choices[0].delta.tool_calls[0].function.arguments === rawArgs, true); const nonStream = sanitizeOpenAIResponse({ @@ -1049,6 +1055,8 @@ test("sanitizer leaves normal tool arguments byte-identical (no parse/restringif }, }, ], - }) as any; + }) as unknown as { + choices: { message: { tool_calls: { function: { arguments: string } }[] } }[]; + }; assert.equal(nonStream.choices[0].message.tool_calls[0].function.arguments === rawArgs, true); });