Skip to content

Count cloud-agent PRs and refuse truncated searches in sprint planning - #252

Merged
haacked merged 3 commits into
mainfrom
haacked/sprint-planning-bot-prs
Oct 21, 2026
Merged

haacked merged 3 commits into
mainfrom
haacked/sprint-planning-bot-prs

Conversation

@haacked

@haacked haacked commented Oct 20, 2026

Copy link
Copy Markdown
Owner

The sprint-planning retro undercounted shipped work in two ways. fetch-team-prs.sh searched only by author, so it missed every PR a cloud agent opened, since posthog[bot] is the author and the person who started the agent is the assignee. For the Oct 5 to 16 sprint it returned no PRs for a teammate who merged 9, all of them agent PRs. It also capped the search at 50 results without a warning, so a member with 77 merged PRs got 50. fetch-approved-prs.sh had the same silent cap at 100, and Step 5 of the skill credited In Review and Approved items to the PR author, which dropped agent PRs from the plan.

fetch-team-prs.sh now runs a second search for app/posthog PRs assigned to the member and merges the two results. I matched on assignee because all 436 agent PRs merged org-wide in that window were merged by trunk-io, so the merger never names the person. A new search-prs.sh runs both scripts' searches at GitHub's 1000-result ceiling and exits non-zero when a search fills it, since gh search prs reports no total. Step 5 now credits In Review and Approved items to their board assignees, as the --status flow already does. The --approved list still shows "by @PostHog" for agent PRs. That affects display only and is not changed here.

Test plan

  • python3 -m pytest -q in ai/skills/sprint-planning/scripts passes (61 tests).
  • Against GitHub for Oct 5 to 16, the script returns 9 PRs for the teammate who had 0, and 79 (77 authored plus 2 agent PRs) for the member who had 50.
  • With PR_SEARCH_LIMIT=20, a real search exits 1 and reports the truncation.

fetch-team-prs.sh also returns PRs that posthog[bot] authored and
assigned to the member. A shared search-prs.sh runs gh search prs at
GitHub's 1000-result ceiling and exits non-zero when a search fills
it. fetch-approved-prs.sh uses the same helper. Step 5 credits In
Review and Approved board items to their board assignees.
@haacked
haacked merged commit 6f30fc5 into main Oct 21, 2026
1 check passed
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