JuliusBrussee/caveman · error · Error

cave plan fetch failed with HTTP ${response.status}

Error message

cave plan fetch failed with HTTP ${response.status}

What it means

Error "cave plan fetch failed with HTTP ${response.status}" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/sdk/typescript/src/index.ts:1960

}

function cloneCanonical(value: unknown): unknown {
  return JSON.parse(canonicalJSON(value)) as unknown;
}

function assemblyText(value: unknown): string {
  return typeof value === "string" ? value : canonicalJSON(value);
}

async function cavePlan(cave: Cave): Promise<CavePlan> {
  // `/sdk/v1/cave-plan` is a gateway-owned project-key route. `controlURL` is
  // reserved for control-api `/api/v1/*` surfaces and must never redirect this
  // call to a route that service does not expose.
  const response = await caveFetch(cave, `${cave.options.baseURL}/sdk/v1/cave-plan`, {
    method: "GET",
    headers: otlpHeaders(cave)
  });
  if (!response.ok) throw new Error(`cave plan fetch failed with HTTP ${response.status}`);
  // Passed through verbatim: snake_case wire fields, every figure inferred/per-day.
  return (await response.json()) as CavePlan;
}

function strictNonNegativeInt(value: unknown): number | null {
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
}

const DEFAULT_HTTP_TIMEOUT_MS = 30_000;

/**
 * Shared bounded transport for every SDK request.
 *
 * The explicit abort race is intentional: callers still settle on deadline when
 * a custom fetch implementation ignores AbortSignal. Native fetch also receives
 * the combined signal, so response-body reads and sockets are cancelled.
 */
async function caveFetch(cave: Cave, input: RequestInfo | URL, init: RequestInit = {}): Promise<Response> {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. The cave plan fetch returned a non-2xx status; check credentials and endpoint, then retry.

When it happens

Trigger: Thrown at packages/sdk/typescript/src/index.ts:1960 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/7d9fcdbfd1cc4e95. Report an issue: GitHub.