From 4c89a1eabeb80b536a838bb0b448190fa892e371 Mon Sep 17 00:00:00 2001 From: ethan Date: Mon, 19 Jan 2026 13:15:20 +1100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20fix:=20run=20coder=20config-?= =?UTF-8?q?ssh=20on=20app=20startup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refresh Coder SSH config during ServiceContainer initialization. This handles cases where the coder binary moves on restart (e.g., self-updating installers or temp paths). - Check if coder is available first via getCoderInfo() - Fire-and-forget to avoid blocking startup - Logs warning on failure but doesn't crash --- src/node/services/serviceContainer.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node/services/serviceContainer.ts b/src/node/services/serviceContainer.ts index f5e055fcc0..6f40eb2e53 100644 --- a/src/node/services/serviceContainer.ts +++ b/src/node/services/serviceContainer.ts @@ -43,6 +43,7 @@ import { IdleCompactionService } from "@/node/services/idleCompactionService"; import { TaskService } from "@/node/services/taskService"; import { getSigningService, type SigningService } from "@/node/services/signingService"; import { coderService, type CoderService } from "@/node/services/coderService"; +import { log } from "@/node/services/log"; import { setGlobalCoderService } from "@/node/runtime/runtimeFactory"; /** @@ -214,6 +215,15 @@ export class ServiceContainer { await this.taskService.initialize(); // Start idle compaction checker this.idleCompactionService.start(); + + // Refresh Coder SSH config in background (handles binary path changes on restart) + void this.coderService.getCoderInfo().then((info) => { + if (info.state === "available") { + this.coderService.ensureSSHConfig().catch((err) => { + log.warn("Failed to refresh Coder SSH config", { err }); + }); + } + }); } /** From b08462bd46d605c2d48f12e467d0ad4c9403fac8 Mon Sep 17 00:00:00 2001 From: ethan Date: Mon, 19 Jan 2026 13:22:06 +1100 Subject: [PATCH 2/2] fix: simplify ssh config refresh, avoid caching unavailable state - Call ensureSSHConfig() directly instead of checking getCoderInfo() first - This avoids caching 'unavailable' if coder isn't installed at startup - User can install coder mid-session and it will be detected correctly - Remove unused log import --- src/node/services/serviceContainer.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node/services/serviceContainer.ts b/src/node/services/serviceContainer.ts index 6f40eb2e53..2c56bcae0c 100644 --- a/src/node/services/serviceContainer.ts +++ b/src/node/services/serviceContainer.ts @@ -43,7 +43,6 @@ import { IdleCompactionService } from "@/node/services/idleCompactionService"; import { TaskService } from "@/node/services/taskService"; import { getSigningService, type SigningService } from "@/node/services/signingService"; import { coderService, type CoderService } from "@/node/services/coderService"; -import { log } from "@/node/services/log"; import { setGlobalCoderService } from "@/node/runtime/runtimeFactory"; /** @@ -217,12 +216,9 @@ export class ServiceContainer { this.idleCompactionService.start(); // Refresh Coder SSH config in background (handles binary path changes on restart) - void this.coderService.getCoderInfo().then((info) => { - if (info.state === "available") { - this.coderService.ensureSSHConfig().catch((err) => { - log.warn("Failed to refresh Coder SSH config", { err }); - }); - } + // Skip getCoderInfo() to avoid caching "unavailable" if coder isn't installed yet + void this.coderService.ensureSSHConfig().catch(() => { + // Ignore errors - coder may not be installed }); }