Files
DocsGPT/application
Alex 59e9523666 fix: revoke stale UI surfaces when durable state goes terminal
The "Tool approval needed" toast (and several sibling surfaces) could
linger after the state they represent was already gone. User-scoped SSE
events (tool.approval.required, schedule.autopaused, attachment.queued,
…) are durable and replayed on reconnect, but no terminal path emitted a
matching clearing event and the reconciler only wrote operator-facing
stack_logs — so a failed/expired message replayed its approval prompt
with nothing to act on, and the toast trusted event presence over the
actual message state.

Backend — emit a user-facing event on every terminal path:
- reconciler deletes pending_tool_state and publishes
  tool.approval.cleared when a stuck message is failed;
  cleanup_pending_tool_state does the same for TTL-reaped rows
- reconciler now publishes source.ingest.failed (stalled ingest),
  schedule.run.failed (timeout/pending) and schedule.completed (once)
- schedules PATCH-resume / DELETE publish schedule.resumed / .cancelled
  so a stale schedule.autopaused can't outvote them on replay
- store_attachment gains the on_poison terminal-event hook the ingest
  tasks already have; mcp_oauth_task gains a soft/hard time limit so a
  hung flow self-reports mcp.oauth.failed
- tighten the reconciler exemption to the (conversation_id, user_id)
  composite key

Frontend — stop trusting event presence over truth:
- notificationsSlice.resolveToolApproval evicts the matching
  tool.approval.required and persists its (stable) id dismissed so the
  backlog replay stays suppressed
- ToolApprovalToast drops approval events older than the resumable TTL
  window as a backstop for a lost clearing event
- schedulesSlice handles schedule.resumed / .cancelled / .completed
- upload dismissals now outlive the SSE backlog retention window

Tests cover the new clearing events at the reconciler, slice and
dispatch layers.
2026-06-07 13:17:50 +01:00
..
2026-06-03 14:03:15 +01:00
2026-05-15 12:23:31 +01:00
2026-05-26 15:48:04 +01:00
2026-03-25 22:34:25 +00:00
2026-04-18 13:13:57 +01:00
2026-03-17 14:27:48 +00:00
2026-03-25 00:03:42 +00:00
2026-04-25 14:57:37 +01:00
2026-05-05 01:55:23 +01:00
2026-04-12 00:07:24 +01:00
2025-12-24 18:35:57 +02:00
2026-05-15 12:23:31 +01:00
2026-04-28 02:27:02 +01:00
2026-05-22 16:05:03 +01:00
2026-05-31 18:00:51 +02:00
2026-04-27 22:09:33 +01:00
2026-05-23 02:39:20 +01:00
2026-05-22 16:05:03 +01:00