diff --git a/backend/test/helpers/opencode-binary.ts b/backend/test/helpers/opencode-binary.ts index 6cf8a84d..027e0c89 100644 --- a/backend/test/helpers/opencode-binary.ts +++ b/backend/test/helpers/opencode-binary.ts @@ -51,15 +51,18 @@ export async function waitForOpenCodePluginsLoaded( timeoutMs: number = PLUGIN_LOAD_TIMEOUT_MS, ): Promise { const deadline = Date.now() + timeoutMs + let lastFailure = 'no plugins reported' while (Date.now() < deadline) { try { const { data } = await client.api.plugin.list() if (data.length > 0) return - } catch { + lastFailure = 'no plugins reported' + } catch (error) { + lastFailure = String(error) } await delay(PLUGIN_POLL_INTERVAL_MS) } - throw new Error(`OpenCode server plugins did not load within ${timeoutMs}ms`) + throw new Error(`OpenCode server plugins did not load within ${timeoutMs}ms: ${lastFailure}`) } export function readOpenCodeVersion(binary: string): string | null {