fix: read anthropic 1m flag from live model cache state

This commit is contained in:
YeonGyu-Kim
2026-02-17 10:45:48 +09:00
parent d979bd945a
commit 21144ed1e3
12 changed files with 64 additions and 38 deletions
+6 -2
View File
@@ -269,7 +269,9 @@ describe("preemptive-compaction", () => {
it("should use 1M limit when model cache flag is enabled", async () => {
//#given
const hook = createPreemptiveCompactionHook(ctx as never, true)
const hook = createPreemptiveCompactionHook(ctx as never, {
anthropicContext1MEnabled: true,
})
const sessionID = "ses_1m_flag"
await hook.event({
@@ -306,7 +308,9 @@ describe("preemptive-compaction", () => {
it("should keep env var fallback when model cache flag is disabled", async () => {
//#given
process.env[ANTHROPIC_CONTEXT_ENV_KEY] = "true"
const hook = createPreemptiveCompactionHook(ctx as never, false)
const hook = createPreemptiveCompactionHook(ctx as never, {
anthropicContext1MEnabled: false,
})
const sessionID = "ses_env_fallback"
await hook.event({