JuliusBrussee/caveman · error

caveman agent: unknown model ${JSON.stringify(requested)}

Error message

caveman agent: unknown model ${JSON.stringify(requested)}

What it means

Error "caveman agent: unknown model ${JSON.stringify(requested)}" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/agent/src/runtime.ts:3247

  // future OAuth-capable Google provider cannot be relabeled as metered.
  if (provider === "google" && process.env.GOOGLE_API_KEY) return "metered";
  return "unknown";
}

function resolveModel(definition: AgentDefinition, models: Models, rootDir: string): Model<Api> {
  if (typeof definition.model === "object" && "provider" in definition.model) {
    return definition.model;
  }
  const requested = typeof definition.model === "string"
    ? definition.model
    : process.env.CAVE_MODEL ?? localProviderModel(rootDir);
  if (requested) {
    const slash = requested.indexOf("/");
    if (slash <= 0 || slash === requested.length - 1) {
      throw new Error("caveman agent: pinned model must use provider/model format");
    }
    const model = models.getModel(requested.slice(0, slash), requested.slice(slash + 1));
    if (!model) throw new Error(`caveman agent: unknown model ${JSON.stringify(requested)}`);
    return model;
  }

  const configured: Array<[string, string]> = [];
  if (process.env.ANTHROPIC_API_KEY) configured.push(["anthropic", "claude-haiku-4-5"]);
  if (process.env.OPENAI_API_KEY) configured.push(["openai", "gpt-5.4-mini"]);
  if (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY) configured.push(["google", "gemini-2.5-flash"]);
  if (configured.length !== 1) {
    throw new Error(
      configured.length === 0
        ? "caveman agent: no supported provider credential found"
        : "caveman agent: multiple provider credentials found; set CAVE_MODEL once",
    );
  }
  const [provider, id] = configured[0]!;
  const model = models.getModel(provider, id);
  if (!model) throw new Error(`caveman agent: baseline model unavailable: ${provider}/${id}`);
  return model;

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Choose a model from the supported provider catalog; the requested model id is unknown.

When it happens

Trigger: Thrown at packages/agent/src/runtime.ts:3247 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/a3386820809edbd5. Report an issue: GitHub.