Repository navigation
Description
Problem
When a user clicks the inline "Reference issue in architect" button on a Backlog row in a workspace with more than one architect, a QuickPick appears to choose the target architect. Whatever the user picks, the reference text (#<id> "<title>" ) is injected into architect:main, not the picked architect. From the user's perspective the picker is a no-op.
Single-architect workspaces are unaffected — no picker, everything correctly routes to main.
Root cause
Two independently-correct pieces layered wrong:
- Spec 786 Phase 6 (
packages/vscode/src/terminal-manager.ts:140docstring) intentionally defaultedinjectArchitectText'sarchitectNameparam to'main'to keep the Backlog inline button working without modification while sibling architects were being introduced. Documented explicitly as "the Backlog button always targetsmainregardless of how many sibling architects exist." - Issue 841 Gap 2 later added a QuickPick to
codev.openArchitectTerminal(packages/vscode/src/extension.ts:782) so that when the command is invoked with no name AND >1 architects exist, the user is prompted to choose.
The two changes cross wires. The codev.referenceIssueInArchitect command (packages/vscode/src/extension.ts:1019) invokes openArchitectTerminal with no argument (triggering the picker in the multi-architect case), then calls injectArchitectText(text) with no name (defaulting to main). The picker's selection is captured only for the "which terminal to open," never for "which terminal to inject into."
Concrete chain:
extension.ts:1029—terminalManager?.injectArchitectText(buildArchitectReferenceInjection(issueId, title))— no name argterminal-manager.ts:140—injectArchitectText(text: string, architectName: string = 'main')— defaults, injects intoarchitect:main- Same shape at
extension.ts:1041forcodev.referencePRInArchitect(PR sidebar mirror per vscode: Pull Requests sidebar inline action — reference PR in architect #1043)
Fix sketch
Two surgical changes:
-
codev.openArchitectTerminalreturns the resolved architect name. Currently returns void. Returnstring | undefined= the name that was actually opened (arg → picker → default). Keep the single-architect path returning that architect's name so callers can rely on the return value uniformly. -
codev.referenceIssueInArchitectandcodev.referencePRInArchitectawait the returned name and pass it through toinjectArchitectText(text, resolvedName). When the user cancels the picker (undefinedreturn), do not inject — matches the current "open failed" branch.
Optional third change (cleanup): update the terminal-manager.ts:140 docstring to note the Backlog button now honors the multi-architect picker, removing the "always targets main" claim which is no longer the design intent.
Scope
packages/vscode/src/extension.ts(openArchitectTerminal,referenceIssueInArchitect,referencePRInArchitect)packages/vscode/src/terminal-manager.ts(docstring only if adjusting for accuracy — no behavior change here)- Test updates in
packages/vscode/src/__tests__/extension-architect-commands.test.ts— the existing test "with no name → defaults to 'main'" (extension-architect-commands.test.ts:145) documents the old behavior and should be updated to the corrected behavior. Add a coverage case for "multi-architect: picker choice X → injects into architect:X."
Out of scope for this issue: the single-architect default behavior, PR sidebar semantics beyond the mirror injection, any other Backlog inline actions.
Related
- Sibling attribution bug:
afx workspace recoverrespawns builders with the shell's architect rather than the DB'sspawned_by_architect. Different code path, same "architects losing builder attribution" theme in the current release cycle.
Activity
amrmelsayed commentedon Jul 6, 2026
On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).
[PIR #1139] Plan draft
[PIR #1139] Honor QuickPick selection in architect reference injection
[PIR #1139] Thread: implement phase notes
[PIR #1139] Review + retrospective
[PIR #1139] Review: address consult findings (extension test steps, f…
[PIR #1139] Thread: review phase notes
changelog: Backlog Reference in architect honors QuickPick (#1139, PR #…
changelog: Backlog Reference in architect QuickPick fix — packages/vs…