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
deriveAttention lists a PR-review lane twice in pendingGates (porch pr gate + prReady), so the Tower hub and Agents views show duplicate builder rows #1787
The Tower hub view in VS Code lists some builders twice under their workspace, with identical label and the PR icon on both rows. Observed 2026-10-05 by the owner: codev-cloud shows bugfix-15 · db-migrate runner silent… twice; shannon shows bugfix-6114 twice and bugfix-6116 twice. All of them are lanes in "PR review".
Cause
deriveAttention in packages/sdk/src/builder-helpers.ts pushes a builder into pendingGates twice when both signals are true at once:
A lane sitting at the porch pr gate with its PR open satisfies both: porch reports blocked with blockedGate === 'pr', and the forge reports prReady. The comment above the code says the two are "checked independently", and only the waiting list is guarded against double-listing (!atGate). pendingGates is not.
Every consumer of pendingGates renders the duplicate: the Tower hub (apps/vscode/src/views/tower.ts, attentionRows), the Agents view's blocked rows, the contextual panel, and any attention count built from pendingGates.length (urgency ordering counts the lane twice).
Fix shape
Dedupe in the sdk, once, so every surface agrees: when blockedGate === 'pr' and prReady are both true, emit one GateItem, keeping the porch row because it carries since. Keep both rows only when the porch gate is a different gate than pr (a lane can be at a spec gate while an earlier PR is awaiting review, which is a real two-row case). Add a deriveAttention test for the double-signal lane, and one for the hub rows.
Related
#1566 (Tower hub), #1672 (ball-owner module will re-express this; the dedupe should land before 1672 plans against pendingGates), #1595.
Verified against source. derivePrReady (overview.ts:439) is true exactly when the porch pr gate is pending with a requested_at and the PR is not merged, which is exactly the condition under which detectBlocked reports PR review / blockedGate === 'pr'. So the two signals are not independent for the pr gate: every lane sitting at it satisfies both, and deriveAttention (sdk builder-helpers.ts:139-144) pushes it twice. Only waiting has the !atGate guard.
Protocol: BUGFIX.
Fix shape (decided):
Dedupe once in the sdk, in deriveAttention: when builder.blockedGate === 'pr' and builder.prReady are both true, emit one GateItem, the porch row (it carries since, gateId: 'pr', label from blocked). When the porch gate is something other than pr (e.g. plan-approval) and prReady is also true, keep both rows: those are two different human actions. When only prReady is true (no porch gate reported, e.g. a soft-mode lane or a lane whose status.yaml is unreadable), keep the synthetic PR review row as today.
Fix the comment above the pushes; "checked independently" is what produced the bug.
Tests in packages/sdk/src/__tests__/builder-helpers.test.ts: pr gate + prReady → exactly one row with since set; plan-approval + prReady → two rows; prReady alone → one synthetic row; and an attention-count assertion (urgency ordering counts the lane once). A tower-provider.test.ts case asserting a single hub row for a pr-gated lane is cheap and pins the user-visible symptom.
Scope note: no consumer change should be needed because every surface reads pendingGates. If one turns out to dedupe locally already, remove that local dedupe rather than keeping two. Land before spir-1672 plans against pendingGates (vscode's request, agreed).
Activity
amrmelsayed commentedon Oct 5, 2026
Architect ruling (main)
Verified against source.
derivePrReady(overview.ts:439) is true exactly when the porchprgate ispendingwith arequested_atand the PR is not merged, which is exactly the condition under whichdetectBlockedreportsPR review/blockedGate === 'pr'. So the two signals are not independent for the pr gate: every lane sitting at it satisfies both, andderiveAttention(sdk builder-helpers.ts:139-144) pushes it twice. Onlywaitinghas the!atGateguard.Protocol: BUGFIX.
Fix shape (decided):
deriveAttention: whenbuilder.blockedGate === 'pr'andbuilder.prReadyare both true, emit oneGateItem, the porch row (it carriessince,gateId: 'pr', label fromblocked). When the porch gate is something other thanpr(e.g.plan-approval) andprReadyis also true, keep both rows: those are two different human actions. When onlyprReadyis true (no porch gate reported, e.g. a soft-mode lane or a lane whose status.yaml is unreadable), keep the syntheticPR reviewrow as today.packages/sdk/src/__tests__/builder-helpers.test.ts: pr gate + prReady → exactly one row withsinceset; plan-approval + prReady → two rows; prReady alone → one synthetic row; and an attention-count assertion (urgency ordering counts the lane once). Atower-provider.test.tscase asserting a single hub row for a pr-gated lane is cheap and pins the user-visible symptom.Scope note: no consumer change should be needed because every surface reads
pendingGates. If one turns out to dedupe locally already, remove that local dedupe rather than keeping two. Land before spir-1672 plans againstpendingGates(vscode's request, agreed).amrmelsayed commentedon Oct 5, 2026
On it! Working on a fix now.
Fix #1787: list a lane at the porch pr gate with an open PR once in p…
[Bugfix #1787] Key the PR-row dedupe on the porch row actually being …
docs(changelog): #1787 PR-review lanes listed once in attention views…