From 7c7c35b1ca2c82d378f49afdbb2d06bb8af5c673 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 10 Oct 2026 23:50:03 -0500 Subject: [PATCH] Synchronize admission diagnostic tests with runtime entry --- .../src/drivers/acpx/runtime-host.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts b/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts index 582dedb517..da48493661 100644 --- a/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts +++ b/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts @@ -206,7 +206,11 @@ describe("ACPX runtime host", () => { const port = runtimePort({ getStatus: async () => ({ models: { currentModelId: "claude-sonnet-5" } }) }); const gate = deferred(); const stages: Array<{ stage: string; elapsedMs: number }> = []; - const openRuntime = vi.fn(() => gate.promise); + const enteredRuntime = deferred(); + const openRuntime = vi.fn(() => { + enteredRuntime.resolve(); + return gate.promise; + }); const opening = trackAdmissionOpening(AcpxRuntimeHost.open({ ...fixture.options, agent: "claude", model: "claude-sonnet-5", semanticTools: { tools: [], handler: async () => ({}) }, @@ -219,7 +223,8 @@ describe("ACPX runtime host", () => { }, })); try { - await vi.waitFor(() => expect(openRuntime).toHaveBeenCalledOnce()); + await enteredRuntime.promise; + expect(openRuntime).toHaveBeenCalledOnce(); expect(stages.at(-1)?.stage).toBe("handshake"); } finally { gate.resolve(port);