Repository navigation
Description
Summary
A Tower endpoint that relays canonical commands from a controller to the active
editor provider over Tower's existing SSE + REST transport (no new socket, no
project-file scanning). The relay is stateless and dormant until a controller
POSTs, so this is additive infrastructure.
Depends on #1087 (wire contracts).
Functionality
- Route:
/api/command(POST). SSE event:command(fanned to providers). - A controller POSTs
{ verb, args }; Tower validates the verb is present and
broadcasts it as acommandSSE event. The provider maps and allowlists the
verb (Tower stays a dumb relay — no allowlist, no execution, no per-controller
state). - Lazy, self-routing seam:
tower-routesdelegates/api/commandto the relay,
which initializes its broadcast dependency from the route context on first hit.
Acceptance
- A verb POSTed to
/api/commandreaches providers as acommandSSE event; a
verb-less body is rejected with 400. - Everything rides existing transport (no new socket); unit + e2e tests green.
Boundary
Tower holds no controller navigation state and no subscription/presence state —
the relay is a stateless pass-through. Zoom navigation (Tower -> builders ->
builder -> file) is the controller's own concern, driven by the overview API plus
controller-side cursor state, not by Tower.
Known limitation / follow-up (non-blocking)
/api/command inherits Tower's existing route posture: isRequestAllowed is
currently a permissive stub and the origin check is CORS-only, so the route is not
authenticated beyond what the rest of the Tower API already is. This is a
pre-existing, Tower-wide concern, but the command verbs raise the stakes (some are
privileged, e.g. spawn-builder / run-dev), and it is more exposed when the
tunnel/cloud path is active. Tracked as a separate Tower-auth follow-up; not a
blocker for this relay.
Activity
[-]Editor + command relay over Tower (/api/editor/*, /api/command)[/-][+]Command relay over Tower (/api/command)[/+]amrmelsayed commentedon Jun 21, 2026
Merged in #1091 (commit fd01505).
release notes: PR #1091 command relay + four new commands (post-v3.2.1)
feat: editor + command relay (Tower routes, VSCode provider, wire con…