diff --git a/packages/testkit/test/lost-conversation.test.ts b/packages/testkit/test/lost-conversation.test.ts index e68d4c02..76431568 100644 --- a/packages/testkit/test/lost-conversation.test.ts +++ b/packages/testkit/test/lost-conversation.test.ts @@ -40,7 +40,9 @@ describe("Потерянный разговор — новый запуск, а await tickAt(new Date(t0.getTime() + MIN + 1000)); const resumed = await p.waitLog("resume refused", (e) => e.ev === "exit" && e.reason === "no_conversation"); assert.equal(resumed.gen, "2"); - assert.equal((await sess(sid)).watchState?.restarts?.length, 1); + // PEP-268: a vanished tmux session is the platform's failure — no automatic restart spent. + assert.equal((await sess(sid)).watchState?.restarts?.length ?? 0, 0); + assert.equal((await sess(sid)).watchState?.platformFails?.length, 1); // …Claude no longer has it: the conversation is forgotten, a new one starts at once. const t1 = new Date(t0.getTime() + MIN + 5000); @@ -53,7 +55,7 @@ describe("Потерянный разговор — новый запуск, а const start = await p.waitLog("fresh start", (e) => e.ev === "start" && e.gen === "3"); assert.equal(start.resume, null, "no --resume"); assert.ok((start.argv as string[]).some((a) => a.includes("сверься с peppa.get_task и tasks.md") || a.includes("Сверься с peppa.get_task и tasks.md")), "the prompt sends the agent to get_task and tasks.md"); - assert.equal((await sess(sid)).watchState?.restarts?.length, 1, "no automatic restart spent"); + assert.equal((await sess(sid)).watchState?.restarts?.length ?? 0, 0, "no automatic restart spent"); assert.equal((await eventsOf(sid, "conversation_restarted")).length, 1); await runner.stopSession(db, sid); });