{"record":{"id":"b7ada0b3fffaef3a","repo":"paperclipai/paperclip","slug":"opencode-models-timed-out-on-the-remote-executio","errorCode":null,"errorMessage":"`opencode models` timed out on the remote execution target after ${probeTimeoutSec}s.","messagePattern":"`opencode models` timed out on the remote execution target after (.+?)s\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapters/opencode-local/src/server/execute.ts","lineNumber":128,"sourceCode":"  const probeTimeoutSec = input.timeoutSec > 0\n    ? Math.min(input.timeoutSec, defaultProbeTimeoutSec)\n    : defaultProbeTimeoutSec;\n  const probe = await runAdapterExecutionTargetProcess(\n    input.runId,\n    input.executionTarget,\n    input.command,\n    [\"models\"],\n    {\n      cwd: input.cwd,\n      env: input.env,\n      timeoutSec: probeTimeoutSec,\n      graceSec: input.graceSec,\n      onLog: async () => {},\n    },\n  );\n\n  if (probe.timedOut) {\n    throw new Error(`\\`opencode models\\` timed out on the remote execution target after ${probeTimeoutSec}s.`);\n  }\n\n  if ((probe.exitCode ?? 1) !== 0) {\n    const detail = firstNonEmptyLine(probe.stderr) || firstNonEmptyLine(probe.stdout);\n    throw new Error(\n      detail\n        ? `\\`opencode models\\` failed on the remote execution target: ${detail}`\n        : \"`opencode models` failed on the remote execution target.\",\n    );\n  }\n\n  const models = parseOpenCodeModelsOutput(probe.stdout);\n  if (models.length === 0) {\n    throw new Error(\n      \"OpenCode returned no models on the remote execution target. Run `opencode models` there and verify provider auth.\",\n    );\n  }\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapters/opencode-local/src/server/execute.ts#L110-L146","documentation":"Thrown by the REMOTE OpenCode model-availability probe (execute.ts) when `opencode models` run on the remote/sandbox execution target does not finish within probeTimeoutSec. The probe timeout is the min of the caller-supplied timeoutSec and REMOTE_OPENCODE_MODELS_PROBE_SANDBOX_TIMEOUT_SEC (sandbox) or REMOTE_OPENCODE_MODELS_PROBE_DEFAULT_TIMEOUT_SEC (other remote). This is a remote-target check, distinct from the local discovery timeout in models.ts.","triggerScenarios":"runAdapterExecutionTargetProcess for `opencode models` returns { timedOut: true } on a remote/sandbox target — the binary started but never exited within the probe window.","commonSituations":"Slow sandbox cold start (image pull, init); opencode waiting on a provider network call that hangs; sandbox CPU starvation; opencode prompting interactively with no TTY so it blocks.","solutions":["Increase the caller-supplied timeoutSec so the probe window (min with the default cap) grows.","Raise REMOTE_OPENCODE_MODELS_PROBE_SANDBOX_TIMEOUT_SEC if the sandbox is known to be slow to warm.","Set OPENCODE_ALLOW_ALL_MODELS in the run env to skip the probe entirely for sandbox runs where the model is known-good.","Check the sandbox for a hung opencode process or an interactive prompt; ensure non-interactive provider auth."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// If the model is known-good and the sandbox is slow, bypass the probe.\nconst skipProbe = isTruthyEnvFlag(input.env.OPENCODE_ALLOW_ALL_MODELS ?? process.env.OPENCODE_ALLOW_ALL_MODELS);\nif (skipProbe) { /* skip remote probe */ }","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOpenCodeModelAvailableOnTarget(input);\n} catch (e) {\n  if (e instanceof Error && /timed out on the remote execution target/.test(e.message)) {\n    // either retry once with a larger timeoutSec, or set OPENCODE_ALLOW_ALL_MODELS and proceed\n  } else throw e;\n}","preventionTips":["Warm the sandbox (run a no-op) before the model probe so cold start is paid up front.","Set OPENCODE_ALLOW_ALL_MODELS for sandbox runs where the model is pre-validated.","Size timeoutSec to the sandbox's known cold-start time."],"tags":["opencode","models","remote","sandbox","timeout"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}