diff --git a/packages/testkit/test/subscription-failover.test.ts b/packages/testkit/test/subscription-failover.test.ts index 15f17e07..46f8c65c 100644 --- a/packages/testkit/test/subscription-failover.test.ts +++ b/packages/testkit/test/subscription-failover.test.ts @@ -84,7 +84,8 @@ describe("Переезд на подписку другого провайдер const sid = await p.start(); assert.equal((await sess(sid)).provider, "claude"); await p.waitStatus(sid, "rate_limited"); - assert.equal((await sess(sid)).rotateReason, "limit"); + const before = await sess(sid); + assert.equal(before.rotateReason, "limit"); await tick(); const start = await p.waitLog("relaunched on Codex", (e) => e.ev === "start" && e.gen === "2"); assert.equal(start.resume, null, "a conversation doesn't move between CLIs"); @@ -93,7 +94,9 @@ describe("Переезд на подписку другого провайдер const s = await sess(sid); assert.equal(s.provider, "codex"); assert.equal(s.subscriptionId, c.id); - assert.equal(s.conversationId, null); + // Claude's conversation is dropped; Codex may already have reported its own new thread (codex-notify). + assert.ok(before.conversationId, "Claude had a conversation before the switch"); + assert.notEqual(s.conversationId, before.conversationId, "Claude's conversation is not carried over to Codex"); const ev = (await typeEvents(runner.SWITCH_EVENT)).find((e) => e.sessionId === sid)!.payload as Record; assert.deepEqual({ from: ev.fromProvider, to: ev.toProvider, carried: ev.carried }, { from: "claude", to: "codex", carried: "fresh" }); const [msg] = await outboxTexts(`rot:${sid}:g2:`);