diff --git a/packages/coding-agent/src/prompts/system/tan-context-switch.md b/packages/coding-agent/src/prompts/system/tan-context-switch.md index 55468b15a..88cd57291 100644 --- a/packages/coding-agent/src/prompts/system/tan-context-switch.md +++ b/packages/coding-agent/src/prompts/system/tan-context-switch.md @@ -1,5 +1,5 @@ -The conversation above belongs to your parent session. +The conversation above belongs to your parent session. You are a fork created solely to handle the user's request below. Your parent agent is still working on the original task — that responsibility is diff --git a/packages/coding-agent/test/core/hashline.test.ts b/packages/coding-agent/test/core/hashline.test.ts index 3e41f52a7..8265640bf 100644 --- a/packages/coding-agent/test/core/hashline.test.ts +++ b/packages/coding-agent/test/core/hashline.test.ts @@ -369,7 +369,7 @@ describe("hashline — anchor-stale recovery via read snapshot cache", () => { expect(finalLines).toContain("L8"); const text = result.content[0]?.type === "text" ? result.content[0].text : ""; - expect(text).toMatch(/Recovered from a stale file hash using a previous read snapshot/); + expect(text).toMatch(/Recovered by remapping stale line anchors to unchanged current lines/); }); }); @@ -437,7 +437,7 @@ describe("hashline — anchor-stale recovery via read snapshot cache", () => { expect(finalLines).toContain("GAMMA"); expect(finalLines).not.toContain("gamma"); const text = result.content[0]?.type === "text" ? result.content[0].text : ""; - expect(text).toMatch(/Recovered from a stale file hash using a previous read snapshot/); + expect(text).toMatch(/Recovered by remapping stale line anchors to unchanged current lines/); }); }); diff --git a/packages/coding-agent/test/interactive-mode-status.test.ts b/packages/coding-agent/test/interactive-mode-status.test.ts index 2a2bff09c..542564c52 100644 --- a/packages/coding-agent/test/interactive-mode-status.test.ts +++ b/packages/coding-agent/test/interactive-mode-status.test.ts @@ -1,5 +1,6 @@ import { beforeAll, describe, expect, test, vi } from "bun:test"; import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; +import { resetSettingsForTest, Settings } from "@oh-my-pi/pi-coding-agent/config/settings"; import { initTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme"; import type { InteractiveModeContext } from "@oh-my-pi/pi-coding-agent/modes/types"; import { UiHelpers } from "@oh-my-pi/pi-coding-agent/modes/utils/ui-helpers"; @@ -64,7 +65,10 @@ function createInitialRenderHarness(): { ctx: InteractiveModeContext; helpers: U describe("InteractiveMode.showStatus", () => { beforeAll(async () => { - // showStatus uses the global theme instance + // showStatus uses the global theme instance; renderInitialMessages reads + // the global Settings (display.collapseCompacted). + resetSettingsForTest(); + await Settings.init({ inMemory: true }); await initTheme(); }); diff --git a/packages/coding-agent/test/tools/launch.test.ts b/packages/coding-agent/test/tools/launch.test.ts index eb5c95f3e..84b6bd48c 100644 --- a/packages/coding-agent/test/tools/launch.test.ts +++ b/packages/coding-agent/test/tools/launch.test.ts @@ -59,7 +59,7 @@ describe("daemon broker", () => { `process.stdin.setRawMode?.(true); process.stdin.setEncoding("utf8"); process.stdin.resume(); -process.stdout.write("READY\\n"); +process.stdout.write("\\x1b[1;32mREADY\\x1b[0m\\n"); process.stdin.on("data", chunk => process.stdout.write("INPUT:" + JSON.stringify(chunk) + "\\n")); setInterval(() => {}, 1000); `, @@ -114,6 +114,7 @@ setInterval(() => {}, 1000); expect(logs.op).toBe("logs"); if (logs.op !== "logs") throw new Error("unexpected logs result"); expect(logs.text).toContain("READY"); + expect(logs.text).toContain("\x1b[1;32mREADY\x1b[0m"); expect(logs.text).toContain('INPUT:"run\\r"'); const stopped = await first.request({ op: "stop", name: "debugger", timeoutMs: 2_000 });