Skip to content

vscode: add Send Message to Architect Quick Pick (or fold architects into Send Message) #950

@amrmelsayed

Description

@amrmelsayed

Problem

The VSCode extension has Codev: Send Message — a Quick Pick that lets you pick a builder and send it a free-text message (the in-IDE equivalent of afx send <builder-id> "..."). There is no equivalent for sending a message to an architect.

Today the only architect-targeted commands are Codev: Open Architect Terminal (opens the terminal so you can type into it) and Codev: Reference Issue in Architect (a narrow issue-reference helper). Neither is a pick-and-send-message flow. To send an architect a free-text message without opening its terminal, you have to drop to the CLI:

afx send architect "..."
afx send architect:<name> "..."

This is asymmetric: builders are messageable from the palette, architects are not. It also matters more now that workspaces can host sibling architects (afx workspace add-architect --name <name>) — there can be several architects to address, and the CLI is the only UI for it.

Current state (audit)

  • packages/vscode/src/commands/send.tsCodev: Send Message. Picker is sourced only from state.builders (filtered to those with a live terminal). Architects are never added. Sends via client.sendMessage(picked.id, message, { workspace }).
  • DashboardState already carries architects: state.architects: ArchitectState[] (packages/types/src/api.ts), each with a stable name ('main', 'architect-2', or a custom name) and an optional terminalId. So the data is already on the wire — no server/type change needed to list architects.
  • client.sendMessage(to, message, opts) takes an opaque to address string. For an architect the address form is architect:<name> (or bare architect for the default). Tower's /api/send already resolves these forms (see the addressing-grammar table in CLAUDE.md / tower-messages.ts).

Proposed change (pick one — design decision for the architect)

Option A — new dedicated command Codev: Send Message to Architect. Its own Quick Pick over state.architects, rows labelled by architect name (e.g. main, ob-refine). Sends via client.sendMessage('architect:' + name, ...). Symmetric with the builder command; keeps each picker single-purpose. Likely also wants a keybinding sibling to Send Message's Cmd+K D.

Option B — fold architects into the existing Codev: Send Message picker. One unified picker showing builders and architects, visually grouped (e.g. an Architects / Builders separator, or description tags). Fewer commands, one mental model ("message any agent"), but it widens the existing command's data source and addressing logic (builder → picked.id; architect → architect:<name>).

(Recommend the issue be sized as PIR or at least plan-reviewed — it's design-sensitive: it changes a picker's data source and introduces architect addressing into the UI, where the CLI's spoofing/affinity rules are subtle. Not a pure mechanical fix.)

Addressing nuance to get right

  • From the VSCode UI the sender is the human-driving-the-workspace, so addressing any architect by architect:<name> should be allowed (the spoofing check in tower-messages.ts constrains builders addressing architects, not architect-context senders). The implementation should confirm which from identity the extension's sendMessage uses and that it isn't subject to the builder spoofing rejection.
  • Decide what to do in a single-architect workspace: if there's only main, skip the picker and message it directly (like the builder picker auto-handles a single match? — verify), or always show the one-row picker for consistency.

Acceptance

  • A palette command exists to send a free-text message to an architect, picking by architect name.
  • In a sibling-architect workspace, all architects are selectable and the message routes to the chosen one.
  • Message delivery matches afx send architect:<name> "..." (same routing, same destination session).
  • No regression to Codev: Send Message (builders) or to Codev: Open Architect Terminal.
  • (If Option B) builders and architects are visually distinguishable in the unified picker.

Out of scope

Notes

Surfaced while reviewing #925 (which fixes the label format of the two builder pickers). #925 stays surgical and does not touch architect targeting; this issue tracks the architect-side gap separately.

Label: area/vscode.

Metadata

Metadata

Assignees

Labels

area/vscodeArea: VS Code extension

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions