Skip to content

fix(review): signal-safe cleanup + triage suffix for PR feedback#914

Merged
backnotprop merged 1 commit into
mainfrom
fix/review-qa-followups
Jun 13, 2026
Merged

fix(review): signal-safe cleanup + triage suffix for PR feedback#914
backnotprop merged 1 commit into
mainfrom
fix/review-qa-followups

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Two QA follow-ups found while validating the release. Both are small, both touch the review feedback path, and neither belongs in the in-flight Cursor PR (#912), so they're bundled here.

1. Signal-safe cleanup (lifecycle)

apps/hook/server/index.ts registers its background-PR-checkout cleanup (kill warmup children, git worktree remove/prune, session unregister) on the "exit" event — which does not fire on SIGINT (Ctrl-C) or SIGTERM. So aborting a review mid-checkout leaked clone/fetch children and stale git worktree registrations.

Fix: route SIGINT/SIGTERM through process.exit() so the existing handlers run. Uses once, so a second signal still force-quits if cleanup ever hangs. The change is scoped to the standalone hook binary only (OpenCode/Pi run in-host and must not call process.exit).

2. Triage suffix now reaches PR-mode feedback

The review-denied suffix (getReviewDeniedSuffix — "triage it, verify against the code, don't change anything until we discuss") was gated behind !isPRMode, so every PR review skipped it. That gate predates the suffix-unification work — the content was unified across runtimes, but the PR-mode exclusion was never revisited.

Root cause: isPRMode was a blunt proxy. In PR mode there are two approved:false outcomes:

  • Send Feedback → annotations go to the agent → should get the suffix
  • Platform PR action (approve/comment posted to GitHub/GitLab) → status message, empty annotation set → should not

Fix: gate on result.annotations.length > 0 instead of !isPRMode. Genuine feedback always carries annotations; platform actions always send []. Now the suffix is appended for PR and local feedback, and never onto a platform status message. Applied consistently across hook, OpenCode, and Pi.

Verification

  • bun test — 1434 pass / 0 fail
  • Pi + server typecheck clean (bunx tsc -p ...)
  • build:opencode compiles
  • Pi isPRReview local removed (now dead)

🤖 Generated with Claude Code

Two QA follow-ups found while validating the release:

- Route SIGINT/SIGTERM through process.exit() so the existing "exit"
  handlers actually run on Ctrl-C / termination. A signal death
  previously skipped them, leaking background PR-checkout warmup
  children and stale `git worktree` registrations. A second signal
  still force-quits if cleanup hangs.

- Append the review-denied triage suffix for PR-mode feedback, not just
  local diffs. The old `!isPRMode` gate suppressed it for every PR
  review. Gate on whether the reviewer actually sent annotations
  instead: genuine feedback always carries annotations, while platform
  PR actions (approve/comment posted to the host) return an empty
  annotation set + status message and correctly get no suffix. Applied
  consistently across hook, OpenCode, and Pi.
@backnotprop backnotprop merged commit 6c64b96 into main Jun 13, 2026
13 checks passed
@backnotprop backnotprop deleted the fix/review-qa-followups branch June 13, 2026 23:29
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