Repository navigation
Description
From the Oct 11–16 2026 Run retrospective, finding 10. Tracking issue: #721.
The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.
Requested outcome and validation
Check the PR lifecycle after every Repair and during CI polling. Stop obsolete work promptly for a merged or closed PR, and handle a PR converted to draft according to the existing Delivery contract without continuing to wait as if it were ready. Surface the actual terminal/gated state and preserve the Run's truthful outcome.
Add matching session stop rules: check whether the PR remains actionable before additional validation, pushes, or PR edits; if merged or closed, stop and report it. When a Repair changes no code, do not create an empty commit or push merely to satisfy its prompt. Preserve necessary pushes of real changes, including reconciled upstream commits.
Validate PR transitions during a CI watch and during a Repair, including branch deletion by merge. No later push may recreate a branch deleted at merge, and no merged PR should gain stale review/body edits. Preserve failure information rather than treating a closed or drafted PR as a successful merge.
Related: #712 is the competing-writer cause; finding 2 covers empty-tree Review Repairs; #102 covers unchanged-head CI-fix termination. This lifecycle protection also matters when a human merges a PR during a Run.
Original finding, including evidence, proposed fixes, and confidence
10. Sessions have no stop rules when the work is moot (Factory)
- Evidence:
- The CI-fix Repair prompt says "Run the affected checks locally, commit, and push" with no condition. agy sessions fail on agy 1.3.3: pass the prompt as -p's value #658 repair-4 proved the failure was a flake on an identical tree, then ran a 17-min suite and pushed. That push recreated the branch GitHub had deleted at merge.
- Tickets keep their repository from the sub-issue graph to the Run #672 implement kept polling for 12 min after reading
"state":"MERGED". - Delivery checks the PR's state only at the end. It waited 8.6 min on CI for a merged PR (agy sessions fail on agy 1.3.3: pass the prompt as -p's value #658) and 10 min for a drafted one (load the sections of https://thirdshift.app/prompts/ closed and let the user toggle them open/closed #666).
- Fix:
- Prompts: "If you change no code, don't push." "If the PR is merged or closed, stop and say so."
- Delivery: check that the PR is open and ready after each Repair and on each CI poll.
- Confidence: high. Most cases came from the race, but a Day-shift merge hits the same paths.
Activity
JacobStephens2 commentedon Oct 17, 2026
Agent Brief
Category: bug
Summary: Stop obsolete Delivery and Repair work promptly when its PR becomes merged, closed or draft.
Current behavior: PR readiness is checked after Repair/CI rounds, while the CI watch itself only observes checks. Sessions and later orchestration steps can continue validation, pushes or PR edits after the PR is no longer actionable. The historical report records a push recreating a branch deleted at merge; this triage confirmed the relevant code gaps without rerunning that incident.
Desired behavior: Revalidate the selected PR's lifecycle during CI polling and around Repair/session completion before further mutations. A merged or closed PR ends obsolete work promptly, naming the actual state and preserving a truthful result; an externally merged PR must not be described as a factory Self-merge. A PR changed to draft follows the existing readiness/failure contract rather than continuing CI as ready. Give sessions matching stop guidance before further validation, pushes or PR edits. When a Repair makes no code change, do not create an empty commit or push solely to satisfy its prompt; still push genuine changes, including necessary upstream reconciliation.
Key interfaces: Delivery, Repair-loop and CI-watch boundaries must share the selected PR identity/lifecycle outcome. The session/Repair instructions must use the same stop contract. Existing failure preservation, Claims and notification outcomes remain truthful.
Acceptance criteria:
Out of scope: Solving cross-machine Claim races (#712), automatically reopening PRs, bypassing CI/reviews, or merging an incomplete/draft PR.