PR remediation tasks blocked for reasons other than a moved head leave the PR with no owner
Maintainers usually reply within 1 day
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
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-failedormax-retriesposts one hand-back comment and assigns the opener; a test covers the listener. - A
worktree-busytimed pause and apr-head-movedblock 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from atomantic/PortOS
-
bug effort:medium model:light tests
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
area:cos-agents bug effort:low model:light plan planner:sonnet-5-5
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:federation bug effort:medium model:light plan planner:sonnet-5-5
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
musicVideoSceneHooks test can leak its temp root past afterAll and fail the suite's temp-leak guardOpenbug effort:medium model:light plan planner:sonnet-5-5 tests
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
area:cos-agents bug effort:high model:medium plan planner:sonnet-5-5
Difficulty 4/5 3-5 days Newbie friendliness 57/100
Maintainers usually reply within 1 day
All issues in atomantic/PortOS
Similar issues
-
bug priority: low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
sandialabs/sceptre-phenix#464 ·
Maintainers usually reply within 6 days
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
hemilabs/token-list#124 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
juice-shop/juice-shop#3702 ·
Maintainers usually reply within 1 day
-
🐛 BUG: Avatar stack on post card renders above the sticky header when scrollingPossibly taken @idoshamun claimed this today. OpenType: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dailydotdev/daily#2163 ·
Maintainers usually reply within 1 day