Report a busy chat on subscribe after a reload
The room that records a server-run turn is torn down when its last client leaves, so a page reload re-subscribed to a new room that no longer knew the turn was running and never replayed the step-started marker. Claude Code does not re-announce a running turn to a new stream either, so the activity row and Stop control vanished until the next streamed delta. chat_subscribe now also replays the marker when the room's stream announced a turn (CLI-originated or re-announced on attach) or when the broker reports its own turn in flight through the optional chatTurnReporter (Claude Code reads its in-process running flag; the chat manager routes it without I/O).
This commit is contained in:
@@ -93,6 +93,15 @@ type chatShellReleaser interface {
|
||||
ReleaseShells(sessionID string)
|
||||
}
|
||||
|
||||
// chatTurnReporter is implemented by a broker that knows, without I/O, whether
|
||||
// a session's turn is in flight in the harness itself. The hub's room forgets a
|
||||
// turn when its last client leaves (a page reload), and a harness such as Claude
|
||||
// Code does not replay a step-started frame to a new stream, so chat_subscribe
|
||||
// asks the broker before deciding whether to replay the live marker.
|
||||
type chatTurnReporter interface {
|
||||
TurnRunning(sessionID string) bool
|
||||
}
|
||||
|
||||
// operatorRegistry is the server-side operator-session seam. *pipeline.Store
|
||||
// satisfies it. It is a table of its own, separate from the pipeline stage
|
||||
// ownership (SessionOwner/run_session_owners) that settles a run: chat_sessions
|
||||
|
||||
Reference in New Issue
Block a user