Commit b8e20ad
e2e: fix real intermittent IPC drop in agent-tool-approval tests
The diagnostics added last time confirmed the chat request always reaches
the fake Ollama server (request count incremented correctly on every
failure) — the response chunk carrying the tool call was the thing going
missing, not the request. This is the same class of bug already documented
in fake-ollama.ts (Electron can silently coalesce/drop a webContents.send()
that lands in the same event-loop tick as another IPC send), just triggered
by a different neighbor: enabling agent mode kicks off its own background
IPC (sessions:update, agentTools.detectProjectScripts()), and the tool-call
turn is a single chunk carrying the *entire* response, so losing it leaves
nothing behind to recover — unlike token streaming, where losing one chunk
mid-stream still leaves partial text.
Fix: let agent-mode side effects settle (300ms) before sending, and widen
the tool-call turn's own response delay (250ms, up from the fixture's
15ms default) for more headroom. Passed 3x repeated locally plus the full
suite; previously flaked deterministically on CI even at a 30s wait.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 9865f82 commit b8e20ad
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
60 | 78 | | |
61 | 79 | | |
| |||
0 commit comments