Synchronize admission diagnostic tests with runtime entry

This commit is contained in:
Dotta committed 2026-10-10 23:50:24 -05:00
1 parent aca464caa5
commit 7c7c35b1ca
1 file changed
+7 -2
@@ -206,7 +206,11 @@ describe("ACPX runtime host", () => {
const port = runtimePort({ getStatus: async () => ({ models: { currentModelId: "claude-sonnet-5" } }) });
const gate = deferred<AcpxRuntimePort>();
const stages: Array<{ stage: string; elapsedMs: number }> = [];
const openRuntime = vi.fn(() => gate.promise);
const enteredRuntime = deferred<void>();
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);