Repository navigation
feat(vscode): Architects tree — Add Architect UI, Cmd+K A picker, label casing #841
Description
Context
Spec 786 landed an Architects tree under the Workspace view that shows every registered architect for the current workspace (main plus any siblings added via afx workspace add-architect --name <name>), with right-click Remove on siblings and live-refresh on the architects-updated SSE event. Three follow-up gaps remain.
Gap 1 — No "Add Architect" UI affordance
Today, registering a sibling architect can only be done from the CLI:
afx workspace add-architect --name ob-refineThere is no codev.addArchitect command, no "+" button on the Architects tree title bar or row, no QuickPick name prompt anywhere in the extension. A code comment at packages/vscode/src/views/workspace.ts:57 explicitly acknowledges the gap ("codev.removeArchitect (and any future codev.addArchitect UI) can call .refresh() after mutating Tower").
Suggested fix. Add a codev.addArchitect command + a Workspace view affordance to trigger it:
- A title-bar
+action on the Architects parent row, or an inline "+ Add Architect" row underneath the architect children - QuickPick (or
vscode.window.showInputBox) to prompt for the architect name; validate via the same rule Tower uses (validateArchitectNamerejectsmainand other reserved names) - On success, call
client.addArchitect(workspacePath, name)and let the existingarchitects-updatedSSE refresh re-render the tree
Gap 2 — Cmd/Ctrl+K A always defaults to main
codev.openArchitectTerminal accepts an optional architectName argument (extension.ts:405), and Architects tree rows correctly pass the name on click. But no-arg invocations (keyboard shortcut Cmd/Ctrl+K A and Command Palette → "Codev: Open Architect Terminal") always default to main (extension.ts:415). When the workspace has siblings registered, there's no keyboard-driven way to pick a non-main architect — you must click the row in the sidebar.
Suggested fix. When codev.openArchitectTerminal is invoked with no argument and the workspace has N > 1 architects, show a QuickPick listing all of them (alphabetical, main first) and open the picked one. When N == 1, preserve today's behavior (open main directly, no picker). The QuickPick can reuse the same client.getWorkspaceState(workspacePath) call already made at line 417.
Gap 3 — Lowercase main breaks the Workspace view label convention
Every other row in the Workspace view uses Title Case for the visible label:
- Open Architect / Open Web Interface / Spawn Builder / New Shell / Start Dev Server / Stop Dev Server
- Parent: Architects, Open Dev URL rows (user-defined labels, also typically Title Case)
But the architect child rows render the raw architect name verbatim — for the default architect, that's main (all lowercase). It visually stands out as the only lowercase row in the entire Workspace tree, breaking the convention.
Suggested fix. Render the display label in Title Case while keeping the internal architect name (the identifier passed to openArchitectTerminal / removeArchitect) unchanged. Decide:
- Option A — Display-only capitalization.
Main(capitalize first letter); siblings render as the user typed them (e.g.ob-refinestaysob-refine). Minimum-change, but mixed casing across rows. - Option B — Display name field. Tower exposes a
displayNamealongsidename; the extension rendersdisplayName ?? capitalize(name). Requires a Tower API addition; gives users control over how their architects appear in the sidebar.
In either case, the internal identifier (main etc.) must stay lowercase because it's referenced everywhere (validateArchitectName, the architect:<name> send-message form, builder spawn affinity).
File to change. packages/vscode/src/views/workspace.ts:269 (new vscode.TreeItem(name) → wrap name in a display-name helper).
Out of scope (track separately if needed)
- Multi-architect support for
Codev: Send Message(the no-arg flow may not surface sibling architects as targets). - Health / running-status indicator on architect rows.
- Cross-workspace architect handling (per Bugfix CRITICAL: Sibling architects leak across workspaces — launchInstance reconcile reads global state.db.architect without workspace filtering #826, each workspace's architects are independent — already correct).
Acceptance
- A user can register a new sibling architect entirely from the VS Code extension UI, without dropping to the CLI.
Cmd/Ctrl+K Acorrectly handles single-architect (opensmaindirectly) and multi-architect (picker) workspaces.- The Architects tree rows visually match the casing convention of the rest of the Workspace view.
Related
- Spec 786 (multi-architect lifecycle + Workspace view Architects tree — already landed)
- Spec 823 (
architects-updatedSSE event — already landed) - Bugfix CRITICAL: Sibling architects leak across workspaces — launchInstance reconcile reads global state.db.architect without workspace filtering #826 (workspace-scoped state — already landed; prerequisite for any add-architect flow)
Discovered while
Inventorying the multi-architect surface in the extension during the README revision pass (see docs/vscode-readme-revision branch).
Activity
[-]feat(vscode): multi-architect support in the extension[/-][+]feat(vscode): Architects tree — Add Architect UI, Cmd+K A picker, label casing[/+]amrmelsayed commentedon Jun 19, 2026
On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).
[PIR #841] Plan draft
[PIR #841] Plan revised: UPPERCASE architect labels
[PIR #841] Relocate architect-name validator to codev-core (shared si…
[PIR #841] Add Architect UI, Cmd+K A picker, UPPERCASE architect labels
[PIR #841] Tests for add-architect, picker, and label casing
[PIR #841] Update builder thread
[PIR #841] Review + retrospective
[PIR #841] Update builder thread (pr gate)
release notes: #841 Add Architect UI + Cmd+K A picker (PR #1082)
Merge docs/vscode-changelog for v3.2.1 Karnak release