Recover background chat observers from durable live membership

This commit is contained in:
2026-11-07 16:33:49 +00:00
parent 9c67415c22
commit 132a94192a
13 changed files with 700 additions and 59 deletions
+6 -3
View File
@@ -134,9 +134,6 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
// session; resume delivering any a previous process left queued.
hub.queueStore = stores[0]
hub.liveStore = stores[0]
if options.Chat != nil {
go hub.resumeQueued(ctx, options.Chat)
}
}
acks := newAttentionAckHub()
var ackStore attentionAckStore
@@ -500,9 +497,15 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
// that ended while it was down), then keep observing any other chat
// whose turn is still running, so a reply or question still notifies
// with no client attached.
done := make(chan struct{})
hub.recoveryDone = done
go func() {
hub.reattachSessions(ctx, options.Chat)
// Restore live turn ownership before queue rooms can start runners.
hub.resumeQueued(ctx, options.Chat)
hub.observeRunningTurns(ctx, options.Chat)
close(done)
hub.retryReattachments(ctx, options.Chat)
}()
}
if runs != nil {