JuliusBrussee/caveman · error · Error
oversized_response
Error message
oversized_response
What it means
Error "oversized_response" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/sdk/typescript/src/index.ts:879
}
return response;
}
};
}
// ─── Runtime policy client ────────────────────────────────────────────────────
/** Schema version this client accepts; anything else is rejected (fail closed). */
const RUNTIME_POLICY_SCHEMA_VERSION = "caveman.runtime-policy.v1";
/** Runtime-policy envelopes are KB-sized; stop a hostile body after 1 MiB. */
const RUNTIME_POLICY_MAX_RESPONSE_BYTES = 1024 * 1024;
async function readRuntimePolicyResponseText(response: Response): Promise<string> {
const contentLength = response.headers?.get?.("content-length");
if (typeof contentLength === "string" && /^[0-9]+$/.test(contentLength) && Number(contentLength) > RUNTIME_POLICY_MAX_RESPONSE_BYTES) {
await Promise.resolve(response.body?.cancel?.()).catch(() => undefined);
throw new Error("oversized_response");
}
const reader = response.body?.getReader?.();
if (!reader) throw new Error("bounded_response_unavailable");
const chunks: Uint8Array[] = [];
let total = 0;
try {
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (!(value instanceof Uint8Array)) throw new Error("runtime policy response stream returned invalid bytes");
total += value.byteLength;
if (total > RUNTIME_POLICY_MAX_RESPONSE_BYTES) {
await Promise.resolve(reader.cancel()).catch(() => undefined);
throw new Error("oversized_response");
}
chunks.push(value);
}View on GitHub (pinned to 27d5a3981a)
Solutions
- The response exceeded the size cap; narrow the request or paginate.
When it happens
Trigger: Thrown at packages/sdk/typescript/src/index.ts:879 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/c6049491838b9047.
Report an issue: GitHub.