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
+7 -1
View File
@@ -85,7 +85,13 @@ func testChatShellOutputOwnedAndForeign(t *testing.T, exited bool) {
if err := store.RecordOperatorSession(ctx, LargeChatFixtureSessionID, t.TempDir(), "owned", protocol.ChatSessionTagOperator); err != nil {
t.Fatal(err)
}
srv := httptest.NewServer(HandlerWithOptions(ctx, Options{Chat: opencode.NewChat(attached.Connection), OperatorRegistry: store}))
handler := HandlerWithOptions(ctx, Options{Chat: opencode.NewChat(attached.Connection), OperatorRegistry: store}).(*runHandler)
srv := httptest.NewServer(handler)
select {
case <-handler.hub.recoveryDone:
case <-ctx.Done():
t.Fatal("startup recovery did not finish")
}
defer srv.Close()
ws := dialShellOutputWebsocket(t, ctx, srv)
defer ws.CloseNow()