From 9340170da69ecef7905934ac59b4f5440ca0cbcd Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Wed, 5 Aug 2026 01:59:02 -0300 Subject: [PATCH] fix(tests): clear the two base-reds on release/v3.8.50 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both sat on the release itself and turned every open PR red as soon as it merged the release, independently of the PR's own content. - tests/snapshots/provider/translate-path.json: #9064 (b0501642dd) added the code-execution-2025-08-25 and skills-2025-10-02 beta flags to the Anthropic header but did not regenerate the golden. provider-translate-path-golden failed on the bare release tip — 2 pass / 1 fail with zero PRs boarded. Regenerated; the diff is 24 lines, all the same header in 6 variants. - tests/unit/v1-models-auth-leak-9320.test.ts:83: shipped a (k: any) in a file new enough that eslint-suppressions.json does not cover it. With @typescript-eslint/no-explicit-any as error under tests/, that one cast failed 'No new ESLint warnings' for every PR. The callback parameter infers correctly, so the cast was redundant. Verified on the fix branch: eslint exit 0, typecheck:core exit 0, and both test files green (5/5). --- .../maintenance/base-reds-v3850-golden-and-any.md | 1 + tests/snapshots/provider/translate-path.json | 12 ++++++------ tests/unit/v1-models-auth-leak-9320.test.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 changelog.d/maintenance/base-reds-v3850-golden-and-any.md diff --git a/changelog.d/maintenance/base-reds-v3850-golden-and-any.md b/changelog.d/maintenance/base-reds-v3850-golden-and-any.md new file mode 100644 index 0000000000..6ae7b19762 --- /dev/null +++ b/changelog.d/maintenance/base-reds-v3850-golden-and-any.md @@ -0,0 +1 @@ +- **chore(tests):** cleared two base-reds sitting on `release/v3.8.50` itself, both of which turned every open PR red the moment it merged the release. `tests/snapshots/provider/translate-path.json` was stale: #9064 added the `code-execution-2025-08-25` and `skills-2025-10-02` beta flags to the Anthropic header without regenerating the golden, so `provider-translate-path-golden` failed on the bare release tip (2 pass / 1 fail with zero PRs boarded). And `tests/unit/v1-models-auth-leak-9320.test.ts:83` shipped a `(k: any)` in a file new enough that `config/quality/eslint-suppressions.json` does not cover it — with `@typescript-eslint/no-explicit-any` set to `error` under `tests/`, that single cast failed the `No new ESLint warnings` gate repo-wide. Regenerating the snapshot and dropping the redundant cast (the callback parameter infers correctly) restores both gates. diff --git a/tests/snapshots/provider/translate-path.json b/tests/snapshots/provider/translate-path.json index f9414aa06e..86a82df494 100644 --- a/tests/snapshots/provider/translate-path.json +++ b/tests/snapshots/provider/translate-path.json @@ -326,20 +326,20 @@ "headers": { "apiKey": { "Accept": "text/event-stream", - "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", "x-api-key": "" }, "nonStream": { - "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", "x-api-key": "" }, "oauth": { "Accept": "text/event-stream", - "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", "x-api-key": "" @@ -870,7 +870,7 @@ "headers": { "apiKey": { "Accept": "text/event-stream", - "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Dangerous-Direct-Browser-Access": "true", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", @@ -888,7 +888,7 @@ "x-api-key": "" }, "nonStream": { - "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Dangerous-Direct-Browser-Access": "true", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", @@ -907,7 +907,7 @@ }, "oauth": { "Accept": "text/event-stream", - "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07", + "Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28,advisor-tool-2026-03-01,extended-cache-ttl-2025-04-11,cache-diagnosis-2026-04-07,code-execution-2025-08-25,skills-2025-10-02", "Anthropic-Dangerous-Direct-Browser-Access": "true", "Anthropic-Version": "2023-06-01", "Content-Type": "application/json", diff --git a/tests/unit/v1-models-auth-leak-9320.test.ts b/tests/unit/v1-models-auth-leak-9320.test.ts index 05d58deac1..9d86d1c70e 100644 --- a/tests/unit/v1-models-auth-leak-9320.test.ts +++ b/tests/unit/v1-models-auth-leak-9320.test.ts @@ -80,7 +80,7 @@ test("#9320: authenticated request (valid API key) returns 200 with models", asy // Create a valid API key await apiKeysDb.createApiKey("test-key-9320", "test-machine-9320"); const keys = await apiKeysDb.getApiKeys(); - const apiKey = Array.isArray(keys) ? keys.find((k: any) => k.name === "test-key-9320") : null; + const apiKey = Array.isArray(keys) ? keys.find((k) => k.name === "test-key-9320") : null; assert.ok(apiKey, "API key must have been created"); const res = await v1ModelsCatalog.getUnifiedModelsResponse(