JuliusBrussee/caveman · error · CaveRequestError

cave artifact response missing artifact_id

Error message

cave artifact response missing artifact_id

What it means

Error "cave artifact response missing artifact_id" thrown in JuliusBrussee/caveman.

Source

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

  }

  model = {
    openai: {
      responses: { create: (body: unknown, init?: { cave?: { latencyClass?: string } }) => providerFetch(this.cave, "/openai/v1/responses", body, this.workflow, init?.cave, undefined, this.traceContext()) },
      chat: { completions: { create: (body: unknown) => providerFetch(this.cave, "/openai/v1/chat/completions", body, this.workflow, undefined, undefined, this.traceContext()) } }
    }
  };

  artifacts = {
    page: async (value: unknown, options: { source: string; contentType?: string; strategy: "verbatim" | "json-index" | "text-chunks" | "table-index" | "llm-summary"; maxInlineTokens?: number }) => {
      if (options.strategy === "verbatim") return value;
      const response = await request(this.cave, "/sdk/v1/artifacts", { value, options, workflow: this.workflow }, this.workflow, this.traceContext(), {
        "x-cave-artifact-envelope": "value-v1",
        "x-cave-artifact-source": options.source
      });
      if (response.stored === false) return value;
      if (response.stored !== true || typeof response.artifact_id !== "string" || response.artifact_id.trim() === "") {
        throw new CaveRequestError(200, "/sdk/v1/artifacts", "cave artifact response missing artifact_id");
      }
      return `[cave-artifact id=${response.artifact_id} source=${options.source} type=${options.contentType ?? "application/json"}]\nsummary: artifact stored.\nretrieve: authenticated GET /sdk/v1/artifacts/${response.artifact_id} or trace.artifacts.get("${response.artifact_id}").\n[/cave-artifact]`;
    },
    get: async (artifactId: string): Promise<unknown> => artifactGet(this.cave, artifactId, this.workflow, this.traceContext())
  };

  context = {
    checkpoint: async (messages: unknown[], options: Record<string, unknown>) => request(this.cave, "/sdk/v1/checkpoints", { messages, options, workflow: this.workflow }, this.workflow, this.traceContext()),
    /**
     * Reverse a checkpoint `source_ref` back into the original context.
     *
     * GETs `/sdk/v1/checkpoints/{sourceRef}/expand`; the gateway returns the
     * stored `{ source_ref, version, messages, checkpoint }`. This is the other
     * half of `checkpoint()` — reversibility is mandatory: a checkpoint that
     * cannot be expanded is a bug.
     */
    expand: async (sourceRef: string) => {
      const response = await request(this.cave, `/sdk/v1/checkpoints/${encodeURIComponent(sourceRef)}/expand`, undefined, this.workflow, this.traceContext());

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. The cave artifact response lacked artifact_id; verify the server version and retry.

When it happens

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