feat(coder): the pull request pill shows the PR of the branch checked out in the agent's sandbox, recorded at turn end
Merged
DA
8d ago+268+268+012345678901234567890123456789-443-443-012345678901234567890123456789
What
Dean's rule: show whatever pull request is attached to the branch currently checked out in the agent's sandbox, whatever branches it switched through on the way. The agent keeps publishing exactly as today with git push and gh pr create; nothing of ours creates a PR.
- Read the branch at turn end.
coder/hooks/store.tsrunsgit branch --show-currentin the checkout as a turn ends, before the sandbox stop it already did. The host's newrecordBranchsaves the answer on the agent's row; a detached HEAD prints nothing and saves null. A read or write that fails is logged and the sandbox still stops. A turn that never opened the sandbox records nothing, as today. - One new nullable column,
coding_agent.branch, through migration0068andcoding-agent-schema.ts(drizzle-schema.test.tsholds it). published.tsreads the row. No branch, nothing to show. Otherwise the existingpullRequestOfBranchfor the PR with its checks, andbranchStandsfor the branch chip when there is no PR. The cache and its ended-key behaviour are unchanged.- The transcript scan is deleted whole:
publishedInTranscript,branchNamedIn,pullRequestNamedIn,allMessages,SCAN_PAGES, the regex constants, andtests/coder-host-published.test.ts.sameNameandpullRequestByNumberlose theirexportsince the scan was their only outside consumer. - The "opened #N" notification already reads the pull-request route, so it follows the row with no change of its own. README and PLANNING prose updated.
Tests
coding-agents-app.test.ts: the pull-request route answers the PR for the row's branch (with checks and the TTL), nothing when the row has no branch and GitHub is not asked, the branch chip when pushed with no PR, a fresh read at turn end, and the unreachable-repository refusal.coder-host.test.ts:recordBranchsaves the branch, saves null on a detached HEAD, and when git cannot answer it writes nothing and does not fail, so the stop after it runs.
Verification
./scripts/check.sh exits 0. No Mac UI change, so there is no verify.sh evidence and no screenshots: the change is server-side and the pill renders from the same wire answer as before. CI could not verify the Mac.
š¤ Generated with Claude Code