Skip to content

fix: recover terminal PR inspection and orphaned Pi agents - #247

Merged
michael-denyer merged 2 commits into
mainfrom
fix-terminal-pr-and-orphan-recovery
Oct 9, 2026
Merged

michael-denyer merged 2 commits into
mainfrom
fix-terminal-pr-and-orphan-recovery

Conversation

@michael-denyer

@michael-denyer michael-denyer commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

A closed or merged PR with a deleted base branch made ship-pr inspect return unavailable. A restored Pi orphan could remain impossible to stop or resume after a temporary process-inspection failure.

  • Preserve inspection of terminal PRs using their stored base OID when the branch is gone. Open PRs still require the current base target, and cancellation still returns not-open before any mutation for terminal PRs.
  • Retry orphan cleanup after identity inspection recovers, including when inspection failed at the delayed SIGKILL check. Only one termination attempt runs at a time, each signal checks process identity, and continuation remains blocked until the previous process exits.
  • Add CLI regressions for closed and merged PRs and real-process regressions for both inspection-failure windows. The fixes are in separate commits.

Validation:

  • bun test tests/ --timeout 30000: 1,191 passed, 36 skipped, 0 failed.
  • bun test orch watch-pr in the scripts directory: 234 passed, 0 failed.
  • PSTACK_PI_LIVE=1 bun test tests/pi/live.test.mjs: 11 passed, 0 failed using real Pi processes and model calls at 43149cf.
  • Pi and script TypeScript checks, script formatting, generated-file checks, and diff checks passed.
  • All 14 GitHub CI and security checks passed.
  • The read-only ship-pr inspect --repo michael-denyer/pstack-claude --pr 196 command now returns an inspected closed record. It failed before the fix.
  • Independent standards and specification reviews found no remaining issues. The reviewers also reran the delayed-escalation reproduction successfully.

No version bump; these fixes ship with the next release.

@michael-denyer
michael-denyer marked this pull request as ready for review October 9, 2026 13:28
@michael-denyer
michael-denyer merged commit bb5501b into main Oct 9, 2026
14 checks passed
@michael-denyer
michael-denyer deleted the fix-terminal-pr-and-orphan-recovery branch October 9, 2026 13:31
@michael-denyer michael-denyer mentioned this pull request Oct 9, 2026
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