Skip to content

fix: broadcast newly-discovered orphan sessions to UI#136

Open
anish749 wants to merge 1 commit into
gbasin:masterfrom
anish749:fix/orphan-sessions-broadcast
Open

fix: broadcast newly-discovered orphan sessions to UI#136
anish749 wants to merge 1 commit into
gbasin:masterfrom
anish749:fix/orphan-sessions-broadcast

Conversation

@anish749
Copy link
Copy Markdown

Fixes #135.

Problem

New orphan rows were inserted into agent_sessions but never broadcast — the UI's history list stayed empty until some unrelated event happened to trigger updateDormantAgentSessions().

Fix

Add an onSessionsDiscovered callback fired at the end of pollOnce when orphans > 0, wired to updateDormantAgentSessions() next to the existing onSessionActivated / onSessionOrphaned callbacks.

Tests

Two new logPoller.test.ts cases:

  • callback fires for new-orphan discovery
  • callback does not fire when every new log matches a window

22/22 logPoller tests pass; lint and typecheck clean.

LogPoller#pollOnce inserted new orphan agent_sessions rows but only fired
onSessionActivated / onSessionOrphaned, which are transition-only. First-time
discoveries with no matching tmux window were silent, so the registry's
history bucket never got populated until some unrelated event triggered
updateDormantAgentSessions().

Add an onSessionsDiscovered callback fired at the end of pollOnce when
orphans > 0, and wire it to updateDormantAgentSessions() alongside the
existing callbacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newly-discovered orphan Claude log sessions never appear in UI

1 participant