diff --git a/bin/lib/onboard.js b/bin/lib/onboard.js index 81aaf07bd..c440cb9b7 100644 --- a/bin/lib/onboard.js +++ b/bin/lib/onboard.js @@ -680,6 +680,7 @@ function probeOpenAiLikeEndpoint(endpointUrl, model, apiKey) { const result = spawnSync("bash", ["-c", cmd], { cwd: ROOT, encoding: "utf8", + timeout: 30_000, env: { ...process.env, NEMOCLAW_PROBE_API_KEY: apiKey, @@ -729,6 +730,7 @@ function probeAnthropicEndpoint(endpointUrl, model, apiKey) { const result = spawnSync("bash", ["-c", cmd], { cwd: ROOT, encoding: "utf8", + timeout: 30_000, env: { ...process.env, NEMOCLAW_PROBE_API_KEY: apiKey, @@ -869,6 +871,7 @@ function fetchNvidiaEndpointModels(apiKey) { const result = spawnSync("bash", ["-c", cmd], { cwd: ROOT, encoding: "utf8", + timeout: 30_000, env: { ...process.env, NEMOCLAW_PROBE_API_KEY: apiKey, @@ -922,6 +925,7 @@ function fetchOpenAiLikeModels(endpointUrl, apiKey) { const result = spawnSync("bash", ["-c", cmd], { cwd: ROOT, encoding: "utf8", + timeout: 30_000, env: { ...process.env, NEMOCLAW_PROBE_API_KEY: apiKey, @@ -959,6 +963,7 @@ function fetchAnthropicModels(endpointUrl, apiKey) { const result = spawnSync("bash", ["-c", cmd], { cwd: ROOT, encoding: "utf8", + timeout: 30_000, env: { ...process.env, NEMOCLAW_PROBE_API_KEY: apiKey, @@ -1225,8 +1230,13 @@ function pullOllamaModel(model) { cwd: ROOT, encoding: "utf8", stdio: "inherit", + timeout: 600_000, env: { ...process.env }, }); + if (result.signal === "SIGTERM") { + console.error(` Model pull timed out after 10 minutes. Try a smaller model or check your network connection.`); + return false; + } return result.status === 0; } @@ -1360,6 +1370,7 @@ function installOpenshell() { env: process.env, stdio: ["ignore", "pipe", "pipe"], encoding: "utf-8", + timeout: 300_000, }); if (result.status !== 0) { const output = `${result.stdout || ""}${result.stderr || ""}`.trim();