Skip to content

Commit 4408bf5

Browse files
authored
fix(opencode): accept v2 serve ready line when spawning server (pingdotgg#13651)
1 parent 04c15f3 commit 4408bf5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎apps/server/src/provider/opencodeRuntime.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export function resolveOpenCodeServerPassword(
7878
: input.environment.OPENCODE_SERVER_PASSWORD;
7979
}
8080

81-
const OPENCODE_SERVER_READY_PREFIX = "opencode server listening";
8281
const DEFAULT_OPENCODE_SERVER_TIMEOUT_MS = 30_000;
8382
const DEFAULT_HOSTNAME = "127.0.0.1";
8483
const OPENCODE_SERVER_STARTUP_MAX_OUTPUT_CHARS = 64 * 1024;
@@ -289,11 +288,8 @@ export interface OpenCodeRuntimeShape {
289288

290289
function parseServerUrlFromOutput(output: string): string | null {
291290
for (const line of output.split("\n")) {
292-
if (!line.startsWith(OPENCODE_SERVER_READY_PREFIX)) {
293-
continue;
294-
}
295-
const match = line.match(/on\s+(https?:\/\/[^\s]+)/);
296-
return match?.[1] ?? null;
291+
const match = line.match(/server listening on\s+(https?:\/\/[^\s]+)/i);
292+
if (match?.[1]) return match[1];
297293
}
298294
return null;
299295
}

0 commit comments

Comments
 (0)