mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 14:31:34 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user