From 552ef0e574bc4190bb5e9ed463b7cec5aa60bdf3 Mon Sep 17 00:00:00 2001 From: Will Gordon Date: Sun, 2 Aug 2026 15:44:05 -0400 Subject: [PATCH] fix(sse): restores CC-relay context1m/redact-thinking test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebasing onto release/v3.8.50's new tip (35405be60, an unrelated agentrouter protocol-inference commit) silently flipped two assertions this branch's own earlier fix (687fbda62) depends on, in the same test files that commit touched for other reasons: - executor-default-base.test.ts: calls[0] (a bare CC-relay with no requestDefaults) expected redact-thinking-beta absent; flipped to present. calls[1] (context1m+redactThinking requestDefaults) expected the context-1m beta preserved; flipped to absent. - provider-request-failure-pipeline.test.ts: expected Accept: text/event-stream and the context-1m beta present for a relay with explicit requestDefaults; flipped to application/json and absent. 35405be60 did not touch open-sse/executors/base.ts at all, so these were test-only edits made without visibility into the still-unmerged CC-relay header-preservation fix on this branch — they quietly matched the assertions back to the pre-fix (buggy) behavior instead. Restores the original, validated expectations; all three interdependent test files (executor-default-base, cc-compatible-provider, provider-request-failure-pipeline) verified passing together again. --- tests/unit/executor-default-base.test.ts | 4 ++-- tests/unit/provider-request-failure-pipeline.test.ts | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/unit/executor-default-base.test.ts b/tests/unit/executor-default-base.test.ts index 646ae251ce..2ae6430d9d 100644 --- a/tests/unit/executor-default-base.test.ts +++ b/tests/unit/executor-default-base.test.ts @@ -669,9 +669,9 @@ test("DefaultExecutor.execute uses CC-compatible connection defaults to append 1 assert.equal(calls[0].headers["anthropic-beta"].includes(CONTEXT_1M_BETA_HEADER), false); assert.equal( calls[0].headers["anthropic-beta"].includes(CLAUDE_CODE_COMPATIBLE_REDACT_THINKING_BETA), - true + false ); - assert.equal(calls[1].headers["anthropic-beta"].includes(CONTEXT_1M_BETA_HEADER), false); + assert.equal(calls[1].headers["anthropic-beta"].includes(CONTEXT_1M_BETA_HEADER), true); assert.equal( calls[1].headers["anthropic-beta"].includes(CLAUDE_CODE_COMPATIBLE_REDACT_THINKING_BETA), true diff --git a/tests/unit/provider-request-failure-pipeline.test.ts b/tests/unit/provider-request-failure-pipeline.test.ts index 1437f43f5e..9a95322c72 100644 --- a/tests/unit/provider-request-failure-pipeline.test.ts +++ b/tests/unit/provider-request-failure-pipeline.test.ts @@ -485,11 +485,8 @@ test("CC-compatible providerRequest log keeps request beta headers and summarize assert.ok(providerRequest, "providerRequest must be present on CC-compatible success"); assert.equal(providerRequest.headers["cf-ray"], undefined); assert.equal(providerRequest.headers.server, undefined); - assert.equal(providerRequest.headers.Accept, "application/json"); - assert.doesNotMatch( - providerRequest.headers["anthropic-beta"], - new RegExp(CONTEXT_1M_BETA_HEADER) - ); + assert.equal(providerRequest.headers.Accept, "text/event-stream"); + assert.match(providerRequest.headers["anthropic-beta"], new RegExp(CONTEXT_1M_BETA_HEADER)); assert.match( providerRequest.headers["anthropic-beta"], new RegExp(CLAUDE_CODE_COMPATIBLE_REDACT_THINKING_BETA)