vscode: honor QuickPick selection in architect reference injection#1157
Merged
Conversation
codev.openArchitectTerminal now returns the resolved architect name (explicit arg, picker choice, or single-architect default); the two reference commands pass it through to injectArchitectText and skip injection when the picker is cancelled. Sentinel tests updated from the old always-main behavior.
…rontmatter rebuttal)
amrmelsayed
added a commit
that referenced
this pull request
Jul 8, 2026
amrmelsayed
added a commit
that referenced
this pull request
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIR Review: Backlog "Reference issue in architect" honors the QuickPick selection
Fixes #1139
Summary
In multi-architect workspaces, the Backlog row's "Reference issue in architect" button (and its PR-sidebar mirror) showed a QuickPick to choose the target architect but always injected the reference text into
architect:main, making the picker a no-op. The fix makescodev.openArchitectTerminalreturn the architect name it actually resolved (explicit arg, picker choice, or single-architect default), and both reference commands now pass that name through toinjectArchitectText. A cancelled picker skips injection silently instead of falling back to main.Files Changed
packages/vscode/src/extension.ts(+28 / -7):openArchitectTerminalreturnsPromise<string | undefined>; both reference commands capture and pass the resolved name, early-returning on undefinedpackages/vscode/src/terminal-manager.ts(+6 / -6): docstring only, removed the stale "the Backlog button always targets main" design claimpackages/vscode/src/__tests__/extension-architect-commands.test.ts(+36 / -11): replaced the sentinel that codified the old always-main behavior with return-contract, name-pass-through, and cancel-path sentinelspackages/vscode/src/__tests__/reference-pr-in-architect.test.ts(+19 / -0): mirrored sentinels for the PR-sidebar commandcodev/plans/1139-vscode-backlog-reference-issue.md(+65): plan artifactcodev/state/pir-1139_thread.md(+20): builder threadcodev/resources/lessons-learned.md: one new Architecture entry (see Lessons Learned Updates)Commits
8f34a761[PIR vscode: Backlog Reference issue in architect action ignores QuickPick selection (always sends to main) #1139] Plan draft2e0ca369[PIR vscode: Backlog Reference issue in architect action ignores QuickPick selection (always sends to main) #1139] Honor QuickPick selection in architect reference injectiondd29bbbe[PIR vscode: Backlog Reference issue in architect action ignores QuickPick selection (always sends to main) #1139] Thread: implement phase noteschore(porch): ...)Test Results
pnpm compile(tsc + tsc webview + eslint + esbuild): passpnpm test:unit(vitest): pass, 47 files, 547 tests (4 sentinel tests new or rewritten)dev-approvalgate, exercising the running worktreeArchitecture Updates
No arch changes: this PR fixes command wiring inside the VS Code extension (a return value threaded between two existing commands). No module boundaries, state, or cross-subsystem contracts changed. The
injectArchitectText'main'default remains for name-less callers.Lessons Learned Updates
One COLD-tier entry added to
codev/resources/lessons-learned.md(Architecture section): two independently-correct changes composed into this bug. Spec 786 Phase 6 deliberately defaultedinjectArchitectTextto'main'; Issue 841 Gap 2 later added a QuickPick upstream inopenArchitectTerminal. The picker's resolution was consumed for "which terminal to open" but never returned, so downstream consumers of the default silently kept the pre-picker behavior. The lesson: when adding an interactive resolution step in front of an API with a documented default, return the resolution and audit every consumer of that default.Nothing HOT-tier: the rule is narrow to command-composition inside the extension, not a behavior-changing cross-cutting invariant.
Things to Look At During PR Review
codev.openArchitectTerminalnow explicitlyreturn undefined(not connected, picker dismissed, architect not found, workspace-state fetch failure) so callers get a uniform contract.vscodemodule); they anchor on the new source shape rather than executing handlers.Consultation Findings and Dispositions (single advisory pass)
PIR runs one consultation pass with no automated re-review, so both codex findings are recorded here for the human at the
prgate:approved/validatedYAML frontmatter. Rebutted, no change made. The frontmatter rule (CLAUDE.md, "Approved specs/plans need YAML frontmatter") applies to artifacts the architect creates and approves onmainbefore spawning a builder, so porch can no-op the corresponding phase. This plan was authored inside the porch-driven PIR flow; its approval is structured porch state (plan-approvalgate approved, commit684f32dd, recorded instatus.yamlhistory). Addingvalidated: [gemini, codex, claude]would be factually wrong: PIR's plan phase is human-only review by design.How to Test Locally
This is a VS Code extension change, so the dev server alone does not load the modified bundle. To exercise the fix:
code .builders/pir-1139)..vscode/launch.jsonconfig). The pre-launch task builds the extension and an Extension Development Host window opens running the modified extension.cd packages/vscode && pnpm vsix, then install the generated.vsixvia the Extensions view ("Install from VSIX...") in your normal window, and reload.#<id> "<title>"lands in that architect's terminal, focused, not submittedmain: text lands in main