fix(compaction): remove hardcoded Claude model from compaction hooks

This commit is contained in:
YeonGyu-Kim
2026-02-06 17:49:26 +09:00
parent f1b2f6f3f7
commit 60bbeb7304
8 changed files with 119 additions and 114 deletions
@@ -0,0 +1,21 @@
import { describe, expect, test } from "bun:test"
import { readFileSync } from "node:fs"
describe("experimental.session.compacting", () => {
test("does not hardcode a model and uses output.context", () => {
//#given
const indexUrl = new URL("./index.ts", import.meta.url)
const content = readFileSync(indexUrl, "utf-8")
const hookIndex = content.indexOf('"experimental.session.compacting"')
//#when
const hookSlice = hookIndex >= 0 ? content.slice(hookIndex, hookIndex + 1200) : ""
//#then
expect(hookIndex).toBeGreaterThanOrEqual(0)
expect(content.includes('modelID: "claude-opus-4-6"')).toBe(false)
expect(hookSlice.includes("output.context.push")).toBe(true)
expect(hookSlice.includes("providerID:")).toBe(false)
expect(hookSlice.includes("modelID:")).toBe(false)
})
})