Skip to content

Commit ba9b5bf

Browse files
committed
fix(clownfish): address review for ghcrawl-156721-autonomous-smoke (1)
1 parent ba9fd56 commit ba9b5bf

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

extensions/anthropic/stream-wrappers.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ describe("anthropic stream wrappers", () => {
125125
).toEqual(["files-api-2025-04-14"]);
126126
});
127127

128+
it("strips legacy context-1m beta from comma-separated string config", () => {
129+
expect(
130+
resolveAnthropicBetas(
131+
{ anthropicBeta: `${CONTEXT_1M_BETA},files-api-2025-04-14` },
132+
"claude-sonnet-4-6",
133+
),
134+
).toEqual(["files-api-2025-04-14"]);
135+
});
136+
128137
it("preserves OAuth-required betas when context1m is the only configured beta trigger", () => {
129138
const captured: { headers?: Record<string, string> } = {};
130139
const wrapped = wrapAnthropicProviderStream({

extensions/anthropic/stream-wrappers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ export function resolveAnthropicBetas(
9999
const betas = new Set<string>();
100100
const configured = extraParams?.anthropicBeta;
101101
if (typeof configured === "string" && configured.trim()) {
102-
betas.add(configured.trim());
102+
for (const beta of parseHeaderList(configured)) {
103+
betas.add(beta);
104+
}
103105
} else if (Array.isArray(configured)) {
104106
for (const beta of configured) {
105107
if (typeof beta === "string" && beta.trim()) {
106-
betas.add(beta.trim());
108+
for (const betaValue of parseHeaderList(beta)) {
109+
betas.add(betaValue);
110+
}
107111
}
108112
}
109113
}

0 commit comments

Comments
 (0)