Skip to content

Improve PR review session management #42

@goudyj

Description

@goudyj

Context

PR review sessions are not fully integrated with the existing session management system. When launching a review from a PR, the session is created but cannot be easily accessed afterwards.

Goal

Make PR review sessions consistent with issue-based sessions in terms of visibility and management.

Acceptance criteria

Session visibility

  • Fix has_pty calculation for worktrees without issue_number (tui.rs:229-231)
  • Add t key binding in PR list view to open existing PTY session (pr.rs)

Branch handling

  • Fetch PR branch from origin before creating worktree (worktree.rs in ensure_branch_exists)
    • Currently, if the branch doesn't exist locally, a new empty branch is created from origin/main
    • Should check for origin/<branch> and track it instead

Optional improvements

  • Persist PR review sessions in sessions.json
    • Adapt AgentSession to support PR reviews (add pr_number: Option<u64> or make issue_number optional)
    • Create AgentSession in pr.rs after dispatch
    • Benefits: stats tracking, status (Running/Awaiting/Completed), history

Already fixed

  • Session listing: list_pty_sessions()list_all_pty_sessions() in list.rs:280
  • Session naming: PTY session now named after worktree (not pr-review-{uuid})
  • Renamed dispatch_agent_for_worktreedispatch_pr_review_session
  • create_worktree_with_branch now returns worktree name

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions