From b914f552f6fff6e8e8c78498978078c46efbf178 Mon Sep 17 00:00:00 2001 From: can1357 Date: Sun, 5 Jul 2026 17:47:07 +0200 Subject: [PATCH] test(coding-agent): pinned plan-reference compaction window to 200k claude-sonnet-4-5's bundled context window grew to 1M in the catalog regen, so the fixed 191k high-usage turn no longer crossed the ~85% auto-compaction threshold. The auto-continuation never fired and the three re-injection tests hung to their 5s timeout, failing the coding-agent runtime/session CI bucket and blocking the release. Pin the harness model to a 200k window (mirrors agent-session-eager-compaction / -auto-compaction-queue), keeping the trigger stable across future catalog regenerations. --- .../test/agent-session-plan-reference-compaction.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/test/agent-session-plan-reference-compaction.test.ts b/packages/coding-agent/test/agent-session-plan-reference-compaction.test.ts index 00705619d..2885fc6e5 100644 --- a/packages/coding-agent/test/agent-session-plan-reference-compaction.test.ts +++ b/packages/coding-agent/test/agent-session-plan-reference-compaction.test.ts @@ -133,8 +133,13 @@ describe("AgentSession approved-plan reference re-injection after compaction (is resolve: (call: ObservedPromptCall) => void; }> = []; - const model = getBundledModel("anthropic", "claude-sonnet-4-5"); - if (!model) throw new Error("Expected claude-sonnet-4-5 model to exist"); + const bundled = getBundledModel("anthropic", "claude-sonnet-4-5"); + if (!bundled) throw new Error("Expected claude-sonnet-4-5 model to exist"); + // Pin the context window so the fixed 191k high-usage turn stays above the + // compaction threshold across catalog regenerations: claude-sonnet-4-5's + // bundled window grew to 1M, which a 191k turn no longer trips. Mirrors + // agent-session-eager-compaction / -auto-compaction-queue. + const model = { ...bundled, contextWindow: 200_000, maxTokens: 64_000 }; const authStorage = await AuthStorage.create(path.join(tempDir.path(), `testauth-${cleanups.length}.db`)); authStorage.setRuntimeApiKey("anthropic", "test-key");