{"record":{"id":"e3fa39cecea50f30","repo":"paperclipai/paperclip","slug":"configured-opencode-model-is-unavailable-on-the-re","errorCode":null,"errorMessage":"Configured OpenCode model is unavailable on the remote execution target: ${model}. Available models: ${sample}","messagePattern":"Configured OpenCode model is unavailable on the remote execution target: (.+?)\\. Available models: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapters/opencode-local/src/server/execute.ts","lineNumber":149,"sourceCode":"  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\"],\n  skillsEntries: Array<{ key: string; runtimeName: string; source: string }>,\n  desiredSkillNames?: string[],\n) {\n  const skillsHome = claudeSkillsHome();\n  await fs.mkdir(skillsHome, { recursive: true });\n  const desiredSet = new Set(desiredSkillNames ?? skillsEntries.map((entry) => entry.key));\n  const selectedEntries = skillsEntries.filter((entry) => desiredSet.has(entry.key));","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapters/opencode-local/src/server/execute.ts#L131-L167","documentation":"Thrown by the REMOTE OpenCode probe when models were discovered on the target but the configured adapterConfig.model is not among them. The message includes up to 12 available model ids as a sample so the operator can pick a valid replacement. Distinct from the local availability error (models.ts:214) because it fires after a remote probe.","triggerScenarios":"models.length > 0 AND !models.some(e => e.id === model) where model is adapterConfig.model, on a remote/sandbox target.","commonSituations":"adapterConfig.model names a provider/model not authenticated on the target (e.g. configured 'anthropic/claude-3-opus' but only OpenAI is authed); typo in the model id; the model was renamed/deprecated by the provider.","solutions":["Set adapterConfig.model to one of the ids listed in the error's Available models sample.","Authenticate the provider that serves the configured model inside the remote target.","Set OPENCODE_ALLOW_ALL_MODELS if the model is valid but intentionally hidden from `opencode models` (gateway-routed)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function modelInList(model: string, available: { id: string }[]): boolean {\n  return available.some(m => m.id === model);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ensureOpenCodeModelAvailableOnTarget(input);\n} catch (e) {\n  if (e instanceof Error && /Configured OpenCode model is unavailable on the remote execution target/.test(e.message)) {\n    // parse Available models from the message, pick one, update adapterConfig.model, retry\n  }\n  throw e;\n}","preventionTips":["Keep adapterConfig.model in sync with the providers authenticated on each target.","Use the model list from `opencode models` (run in the target) to populate config dropdowns.","Set OPENCODE_ALLOW_ALL_MODELS for models that are valid but not enumerated."],"tags":["opencode","models","remote","configuration","model-selection"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}