paperclipai/paperclip · error · Error

OpenCode returned no models on the remote execution target.

Error message

OpenCode returned no models on the remote execution target. Run `opencode models` there and verify provider auth.

What it means

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.

Source

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

    },
  );

  if (probe.timedOut) {
    throw new Error(`\`opencode models\` timed out on the remote execution target after ${probeTimeoutSec}s.`);
  }

  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"],

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Run `opencode models` directly on the remote target and confirm it prints provider/model lines.
  2. Authenticate at least one provider inside the target (set the provider API key env or run opencode login).
  3. If the opencode version changed its output, update parseOpenCodeModelsOutput or pin a known-good opencode version in the image.
  4. Set OPENCODE_ALLOW_ALL_MODELS to bypass the probe if the model is gateway-routed and won't appear in the list.
Defensive patterns

Strategy: validation

Validate before calling

// Allow callers to bypass when models are gateway-routed.
const allowAll = isTruthyEnvFlag(input.env.OPENCODE_ALLOW_ALL_MODELS ?? process.env.OPENCODE_ALLOW_ALL_MODELS);
if (allowAll) { /* skip probe */ }

Try / catch

try {
  await ensureOpenCodeModelAvailableOnTarget(input);
} catch (e) {
  if (e instanceof Error && /OpenCode returned no models on the remote execution target/.test(e.message)) {
    // set provider auth in the target, or set OPENCODE_ALLOW_ALL_MODELS, then retry
  }
  throw e;
}

Prevention

When it happens

Trigger: probe.exitCode === 0 AND parseOpenCodeModelsOutput(probe.stdout).length === 0 on a remote target.

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

Related errors


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