Link a PR opened from another checkout to its session - #925
Link a PR opened from another checkout to its session#925realtonyyoung wants to merge 2 commits into
Conversation
Only checkouts the agent mutated are probed: one it merely read must not have the PR its branch happens to carry attached. Only GitHub PRs are posted, because the server endpoint rebuilds the remote URL on github.com from owner and repo. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR Summary by QodoLink pull requests from secondary Claude checkouts
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1.
|
The final pass must finish inside the 5s the watcher is given before it is killed, with the drain-complete signal still to send. A watcher resumed past the server frontier never drains the lines that named an earlier checkout, so the collector replays the transcript at start. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes #923 — AI-2738
What & why
A session's PR list is fed by one probe,
gh pr viewin the launch cwd, so a PR the agent opened from a worktree it made itself — in another repository or the same one — never appears. The Claude session watcher now collects the roots of every checkout the agent mutated outside its launch cwd, probes each on the 60s refresh and once more on the final drain, and posts any GitHub PR it finds toPOST /api/sessions/{id}/pull-requests, which already dedupes and never repoints the primary repository.Where to look
Mutation paths only feed the collector: a checkout the agent merely read must not have whatever PR its branch carries attached. Non-GitHub hosts are skipped because the endpoint rebuilds the remote URL on github.com from owner and repo.
Verification
🤖 Generated with Claude Code