feat(staged): add manual Start button for stuck queued sessions#544
feat(staged): add manual Start button for stuck queued sessions#544
Conversation
Queued sessions can get stuck indefinitely when the drain mechanism fails (e.g. after app restart or agent hang). This adds a "Start" action button on queued timeline rows that manually triggers drainQueuedSessions, giving users an escape hatch to unstick them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…queued rows Add a visible border to the Start button so it looks like a proper button, and hide the session-modal button on queued rows since there is no session to view yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ession The Start button was always showing on queued rows. Now it only appears when there are no running sessions in the timeline, since the queued session can't start while another is active anyway. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: baa7076804
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (review.sessionStatus === 'running') return true; | ||
| } | ||
| for (const item of pendingItems) { | ||
| if (item.sessionId && !item.type.startsWith('queued-')) return true; |
There was a problem hiding this comment.
Treat pending starts as active before showing Start
hasActiveSession currently ignores non-queued pendingItems until they have a sessionId, but startBranchSessionWithPendingItem creates a non-queued placeholder before the ID is assigned. In that window, queued rows still get onStartClick, so a user can click Start and trigger drainQueuedSessions while another start request is already in flight. Because start_branch_session does not enforce a branch-level running-session guard, this can launch concurrent sessions on the same branch. Count any non-queued pending item as active (even without sessionId) or otherwise block Start during session-start pending.
Useful? React with 👍 / 👎.
Summary
drainQueuedSessionsTest plan
drainQueuedSessionsand kicks off the queued session🤖 Generated with Claude Code