You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
afx spawn: open-PR collision guard counts merged PRs since #1619 widened pr-search to --state all #1637
Symptom (field report, peer workspace, 2026-09-05 on 3.3.3)
afx spawn for an issue refused with "Found N open PR(s) referencing issue #X" where the referenced PRs were merged, forcing --force after manual verification. Reported occurrence: spawning for their issue 4750 tripped on merged PRs 4747/4766.
Root cause — a #1619 side effect (3.3.3 regression)
The spawn collision guard (spawn-worktree.ts:590 area, "Check for open PRs referencing this issue") calls the pr-search forge concept and treats every result as an open PR.
PR #1619 (shipped in 3.3.3) deliberately changed pr-search to --state all so consult --type pr could find merged PRs (#759). Correct fix for consult — but the spawn guard consumed the same concept and inherited merged/closed PRs into its "open" count.
Compounding detail: scripts/forge/github/pr-search.sh outputs only number,headRefName,baseRefName — no state field — so the guard cannot filter client-side today.
Fix
Add state to the pr-search JSON fields (github + gitlab scripts, and the PrSearchResult contract if typed), and have the spawn guard filter to state == "OPEN" before counting. Keep --state all in the script — consult needs it; the guard filters. A regression test pairing the two consumers (consult wants merged visible, spawn guard ignores them) would pin the contract so the next state-filter change can't whipsaw one consumer again.
Origin
Reported by a peer workspace's security architect with --force + manual-verification workaround; same report also carried #1567 delivery-truncation specimens (tracked there, not here).
Activity
amrmelsayed commentedon Sep 10, 2026
On it! Working on a fix now.
Fix #1637: spawn open-PR collision guard filters to OPEN state
[Bugfix #1637] Add builder thread log
[Bugfix #1637] CMAP: harden gitlab exit status and blank-state fallback
[Bugfix #1637] Thread: record PR phase + CMAP verdicts
[Bugfix #1637] Fix CI: declare glab as gitlab pr-search executable (#…
[Bugfix #1637] Thread: record CI #1645 fix
team: tower-cron hourly update (builder #1637 spawn)
[Bugfix #1637] gitlab: map locked MR state to OPEN (err toward safety)
[Bugfix #1637] Thread: provider audit + locked-state decision
[Bugfix #1637] gitlab: map iid/source_branch/target_branch to PrSearc…
[Bugfix #1637] Thread: record gitlab field-mapping fix
Merge pull request #1673 from cluesmith/builder/bugfix-1637