diff options
| author | akbash <akbash@herdr.dev> | 2026-09-10 13:19:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 13:19:25 +0300 |
| commit | 6fe8f818b91a2565f3546f9dc6b3b18f8a55b065 (patch) | |
| tree | d2a2d5f42ab7b0a740efde889131340d38de8620 /src/integration/assets/herdr-agent-state.test.ts | |
| parent | 120c682008a85dc17d7a13cc619a2fd5d25f3924 (diff) | |
fix(pi): support Windows session paths (#3729)
refs #3726
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Diffstat (limited to 'src/integration/assets/herdr-agent-state.test.ts')
| -rw-r--r-- | src/integration/assets/herdr-agent-state.test.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/integration/assets/herdr-agent-state.test.ts b/src/integration/assets/herdr-agent-state.test.ts index 7720e088..48cc8708 100644 --- a/src/integration/assets/herdr-agent-state.test.ts +++ b/src/integration/assets/herdr-agent-state.test.ts @@ -240,6 +240,28 @@ test("OMP accepts POSIX and Windows session paths", async () => { expect(isAbsoluteSessionPath("relative/omp-session.jsonl")).toBe(false); }); +test("Pi reports a Windows session path", async () => { + const requests = await startRecordingServer("pi-windows-session-path"); + const { handlers, pi } = createExtensionHarness(); + const { default: install } = await importFresh("./pi/herdr-agent-state.ts"); + install(pi); + + const sessionPath = "C:\\Users\\User\\.pi\\agent\\sessions\\pi-session.jsonl"; + await handlers.get("session_start")?.( + { reason: "startup" }, + { + ...piContext(() => true), + sessionManager: { + getSessionFile: () => sessionPath, + getSessionId: () => "pi-session", + }, + }, + ); + await waitFor(() => requests.length === 2); + + expect(requests.map(requestSessionPath)).toEqual([sessionPath, sessionPath]); +}); + test("Pi reports idle only after the agent settles", async () => { const requests = await startRecordingServer("pi-settled"); const { handlers, pi } = createExtensionHarness(); @@ -617,6 +639,13 @@ function requestState(request: unknown): unknown { return request.params.state; } +function requestSessionPath(request: unknown): unknown { + if (!isRecord(request) || !isRecord(request.params)) { + return undefined; + } + return request.params.agent_session_path; +} + function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === "object" && value !== null; } |
