Skip to content

fix(babysit-pr): stop a failed first pr-wait run from replaying every old comment - #14

Open
ryoppippi wants to merge 1 commit into
t3dotgg:mainfrom
ryoppippi:fix/pr-wait-failed-baseline
Open

ryoppippi wants to merge 1 commit into
t3dotgg:mainfrom
ryoppippi:fix/pr-wait-failed-baseline

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Nov 3, 2026 •

Copy link
Copy Markdown

If the first pr-wait run for a PR stops before its first poll completes (a non-transient gh error, or GitHub unreachable for 10 polls), the next run prints every existing comment, review and thread on the PR as new. On one real PR that replayed about 35 old review threads at once.

The cause: the first run is meant to be a silent baseline, but finish() always saved state, so the failed run left a file with an empty reported set and the next run skipped the baseline. Now finish() saves during a baseline only once a poll has recorded the PR's events; otherwise the next run simply baselines again. A baseline poll that did record everything and then stops (failed required check, DIRTY branch) still saves, so a rerun after fixing it still reports comments that arrived in between.

Reproduced by stubbing fetch_pr to raise a non-transient GhError on the first run, then running a real poll on an open PR with comments: before, the second run printed every existing comment; after, it baselines silently.

Created with Claude Opus 5.5 in Claude Code & T3 code

…omments

The first run for a PR is a silent baseline: it records the comments,
reviews and threads that already exist and reports only later ones. But
finish() always saved state, so a first run that stopped before a poll
completed (a non-transient gh error, GitHub unreachable for
MAX_FAILED_POLLS, or the PR found closed) wrote a state file with an empty
or partial reported set. The next run loaded it, skipped the baseline, and
printed every existing comment and review thread as a new event.

Save from finish() during a baseline only once a poll has recorded the
PR's events. A baseline that did not get that far leaves no state, so the
next run baselines again. A baseline poll that did record everything and
then stops (a failed required check, a DIRTY branch) still saves, so a
rerun after the fix reports comments that arrived in between.
ryoppippi added a commit to ryoppippi/dotfiles that referenced this pull request Nov 3, 2026
…ping

Skipping the save for every baseline run also dropped one that had
recorded every comment and then stopped on a failed check or a DIRTY
branch, so the rerun after the fix baselined again and silently lost
comments posted in between. Save once a poll has recorded the PR, as
proposed upstream in t3dotgg/tstack#14.
ryoppippi added a commit to ryoppippi/dotfiles that referenced this pull request Nov 4, 2026
… copies

The local babysit-pr, takeover, full-send, full-stop and modernize were
near-verbatim copies of t3dotgg/tstack, so every upstream fix had to be
ported by hand, and pr-wait was being rewritten in another language only
to avoid maintaining Python we did not write. Pinning tstack in the skill
registry installs the upstream skills directly; its pr-wait needs only
the system python3 and gh.

leaving-pr-comments comes along because babysit-pr, takeover and
modernize name it. tstack's file-pr and sol-loop are not installed, as
create-pr and review-loop cover them here, so a transform renames those
references.

The upstream pr-wait still replays existing comments after an
interrupted baseline until t3dotgg/tstack#14 lands.
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