Repository navigation
feat(pr): attribute PR work honestly and show one shot, review runs and follow-ups - #1733
Merged
Merged
Conversation
A subagent run folded into whatever PR its parent's last pr-link carried, so review runs for #1703, #1712, #1728 and #1729 landed on a stale closed #24. The Agent description ("Review PR 1729 ...") is now read from the subagent's .meta.json at report time; a single PR it names outranks the carried PR.
Every PR row carried the whole session's first and last timestamp, so one long orchestrator session stamped the same span and "1 session" on all of them. Rows now span their first to last attributed turn or folded run, and a new `runs` field counts contributing sessions plus folded subagent runs.
…nd cost split per PR Each PR row now carries signals read from cached commands, no GitHub calls: openedAt (gh pr create paired with the PR's first pr-link), follow-up rounds (pushes naming its --head branch, or from a run whose description names it, in 10-minute bursts), oneShot only when the open and its branch were seen, reviewRuns and reviewCostUSD, mergedAt and timeToMergeMs, a build/review/fixes cost split that sums to the row, and linkEvidence to flag pr-link-only rows.
… review runs The why view now carries prWork: each gh pr create whose output printed a PR URL, the pushes after it on its --head branch (or from a helper whose description names that PR) in 10-minute rounds, and the helpers that read a PR without committing or pushing, with their cost.
Each PR card gets one line of facts from the CLI's local signals: the review run and its cost, one shot or follow-up rounds, and merge time after open. Unknowns are left out; a pr-link-only row says so. The count shows agent runs instead of sessions. The expanded card splits spend into building, review runs and after first review, and lists the review runs. The session view lists the PRs it opened and the review runs it spawned.
Every report, status and menubar refresh read each subagent's .meta.json (about 2,000 files in 30 days) and the cross-provider correlation scanned every folded run's commands for PR signals it never uses. Sessions now carry the sidecar path; the description is read on demand, memoized by mtime, only for folded runs and runs that push, and correlation skips the command scan. The by-pr footer now counts runs to match the Runs column.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull requests view: honest attribution plus what each PR actually took.
Attribution fixes (money moves between PRs, totals unchanged):
runscounts contributing runs instead of "1 session".New per-PR fields (local only, no GitHub calls), each with an unknown state:
oneShot/followUpRounds(pushes aftergh pr create, 10-minute bursts; contributor PRs show "your follow-ups: N"),reviewRuns(a run that read the PR and committed nothing, orgh pr review N) with cost,mergedAt/timeToMergeMs,costSplit(building / review runs / after first review, sums to cost),linkEvidence("linked by pr-link only"). Session why gets aprWorkblock.Desktop: one facts line per PR card ("Reviewed by Opus 5.5 run ($1.40) · Your follow-ups: 1", "One shot"), "N runs", a by-phase split and review runs when expanded, a "PR work" panel in the session view; 6 locales.
Checked against GitHub (read-only): one-shot and round counts agree on 13/13 PRs where the open and head were seen. Limits: failed pushes still count; opens/merges run through scripts or shell variables show as not seen; "after first review" can include work after the merge.
Verified: 7 new pr-insights tests (fail before / pass after), 38 parser/sessions/session-why/attribution files 458 passed, renderer PullRequests 28, SessionView 11, i18n 12; full suite 5,128 passed in the integration run. Speed: subagent descriptions are read only for PR attribution, memoized per file; report at parity with main (4.117 s vs 4.100 s warm); a full uncached menubar payload is ~0.3 s slower because it now computes the PR card signals.