mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-04 10:10:01 +00:00
test(codex): give the rotated successor thread a fresh id in settlement test
"settles timeout at final with writer release after cutoff" hung for its full
120 s on main since 5367527c27 (#160952). That change makes a rotated native
thread reject reuse of its persisted predecessor's thread ID, but the
successor fixture still answered thread/start with "thread-1", so the product
correctly refused the reuse and the test waited forever on turn/start.
The fixture now returns a distinct ID for a fresh thread/start, completes the
turn on the selected thread, and awaits real turn acceptance. Test-only; all
assertions unchanged. The case now runs in ~0.6 s.
This commit is contained in:
parent
cf3af204b2
commit
52e60fb42b
1 changed files with 17 additions and 10 deletions
|
|
@ -566,10 +566,13 @@ describe("Codex app-server terminal settlement", () => {
|
|||
if (boundary === "final" && release === "after cutoff") {
|
||||
// Successor I/O and relay retirement must outlive the completed deadline simulation.
|
||||
vi.useRealTimers();
|
||||
let nextThreadId = "thread-1";
|
||||
const nextHarness = createStartedThreadHarness(
|
||||
async (method) => {
|
||||
if (method === "thread/resume") {
|
||||
return threadStartResult("thread-1");
|
||||
if (method === "thread/start" || method === "thread/resume") {
|
||||
// A rotated native thread cannot reuse its persisted predecessor's ID.
|
||||
nextThreadId = method === "thread/start" ? "thread-next" : "thread-1";
|
||||
return threadStartResult(nextThreadId);
|
||||
}
|
||||
return method === "turn/start" ? turnStartResult("turn-next") : undefined;
|
||||
},
|
||||
|
|
@ -580,14 +583,18 @@ describe("Codex app-server terminal settlement", () => {
|
|||
runId: "run-next",
|
||||
abortSignal: successorAbort.signal,
|
||||
});
|
||||
await nextHarness.waitForMethod("turn/start");
|
||||
await nextHarness.notify(
|
||||
turnCompleted({
|
||||
id: "turn-next",
|
||||
status: "completed",
|
||||
items: [{ id: "next-answer", type: "agentMessage", text: "Next turn saved." }],
|
||||
}),
|
||||
);
|
||||
await successor.waitForTurnAccepted();
|
||||
await nextHarness.notify({
|
||||
method: "turn/completed",
|
||||
params: {
|
||||
threadId: nextThreadId,
|
||||
turn: {
|
||||
id: "turn-next",
|
||||
status: "completed",
|
||||
items: [{ id: "next-answer", type: "agentMessage", text: "Next turn saved." }],
|
||||
},
|
||||
},
|
||||
});
|
||||
const next = await successor;
|
||||
expect(readAttemptTerminal(next)).toMatchObject({ aborted: false, timedOut: false });
|
||||
expect(next.assistantTranscriptOwned).toBe(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue