diff --git a/packages/coding-agent/test/agent-session-handoff.test.ts b/packages/coding-agent/test/agent-session-handoff.test.ts index 52251ec70..d8e82aa54 100644 --- a/packages/coding-agent/test/agent-session-handoff.test.ts +++ b/packages/coding-agent/test/agent-session-handoff.test.ts @@ -17,6 +17,7 @@ import { TempDir } from "@oh-my-pi/pi-utils"; import * as snapcompact from "@oh-my-pi/snapcompact"; const HANDOFF_SECRET = "HANDOFF_SECRET_TOKEN_12345"; +const UNRENDERABLE_SNAPCOMPACT_TEXT = "\uE000\uE001\uE002\uE003\uE004\uE005\uE006\uE007\uE008\uE009"; describe("AgentSession handoff", () => { // Immutable across the whole file: the model registry's synchronous bundled-model @@ -451,7 +452,7 @@ describe("AgentSession handoff", () => { const fixedPreparation: compactionModule.CompactionPreparation = { firstKeptEntryId: lastEntryId, messagesToSummarize: [ - { role: "user", content: [{ type: "text", text: "中文内容".repeat(100) }], timestamp: 1 }, + { role: "user", content: [{ type: "text", text: UNRENDERABLE_SNAPCOMPACT_TEXT.repeat(100) }], timestamp: 1 }, ], turnPrefixMessages: [], recentMessages: [], @@ -478,7 +479,7 @@ describe("AgentSession handoff", () => { const fixedPreparation: compactionModule.CompactionPreparation = { firstKeptEntryId: lastEntryId, messagesToSummarize: [ - { role: "user", content: [{ type: "text", text: "中文内容".repeat(100) }], timestamp: 1 }, + { role: "user", content: [{ type: "text", text: UNRENDERABLE_SNAPCOMPACT_TEXT.repeat(100) }], timestamp: 1 }, ], turnPrefixMessages: [], recentMessages: [], diff --git a/packages/coding-agent/test/agent-session-snapcompact-auto-fallback.test.ts b/packages/coding-agent/test/agent-session-snapcompact-auto-fallback.test.ts index 3a3a4ef38..0a9af2702 100644 --- a/packages/coding-agent/test/agent-session-snapcompact-auto-fallback.test.ts +++ b/packages/coding-agent/test/agent-session-snapcompact-auto-fallback.test.ts @@ -11,6 +11,8 @@ import { AuthStorage } from "@oh-my-pi/pi-coding-agent/session/auth-storage"; import { SessionManager } from "@oh-my-pi/pi-coding-agent/session/session-manager"; import { TempDir } from "@oh-my-pi/pi-utils"; +const UNRENDERABLE_SNAPCOMPACT_TEXT = "\uE000\uE001\uE002\uE003\uE004\uE005\uE006\uE007\uE008\uE009"; + interface Harness { session: AgentSession; sessionManager: SessionManager; @@ -42,7 +44,7 @@ async function createHarness(tempDir: TempDir, authStorage: AuthStorage, options const settings = Settings.isolated({ "compaction.strategy": "snapcompact", // Force a 1-token recent window so the post-turn cut always splits off the - // last turn and summarizes the seeded (CJK) history. With the default + // last turn and summarizes the seeded unrenderable history. With the default // 20k window the cut keeps both tiny messages, leaving nothing for // snapcompact's renderability preflight to scan. "compaction.keepRecentTokens": 1, @@ -153,7 +155,7 @@ describe("AgentSession auto-snapcompact local-blocker fallback", () => { seedMessages: [ { role: "user", - content: "你好,请帮我审查这段代码。它的逻辑似乎有问题,我无法理解为何返回空结果。", + content: UNRENDERABLE_SNAPCOMPACT_TEXT.repeat(10), timestamp: Date.now(), }, ],