paperclipai/paperclip · error · Error

Configured OpenCode model is unavailable on the remote execu

Error message

Configured OpenCode model is unavailable on the remote execution target: ${model}. Available models: ${sample}

What it means

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.

Source

Thrown at packages/adapters/opencode-local/src/server/execute.ts:149

  if ((probe.exitCode ?? 1) !== 0) {
    const detail = firstNonEmptyLine(probe.stderr) || firstNonEmptyLine(probe.stdout);
    throw new Error(
      detail
        ? `\`opencode models\` failed on the remote execution target: ${detail}`
        : "`opencode models` failed on the remote execution target.",
    );
  }

  const models = parseOpenCodeModelsOutput(probe.stdout);
  if (models.length === 0) {
    throw new Error(
      "OpenCode returned no models on the remote execution target. Run `opencode models` there and verify provider auth.",
    );
  }

  if (!models.some((entry) => entry.id === model)) {
    const sample = models.slice(0, 12).map((entry) => entry.id).join(", ");
    throw new Error(
      `Configured OpenCode model is unavailable on the remote execution target: ${model}. Available models: ${sample}${models.length > 12 ? ", ..." : ""}`,
    );
  }
}

function claudeSkillsHome(): string {
  return path.join(os.homedir(), ".claude", "skills");
}

async function ensureOpenCodeSkillsInjected(
  onLog: AdapterExecutionContext["onLog"],
  skillsEntries: Array<{ key: string; runtimeName: string; source: string }>,
  desiredSkillNames?: string[],
) {
  const skillsHome = claudeSkillsHome();
  await fs.mkdir(skillsHome, { recursive: true });
  const desiredSet = new Set(desiredSkillNames ?? skillsEntries.map((entry) => entry.key));
  const selectedEntries = skillsEntries.filter((entry) => desiredSet.has(entry.key));

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Set adapterConfig.model to one of the ids listed in the error's Available models sample.
  2. Authenticate the provider that serves the configured model inside the remote target.
  3. Set OPENCODE_ALLOW_ALL_MODELS if the model is valid but intentionally hidden from `opencode models` (gateway-routed).
Defensive patterns

Strategy: validation

Validate before calling

function modelInList(model: string, available: { id: string }[]): boolean {
  return available.some(m => m.id === model);
}

Try / catch

try {
  await ensureOpenCodeModelAvailableOnTarget(input);
} catch (e) {
  if (e instanceof Error && /Configured OpenCode model is unavailable on the remote execution target/.test(e.message)) {
    // parse Available models from the message, pick one, update adapterConfig.model, retry
  }
  throw e;
}

Prevention

When it happens

Trigger: models.length > 0 AND !models.some(e => e.id === model) where model is adapterConfig.model, on a remote/sandbox target.

Common situations: 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.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/e3fa39cecea50f30. Report an issue: GitHub.