Chat list activity: turn running and background tasks on every row, pushed to every connection
chat_sessions rows carry activity (turn_running, background_tasks, seq) from the hub's own state, and chat_activity is pushed to every connection when a session's turn starts or ends or its running background-task count changes. A room whose last viewer left stays observed while background tasks run, bounded by the unattended limits; a Claude Code process exit ends its tasks.
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/coder/websocket"
|
||||
"github.com/coder/websocket/wsjson"
|
||||
|
||||
"git.a-wan.net/alan/pipelines/internal/opencode"
|
||||
"git.a-wan.net/alan/pipelines/internal/pipeline"
|
||||
@@ -236,7 +235,7 @@ func TestChatSubscribeListsQueuedPromptsAndUnqueueRemoves(t *testing.T) {
|
||||
sawUser := false
|
||||
for {
|
||||
var message protocol.Message
|
||||
if err := wsjson.Read(server.ctx, reloaded, &message); err != nil {
|
||||
if err := readTestFrame(server.ctx, reloaded, &message); err != nil {
|
||||
t.Fatalf("no delivery reported: %v", err)
|
||||
}
|
||||
if event := message.ChatEvent; event != nil && event.Kind == protocol.ChatEventUser && event.OperationID == "op-3" {
|
||||
@@ -259,7 +258,7 @@ func TestChatSubscribeListsQueuedPromptsAndUnqueueRemoves(t *testing.T) {
|
||||
writeChat(t, server.ctx, reloaded, protocol.Message{Type: protocol.ChatUnqueue, ID: "rm-late", ChatUnqueue: &protocol.ChatUnqueueRequest{SessionID: "ses_1", OperationID: "op-3"}})
|
||||
for {
|
||||
var message protocol.Message
|
||||
if err := wsjson.Read(server.ctx, reloaded, &message); err != nil {
|
||||
if err := readTestFrame(server.ctx, reloaded, &message); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if message.ID == "rm-late" {
|
||||
|
||||
Reference in New Issue
Block a user