SSE reconnect, task switcher state/inbox/new task, stream throttle

This commit is contained in:
Ian Gulliver
2026-10-14 22:28:25 -07:00
parent 8e4c40eb5f
commit 33e682a9d5
27 changed files with 418 additions and 182 deletions
+7
View File
@@ -587,10 +587,17 @@ func (m *Manager) pump(l *live) {
ctx := context.Background()
for ev := range l.sess.Events() {
start := time.Now()
if wait := start.Sub(ev.Read); wait > 200*time.Millisecond {
slog.Info("agent event waited", "session", l.id, "type", ev.Type, "wait", wait)
}
err := m.handle(ctx, l, ev)
if err != nil {
slog.Error("record agent event", "session", l.id, "type", ev.Type, "err", err)
}
if took := time.Since(start); took > 200*time.Millisecond {
slog.Info("agent event slow", "session", l.id, "type", ev.Type, "took", took)
}
}
m.mu.Lock()