Skip to content

Commit af73327

Browse files
committed
test(claude): cover the auto-compact threshold when the context window is unknown
A model missing from the catalog has no known window, and the adapter then reports the configured threshold. Assert that branch so a change that hides it fails.
1 parent 600762c commit af73327

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,18 +929,25 @@ describe("ClaudeAdapterV2 context usage", () => {
929929
);
930930
});
931931

932-
it("reports the configured auto-compact window when it is below the context window", () => {
933-
const thresholdFor = (autoCompactWindow: string) =>
932+
it("reports the configured auto-compact window unless it exceeds a known context window", () => {
933+
const thresholdFor = (
934+
autoCompactWindow: string,
935+
modelSelection: ModelSelection = CLAUDE_TEST_MODEL_SELECTION,
936+
) =>
934937
ClaudeAdapterV2.claudeProviderTurnTokenUsage(
935938
{ input_tokens: 1, output_tokens: 1 },
936-
CLAUDE_TEST_MODEL_SELECTION,
939+
modelSelection,
937940
"2026-08-29T00:00:00.000Z",
938941
autoCompactWindow,
939942
).autoCompactThreshold;
940943

941944
assert.strictEqual(thresholdFor("150000"), 150_000);
942945
assert.strictEqual(thresholdFor("650000"), undefined);
943946
assert.strictEqual(thresholdFor(""), undefined);
947+
assert.strictEqual(
948+
thresholdFor("650000", { ...CLAUDE_TEST_MODEL_SELECTION, model: "uncatalogued-model" }),
949+
650_000,
950+
);
944951
});
945952
});
946953

0 commit comments

Comments
 (0)