Skip to content

fix(staged): prevent double review row when adopting already-running autoreview#638

Merged
matt2e merged 2 commits intomainfrom
reveal-autoreview-showed-double
Apr 16, 2026
Merged

fix(staged): prevent double review row when adopting already-running autoreview#638
matt2e merged 2 commits intomainfrom
reveal-autoreview-showed-double

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Apr 16, 2026

Summary

  • Fix double review row appearing when adopting an autoreview whose session is already running by checking session status before deciding whether to resume
  • Extract registerRunningSession helper to reduce duplication of sessionRegistry.register + projectStateStore.addRunningSession calls
  • Defer setReviewAuto (reveal) until after all fallible operations succeed, preventing a review from being revealed in a broken state

Test plan

  • Verify that adopting an already-running autoreview shows only one review row
  • Verify that adopting an interrupted (non-running) autoreview still resumes correctly
  • Verify that normal session start flow still registers sessions properly

🤖 Generated with Claude Code

matt2e and others added 2 commits April 16, 2026 11:53
…autoreview

Check session status before attempting resume in tryAdoptAutoReview.
If the session is already running, register it on the frontend instead
of calling resumeSession (which rejects already-running sessions).
Move setReviewAuto after fallible operations so the review stays hidden
if adoption fails, preventing the revealed-autoreview + new-session
double row.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lication

Extract a private registerRunningSession() method that encapsulates the
paired sessionRegistry.register + projectStateStore.addRunningSession
calls. This pattern appeared in 4 places (3 in tryAdoptAutoReview, 1 in
startBranchSessionWithPendingItem) and was flagged in code review as
easy to get out of sync if either call changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners April 16, 2026 03:17
@matt2e matt2e merged commit e5fd649 into main Apr 16, 2026
5 checks passed
@matt2e matt2e deleted the reveal-autoreview-showed-double branch April 16, 2026 03:20
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.

1 participant