test(runner): await active suspension state

This commit is contained in:
Dotta 2026-09-03 05:11:55 -05:00
parent 2cf19a8de0
commit a418938524
2 changed files with 15 additions and 7 deletions

View File

@ -211,13 +211,15 @@ describe("ACPX runtime host", () => {
expect(createRuntime).not.toHaveBeenCalled();
expect(fixture.commandClose).toHaveBeenCalledOnce();
const authPath = join(credentialHome, "auth.json");
const contender = await vi.waitFor(() =>
stageManagedCodexCredential({
agentHomeDirectory: credentialHome,
environment: {
PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}',
},
}),
const contender = await vi.waitFor(
() =>
stageManagedCodexCredential({
agentHomeDirectory: credentialHome,
environment: {
PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}',
},
}),
{ timeout: 5_000 },
);
await contender.close();
await expect(readFile(authPath)).rejects.toMatchObject({ code: "ENOENT" });

View File

@ -2103,6 +2103,12 @@ it("persists an active provider as settled before bounded suspension", async ()
await bundle.transport.request("turn/start", {
input: [{ type: "text", text: "Wait for another instruction." }],
});
const notifications = bundle.transport
.notifications()
[Symbol.asyncIterator]();
await expect(notifications.next()).resolves.toMatchObject({
value: { method: "turn/started" },
});
await bundle.transport.close();
const providerState = JSON.parse(