Skip to content

Commit c5e9b13

Browse files
committed
[Spec 0602] Auto-start Tower on activation, never auto-stop
- Extension runs afx tower start as detached process if Tower not responding - Never auto-stops Tower — daemon outlives VS Code so builders keep running - Add codev.autoStartTower setting (default: true) - Resolve open question: auto-start vs manual start
1 parent 12ab32d commit c5e9b13

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

codev/specs/0602-vscode-extension.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Users can use the browser dashboard, the VS Code extension, or both simultaneous
132132
### Business Constraints
133133
- Must not break existing browser dashboard users
134134
- Minimal additional maintenance burden — share API layer, not UI code
135-
- Extension must work with Tower running independently (`afx tower start` still required)
135+
- Extension auto-starts Tower if not running (detached daemon, never auto-stopped)
136136

137137
## Assumptions
138138
- Tower server is running on localhost:4100 (or port from `.codev/config.json`)
@@ -522,6 +522,7 @@ Environment-agnostic Tower API client shared between dashboard and extension:
522522
| `codev.workspacePath` | string | auto-detect | Override workspace path for Tower matching |
523523
| `codev.architectTerminalPosition` | `"editor"` \| `"panel"` | `"panel"` | Where to open the architect terminal |
524524
| `codev.autoConnect` | boolean | `true` | Connect to Tower on activation |
525+
| `codev.autoStartTower` | boolean | `true` | Auto-start Tower if not running on activation |
525526
| `codev.telemetry` | boolean | `false` | No telemetry collected. Extension respects VS Code's global telemetry setting. |
526527

527528
## Default Keyboard Shortcuts
@@ -546,7 +547,8 @@ Additional commands available via Command Palette but without default keybinding
546547
| State | Behavior |
547548
|-------|----------|
548549
| **Activation** | On `codev.*` command or workspace contains `codev/` directory. Lazy — no heavy init until needed. |
549-
| **Tower not running** | Status bar shows offline. Commands show "Tower is not running — start with `afx tower start`". TreeView shows empty state. |
550+
| **Tower not running** | If `codev.autoStartTower` is true: run `afx tower start` as a detached process, then connect. If false or start fails: status bar shows offline, commands prompt to start manually. **Never auto-stop Tower** — it's a daemon that outlives VS Code so builders keep running. |
551+
| **Tower already running** | Health check succeeds on activation → connect immediately. Handles the case where another VS Code window or manual `afx tower start` already launched it. |
550552
| **Tower starts** | Health check succeeds → SSE connects → TreeView populates → status bar updates |
551553
| **Tower restarts** | SSE drops → reconnection with backoff → terminals print reconnecting banner → WebSockets reattach → ring buffer replay |
552554
| **VS Code reload** | Extension re-activates → reconnects to Tower → re-creates terminal Pseudoterminals → reattaches to existing shellper sessions |
@@ -561,7 +563,7 @@ Additional commands available via Command Palette but without default keybinding
561563
- [ ] Should `afx open` use a VS Code URI scheme (`vscode://codev/open?file=...`) or a filesystem watcher approach? This is a core architectural decision — URI scheme works cross-process, filesystem watcher is fundamentally different.
562564

563565
### Important (Affects Design)
564-
- [ ] Should the extension auto-start Tower if it's not running, or always require manual start?
566+
- [x] Should the extension auto-start Tower if it's not running? **RESOLVED: Yes.** Auto-start as detached process, never auto-stop. Setting `codev.autoStartTower` (default: true) for manual control.
565567
- [ ] Terminal naming convention: `Architect` / `Builder #42 [implement]` or something else?
566568

567569
### Nice-to-Know (Optimization)

0 commit comments

Comments
 (0)