From 59e63fbb5e2382279184fd5fb4f5b6c45e9f4feb Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 11:41:11 +0000 Subject: [PATCH] test(muse): exercise child history replay without a live setup turn Seed a historical child after closing an empty session so the replay regression reaches resume even when live subagent projection is broken. Both paths now fail independently with the reported negotiation error. Co-authored-by: George <90179633+georgepullen@users.noreply.github.com> --- .../src/server/plugins/runtime.posix.test.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/server/src/server/plugins/runtime.posix.test.ts b/packages/server/src/server/plugins/runtime.posix.test.ts index d55ec37e4e..8899226dac 100644 --- a/packages/server/src/server/plugins/runtime.posix.test.ts +++ b/packages/server/src/server/plugins/runtime.posix.test.ts @@ -445,17 +445,23 @@ register(${JSON.stringify(guardUrl)});`; }); try { const first = await client.createSession({ provider: "muse", cwd: process.cwd() }); - const firstEvents: AgentStreamEvent[] = []; - first.subscribe((event) => firstEvents.push(event)); - await first.startTurn("dispatch a subagent", { clientMessageId: "muse-history" }); - await expectTurnCompleted(firstEvents); const persistence = first.describePersistence(); expect(persistence).not.toBeNull(); await first.close(); - // Resuming replays the recorded native history, which contains the - // subagent item: the child must be projected again, not fail the - // connection the way a timeline fetch did on 0.11.2. + // Seed old history without running a live subagent first, so this test + // reaches resume even when live child projection is broken. + await writeFile( + path.join(historyDirectory, "native-history.ndjson"), + JSON.stringify({ + itemId: "historical-subagent", + revision: 1, + kind: "toolCall", + status: "completed", + tool: "subagent_spawn", + childSessionId: "fixture-child", + }) + "\n", + ); const resumed = await client.resumeSession(persistence!, { cwd: process.cwd() }); const resumedEvents: AgentStreamEvent[] = []; resumed.subscribe((event) => resumedEvents.push(event));