Summary
When the Codev VSCode extension shows Codev: Offline in the status bar, there is no user-facing way to make it retry the connection — even when Tower is running and healthy. The extension stays stuck in disconnected indefinitely.
Repro
- Open a Codev workspace in VSCode while Tower is not running.
- Extension activates, calls
connectionManager.initialize(), the initial connect() fails, state goes to disconnected.
- Start Tower (
afx tower start).
- Status bar still says Codev: Offline. Sidebar views are empty. Terminals can't be opened.
- There is no Command Palette entry, status-bar click handler, or context menu action to retry.
Root cause
In packages/vscode/src/connection-manager.ts:
initialize() (line 57) calls connect() once. On failure, state is set to disconnected and execution returns. No retry is scheduled.
scheduleReconnect() (line 121) — the only retry path — is only invoked from startSSE()'s disconnect callback (line 178). That path requires a previously successful connection whose SSE stream later dropped. The cold-start failure case never reaches it.
- The
reconnectAttempt exponential backoff therefore only protects against mid-session SSE drops, not against "Tower wasn't up at activation time."
In packages/vscode/src/extension.ts:
- The status bar item (line 38–41) has no
command set, so clicking the Offline indicator does nothing.
- No
codev.reconnect command is registered (verified via grep against package.json — only codev.connectTunnel / codev.disconnectTunnel exist, which are unrelated).
Current workarounds (both bad)
- Developer: Reload Window — kills every integrated terminal in the window, including non-Codev ones running
pnpm dev, tails, SSH, etc. Terminal scrollback persists; running processes do not.
- Disable + re-enable the Codev extension in the Extensions view — works, but is several clicks deep and not discoverable.
Proposed fix
- Register a
codev.reconnect command that calls connectionManager.connect() after resetting reconnectAttempt = 0 (so the user-initiated retry isn't penalised by backoff state from a previous mid-session drop).
- Set
statusBarItem.command = 'codev.reconnect' in extension.ts so clicking the Offline / Reconnecting... indicator triggers it.
- In
ConnectionManager.connect(), when the attempt fails from a fresh disconnected state (i.e. cold start, no SSE ever established), call scheduleReconnect() so the extension self-heals once Tower comes up — instead of parking forever.
Acceptance
Affected files
packages/vscode/src/connection-manager.ts
packages/vscode/src/extension.ts
packages/vscode/package.json (command + status-bar contribution)
Summary
When the Codev VSCode extension shows Codev: Offline in the status bar, there is no user-facing way to make it retry the connection — even when Tower is running and healthy. The extension stays stuck in
disconnectedindefinitely.Repro
connectionManager.initialize(), the initialconnect()fails, state goes todisconnected.afx tower start).Root cause
In
packages/vscode/src/connection-manager.ts:initialize()(line 57) callsconnect()once. On failure, state is set todisconnectedand execution returns. No retry is scheduled.scheduleReconnect()(line 121) — the only retry path — is only invoked fromstartSSE()'s disconnect callback (line 178). That path requires a previously successful connection whose SSE stream later dropped. The cold-start failure case never reaches it.reconnectAttemptexponential backoff therefore only protects against mid-session SSE drops, not against "Tower wasn't up at activation time."In
packages/vscode/src/extension.ts:commandset, so clicking the Offline indicator does nothing.codev.reconnectcommand is registered (verified via grep againstpackage.json— onlycodev.connectTunnel/codev.disconnectTunnelexist, which are unrelated).Current workarounds (both bad)
pnpm dev, tails, SSH, etc. Terminal scrollback persists; running processes do not.Proposed fix
codev.reconnectcommand that callsconnectionManager.connect()after resettingreconnectAttempt = 0(so the user-initiated retry isn't penalised by backoff state from a previous mid-session drop).statusBarItem.command = 'codev.reconnect'inextension.tsso clicking the Offline / Reconnecting... indicator triggers it.ConnectionManager.connect(), when the attempt fails from a freshdisconnectedstate (i.e. cold start, no SSE ever established), callscheduleReconnect()so the extension self-heals once Tower comes up — instead of parking forever.Acceptance
Codev: Reconnectappears in the Command Palette.Affected files
packages/vscode/src/connection-manager.tspackages/vscode/src/extension.tspackages/vscode/package.json(command + status-bar contribution)