diff --git a/src/features/tmux-subagent/manager.ts b/src/features/tmux-subagent/manager.ts index 05199f4d1f..c1a11a9a82 100644 --- a/src/features/tmux-subagent/manager.ts +++ b/src/features/tmux-subagent/manager.ts @@ -71,7 +71,11 @@ export class TmuxSessionManager { this.tmuxConfig = tmuxConfig this.deps = deps const defaultPort = process.env.OPENCODE_PORT ?? "4096" - this.serverUrl = ctx.serverUrl?.toString() ?? `http://localhost:${defaultPort}` + try { + this.serverUrl = ctx.serverUrl?.toString() ?? `http://localhost:${defaultPort}` + } catch { + this.serverUrl = `http://localhost:${defaultPort}` + } this.sourcePaneId = deps.getCurrentPaneId() this.pollingManager = new TmuxPollingManager( this.client,