test(e2e): delay the draft-proof final answer past the start gate

A progress draft only exists while the agent is working, and OpenClaw's exec
returns instantly for a mock tool call, so the whole turn finished in ~86ms —
inside the 1.5s draft gate. No draft was created, which is correct behavior but
proves nothing about rendering.

The draft-proof scenario now holds its final answer (MOCK_DRAFTPROOF_FINAL_DELAY_MS,
default 6s) so the turn straddles the gate. That is what made the live Discord
recording possible: draft created, edited with the status headline above the
tool line, replaced by the final answer, then deleted.
This commit is contained in:
Ayaan Zaidi
2026-07-30 06:15:41 +02:00
parent c63241d3ce
commit d8d77ffbae

View File

@@ -600,6 +600,10 @@ const server = http.createServer((req, res) => {
);
return;
}
// Hold the final answer so the turn outlives the progress-draft start
// gate. Without this the whole turn finishes in well under a second and
// no draft is created, which is correct behavior but proves nothing.
await delay(readPositiveIntEnv("MOCK_DRAFTPROOF_FINAL_DELAY_MS", 6000));
writeChatCompletion(res, body.stream !== false, "OPENCLAW_E2E_DRAFTPROOF");
return;
}