Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PR remediation tasks blocked for reasons other than a moved head leave the PR with no owner

Closed
#12,523 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@atomantic is already working on this.

Since Oct 20, 2026.

  • #12652 by @atomantic — merged

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js

Research direction

Start with server/services/prRemediationFollowUp.js and server/services/issueWatcher.js, then trace the tasks:changed block listener and the existing handBackPrRemediation path. Check how TIMED_COOLDOWN_BLOCKED_CATEGORIES and pr-head-moved are handled, and add listener coverage for the stated cases. Done means terminal worktree-failed and max-retries blocks hand back once, while timed worktree-busy and pr-head-moved do not hand back again.

Written by the indexing model from the issue text.

Description

bug effort:medium model:medium plan

Problem

A PR-remediation task (server/services/prRemediationFollowUp.js) that gets blocked for any reason other than a refused pinned attach leaves its pull request with no owner.

applyPullRequestHandback in server/services/issueWatcher.js records the PR as REMEDIATE with the task id and skips re-dispatch for the same head SHA. If workspace prep then blocks that task as worktree-failed (for example, the head branch stays held by a dirty leftover tree until the worktree-busy budget runs out, or a fork fetch fails), or the agent run ends max-retries, nothing comments on the PR or assigns its opener. orphanedPrNotifier.js only watches reviewLoopPRUrl, so remediation blocks do not raise a card either. The PR then sits with neither PortOS nor its author working it until the contributor pushes again.

#12486 added handBackPrRemediation for the pinned-head refusal only (refusePinnedAttach in server/services/agentWorkspacePrep.js).

Expected: any terminal (non-timed) block of a remediation task hands the PR back to its opener exactly once.
Actual: only the pr-head-moved block does.

Decided fix

Have notifyIfPrLeftOrphaned (or a sibling listener on the same tasks:changed block transition) call handBackPrRemediation({ task, workspacePath: app repo path }) when task.metadata.prRemediationFollowUp is set, the block category is not in TIMED_COOLDOWN_BLOCKED_CATEGORIES, and it is not pr-head-moved (already handed back). Keep it once per task by stamping metadata.prRemediationHandedBackAt.

Acceptance criteria

  • A remediation task blocked worktree-failed or max-retries posts one hand-back comment and assigns the opener; a test covers the listener.
  • A worktree-busy timed pause and a pr-head-moved block do not post a second hand-back.

model:medium / effort:medium: one listener plus a once-per-task stamp across two files, no compatibility design.

Found while fixing #12486.

Dominant language
JavaScript
Stars
38
Forks
32
Avg merge
35m
Merged PRs (30d)
993

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomantic/PortOS

All issues in atomantic/PortOS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.