JuliusBrussee/caveman · error
cave_tool_result_limit
Error message
cave_tool_result_limit
What it means
Error "cave_tool_result_limit" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/agent/src/runtime.ts:3747
// The worker path is bounded by killing its process; the IN-PROCESS
// (host/fixture) path is a closure this process cannot preempt, so a
// closure that ignores `combined` would hang the run forever. Race it
// against a hard deadline so the run stops waiting at timeoutMs with
// cave_tool_timeout (the closure keeps running in the background — JS
// cannot preempt it — but it no longer blocks the run).
const value = sandboxExecute
? await sandboxExecute(params, combined)
: await raceToolTimeout(
Promise.resolve(definition.execute(params, combined)),
definition.timeoutMs,
);
const text = typeof value === "string" ? value : JSON.stringify(value);
const raw = new TextEncoder().encode(text ?? "null");
const maxInlineBytes = definition.artifact === undefined
? 32_768
: definition.artifact.maxInlineTokens * 4;
if (deferLockedToolResult) {
if (raw.byteLength > 16 * 1024 * 1024) throw new Error("cave_tool_result_limit");
return {
content: [{ type: "text", text: text ?? "null" }],
details: { effect: definition.effect, resultPolicy: definition.result, lockedRoutePending: true },
};
}
if (definition.result === "inline") {
if (raw.byteLength > maxInlineBytes) throw new Error("cave_tool_result_inline_limit");
return {
content: [{ type: "text", text: text ?? "null" }],
details: { effect: definition.effect, resultPolicy: definition.result },
};
}
const mustOffload = definition.result === "page" ||
definition.result === "compress" ||
definition.result === "exact_ccr" ||
raw.byteLength > maxInlineBytes;
if (!mustOffload) {
return {View on GitHub (pinned to 27d5a3981a)
Solutions
- The tool result exceeds the configured byte limit; shrink the result or raise the limit.
When it happens
Trigger: Thrown at packages/agent/src/runtime.ts:3747 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/60d550718da825ad.
Report an issue: GitHub.