fix(resume): recover cleanly after Pi exits

This commit is contained in:
User
2026-07-14 21:35:50 +02:00
parent 7e1d72c9a4
commit df1e7dea9c
13 changed files with 214 additions and 17 deletions
+5 -4
View File
@@ -14,10 +14,11 @@
- `SqlViewer`'s horizontal/vertical layout control is meaningful only with multiple SQL blocks;
hide it for the single CTE result shown by `CteResultViewer`.
- A Pi turn is `idle`, `running`, `waiting`, or `failed`. A reviewer gate/request moves it to
`waiting`; the reviewer response and steering move it back to `running`; provider failures
remain `failed` after `agent_end` and emit only the fixed sanitized recovery message.
- Resume preserves `running`/`waiting` runtimes. It replaces `idle`/`failed` runtimes, clears the
old SSE buffer/subscribers before cold resume, and reuses the persisted provider/model/thinking.
`waiting`; the reviewer response and steering move it back to `running`; provider failures and
unexpected Pi child exits mark it `failed` without forwarding raw failure detail.
- Resume preserves `running`/`waiting` runtimes. After manifest/readiness validation, every cold
path clears old SSE buffer/subscribers before reopen—including when a crashed child has already
left no runtime—and reuses persisted provider/model/thinking. Failed validation does not clear.
- A successful Resume of the already selected session increments the stream generation so React
closes the old EventSource and opens the same session URL again. Failed Resume must not reconnect.
- SSE endpoints are intentionally keep-alive. Browser cleanup and one-off probes must explicitly