[BUG] CI monitoring: sessions spawned from a task shard share branch subscriptions and a single global auto-fix toggle
Summary
When a session is opened from a task shard of another session (the spawned-task / split flow), the new session is subscribed to both branches' CI events — not just its own. Separately, the CI monitoring branch-options menu's "Auto-fix CI & address comments" and "Auto-merge when ready" toggles are global, not per-branch/per-session: toggling one branch flips the other too, so there is no way to make each session listen to only its own branch.
Use Case / Impact
Running concurrent sessions in worktrees, one session spawned from another's task shard:
- Session A is focused on
feature/branch-a(PR #A) - Session B (opened from A's shard) is focused on
feature/branch-b(PR #B)
Both sessions receive ci-monitor-events for both PRs. So a session scoped to a small change keeps waking on, and attempting to act on, review rounds for an unrelated large PR it doesn't own. This wastes tokens and wall-clock and creates confusing cross-talk between the two sessions.
The natural fix — open one session out via the per-branch toggle — does not work: the "Auto-fix CI & address comments" checkbox is shared, so unchecking it for one branch unchecks it for the other (and vice versa).
What Was Investigated
- A session opened from a task shard inherits/sees the parent session's branch in the CI monitoring panel, and CI events for that branch are delivered into the child session (and the child's branch events into the parent).
- In the CI monitoring branch-options menu, the auto-fix and auto-merge toggles behave as a single global setting rather than per-branch state — flipping either branch's checkbox flips both.
Expected Behavior
- A session's CI-event subscription should be scoped to its own branch/PR focus, so a shard-spawned session does not receive the originating session's branch events (and vice versa).
- The "Auto-fix CI & address comments" / "Auto-merge when ready" toggles should be per-branch (or per-session), so disabling monitoring for one branch does not disable it for another.
Repro
- In session A on branch X, spawn a task shard that opens session B on branch Y.
- Push to both branches to trigger CI on each.
- Observe session B receiving CI-monitor events for branch X as well as Y (and A receiving Y's).
- Open the CI monitoring branch options and uncheck "Auto-fix CI & address comments" for one branch → it unchecks for both.
Context
Related to the worktree/multi-session workflow described in #64593. The two issues compound: hard to tell sessions apart in the sidebar and their CI monitoring is entangled.
<img width="1916" height="646" alt="Image" src="https://github.com/user-attachments/assets/bc83a5ed-d86c-4e4f-9173-40fa56b1c424" />
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗