PEP-250: Access Hub — агент сам просит доступ к сервису, владелец подключает ключ один раз #240

Merged
peppa-bot merged 17 commits from task/pep-250 into main 2026-11-27 05:30:22 +00:00
Showing only changes of commit 00cb57cdd6 - Show all commits

View File

@ -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<string, unknown>;
assert.deepEqual({ from: ev.fromProvider, to: ev.toProvider, carried: ev.carried }, { from: "claude", to: "codex", carried: "fresh" });
const [msg] = await outboxTexts(`rot:${sid}:g2:`);