feat: live SSE updates for the SYST3M reminders section

Add RemindersChanged SSE event so the pending-reminders list in the
SYST3M tab updates live without polling.

Backend emission sites (every path that mutates the reminders table):
- agent_server: store_remind (remind MCP call)
- dashboard.rs: post_cancel_reminder, post_retry_reminder
- questions.rs: cancel_loose_end Reminder kind
- reminder_scheduler: after each delivery batch (any_delivered)

Coordinator gets emit_reminders_snapshot() mirroring the existing
emit_schedules_snapshot() pattern: lists PendingReminder rows from the
broker and emits DashboardEvent::RemindersChanged.

Frontend: applyRemindersChanged(ev) calls renderReminders(ev.reminders)
and is registered as reminders_changed in MUTATION_HANDLERS.

Docs: dashboard.md reminders_changed entry; CLAUDE.md file map updated.
This commit is contained in:
iris 2026-06-05 10:13:16 +02:00 committed by mara
commit a1e46e2b3d
9 changed files with 55 additions and 1 deletions

View file

@ -389,6 +389,24 @@ impl Coordinator {
});
}
/// Emit a `RemindersChanged` snapshot event. Called from every
/// reminder mutation site (agent `remind` calls, operator cancel /
/// retry, and the scheduler after each delivery batch) so the
/// dashboard's pending-reminders list stays live without polling.
pub fn emit_reminders_snapshot(self: &Arc<Self>) {
let reminders = match self.broker.list_pending_reminders() {
Ok(rows) => rows,
Err(e) => {
tracing::warn!(error = ?e, "emit_reminders_snapshot: list failed");
return;
}
};
self.emit_dashboard_event(DashboardEvent::RemindersChanged {
seq: self.next_seq(),
reminders,
});
}
/// Update the `step` label on a running queue entry and (if it
/// actually changed) re-emit the queue snapshot so the dashboard
/// renders the new phase. Returns `true` when the label was new