diff --git a/packages/cli/tests/session-launch.test.mjs b/packages/cli/tests/session-launch.test.mjs index 10e72d15c..ea81c8e5f 100644 --- a/packages/cli/tests/session-launch.test.mjs +++ b/packages/cli/tests/session-launch.test.mjs @@ -372,8 +372,8 @@ test("REQ-THREAD-2 REQ-LAUNCH-1 a symlinked session store refuses thread-store-r // T2, M6 and the halt fence (C2). The credentialStatus op runs in start() after check() returned. // Its first call halts and resumes, a new generation with no halt, so only start()'s own // admission(admissionGeneration) refuses, before the session workspace is made. On the retry, -// the recheck's mayLaunch op (inside check(), after the lock is taken) halts, and the recheck -// refuses processing-halted. Neither attempt spawns, and the second releases its lock. +// the recheck's mayLaunch op (inside check(), after the lock is taken) halts once it has answered, +// and the recheck's admission() refuses processing-halted. Neither attempt spawns, and the second releases its lock. test("REQ-THREAD-2 REQ-LAUNCH-1 a named session's start refuses processing-generation-changed, then processing-halted, after check() and before any spawn", { skip, timeout: 60000 }, async (t) => { const prepared = prepare(t); const { f } = prepared; @@ -389,12 +389,15 @@ test("REQ-THREAD-2 REQ-LAUNCH-1 a named session's start refuses processing-gener } return runtime.credentialStatus(m.business, m.role); }, - mayLaunch: (m) => { + // The halt lands after the op answers: halted inside it, the bus's own fence + // (runtime.mjs processingWork) throws and the launcher refuses limit-check-failed. + mayLaunch: async (m) => { + const may = await runtime.mayLaunch(m); if (m.instance === "assistant" && credentials === 2 && halts === 1) { halt(); halts++; } - return runtime.mayLaunch(m); + return may; }, }), });