{"record":{"id":"e0ccdb06a06f713c","repo":"paperclipai/paperclip","slug":"opencode-returned-no-models-on-the-remote-executio","errorCode":null,"errorMessage":"OpenCode returned no models on the remote execution target. Run `opencode models` there and verify provider auth.","messagePattern":"OpenCode returned no models on the remote execution target\\. Run `opencode models` there and verify provider auth\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapters/opencode-local/src/server/execute.ts","lineNumber":142,"sourceCode":"    },\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\n  if (!models.some((entry) => entry.id === model)) {\n    const sample = models.slice(0, 12).map((entry) => entry.id).join(\", \");\n    throw new Error(\n      `Configured OpenCode model is unavailable on the remote execution target: ${model}. Available models: ${sample}${models.length > 12 ? \", ...\" : \"\"}`,\n    );\n  }\n}\n\nfunction claudeSkillsHome(): string {\n  return path.join(os.homedir(), \".claude\", \"skills\");\n}\n\nasync function ensureOpenCodeSkillsInjected(\n  onLog: AdapterExecutionContext[\"onLog\"],","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapters/opencode-local/src/server/execute.ts#L124-L160","documentation":"Thrown by the REMOTE OpenCode probe when `opencode models` exits 0 but parseOpenCodeModelsOutput extracts zero models. parseOpenCodeModelsOutput only accepts lines whose first token contains a provider/model slash, so an empty or differently-formatted output yields no models. This is the remote-target sibling of the local 'no models' error.","triggerScenarios":"probe.exitCode === 0 AND parseOpenCodeModelsOutput(probe.stdout).length === 0 on a remote target.","commonSituations":"opencode installed and runs but no provider is authenticated, so it prints no model lines; opencode output format changed (newer version prints a table/header without a slash token); the target's opencode config has providers disabled.","solutions":["Run `opencode models` directly on the remote target and confirm it prints provider/model lines.","Authenticate at least one provider inside the target (set the provider API key env or run opencode login).","If the opencode version changed its output, update parseOpenCodeModelsOutput or pin a known-good opencode version in the image.","Set OPENCODE_ALLOW_ALL_MODELS to bypass the probe if the model is gateway-routed and won't appear in the list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Allow callers to bypass when models are gateway-routed.\nconst allowAll = isTruthyEnvFlag(input.env.OPENCODE_ALLOW_ALL_MODELS ?? process.env.OPENCODE_ALLOW_ALL_MODELS);\nif (allowAll) { /* skip probe */ }","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOpenCodeModelAvailableOnTarget(input);\n} catch (e) {\n  if (e instanceof Error && /OpenCode returned no models on the remote execution target/.test(e.message)) {\n    // set provider auth in the target, or set OPENCODE_ALLOW_ALL_MODELS, then retry\n  }\n  throw e;\n}","preventionTips":["Authenticate at least one provider inside the remote target image.","Pin the opencode version so the output format stays parseable.","For gateway-routed models, set OPENCODE_ALLOW_ALL_MODELS to skip enumeration."],"tags":["opencode","models","remote","sandbox","provider-auth"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}