authorgravatar for 183252392+shirishpothi@users.noreply.github.comShirish Pothi <183252392+shirishpothi@users.noreply.github.com> 2026-09-26 11:51:45+08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-25 22:51:45-05:00
log4408bf5a4fb0c97373d57abfdf6f541e315b1e67
tree52f8293cedec5344caeba93d7f8ec50e4ddebd00
parent04c15f34b756aadbff4c93ff07a217fa2398e5d5
signature Signed by PGP key B5690EEEBB952194

fix(opencode): accept v2 serve ready line when spawning server (#13651)


1 files changed, 2 insertions(+), 6 deletions(-)

apps/server/src/provider/opencodeRuntime.ts+2-6
...@@ -78,7 +78,6 @@ export function resolveOpenCodeServerPassword(...@@ -78,7 +78,6 @@ export function resolveOpenCodeServerPassword(
78 : input.environment.OPENCODE_SERVER_PASSWORD;78 : input.environment.OPENCODE_SERVER_PASSWORD;
79}79}
8080
81const OPENCODE_SERVER_READY_PREFIX = "opencode server listening";
82const DEFAULT_OPENCODE_SERVER_TIMEOUT_MS = 30_000;81const DEFAULT_OPENCODE_SERVER_TIMEOUT_MS = 30_000;
83const DEFAULT_HOSTNAME = "127.0.0.1";82const DEFAULT_HOSTNAME = "127.0.0.1";
84const OPENCODE_SERVER_STARTUP_MAX_OUTPUT_CHARS = 64 * 1024;83const OPENCODE_SERVER_STARTUP_MAX_OUTPUT_CHARS = 64 * 1024;
...@@ -289,11 +288,8 @@ export interface OpenCodeRuntimeShape {...@@ -289,11 +288,8 @@ export interface OpenCodeRuntimeShape {
289288
290function parseServerUrlFromOutput(output: string): string | null {289function parseServerUrlFromOutput(output: string): string | null {
291 for (const line of output.split("\n")) {290 for (const line of output.split("\n")) {
292 if (!line.startsWith(OPENCODE_SERVER_READY_PREFIX)) {291 const match = line.match(/server listening on\s+(https?:\/\/[^\s]+)/i);
293 continue;292 if (match?.[1]) return match[1];
294 }
295 const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
296 return match?.[1] ?? null;
297 }293 }
298 return null;294 return null;
299}295}