Hold external chat admission until live turn recovery completes

This commit is contained in:
2026-11-07 16:41:02 +00:00
parent 132a94192a
commit 62406f7fdb
4 changed files with 93 additions and 0 deletions
+3
View File
@@ -498,11 +498,14 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
// whose turn is still running, so a reply or question still notifies
// with no client attached.
done := make(chan struct{})
ready := make(chan struct{})
hub.recoveryDone = done
hub.recoveryReady = ready
go func() {
hub.reattachSessions(ctx, options.Chat)
// Restore live turn ownership before queue rooms can start runners.
hub.resumeQueued(ctx, options.Chat)
close(ready)
hub.observeRunningTurns(ctx, options.Chat)
close(done)
hub.retryReattachments(ctx, options.Chat)