JuliusBrussee/caveman · error · Error
cave_claude_tool_contract_unsupported
Error message
cave_claude_tool_contract_unsupported:${unsupportedTool.name} What it means
Tool-contract guard in runClaudeAgentWithOptions: a tool was found whose effect is not 'read' or whose result is not 'inline'. The Claude lane only supports read-effect, inline-result tools, and the message embeds the offending tool's name.
Solutions
- Change the offending tool to effect: 'read' and result: 'inline', or drop it
- Move write-effect or side-effecting tools to a harness lane that supports them
- Check the tool named after the colon in the message to find the offender
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/agent/src/claude-runtime.ts:103 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/7b45b3ebba4236f9.
Report an issue: GitHub.
Appendix: source
Thrown at packages/agent/src/claude-runtime.ts:103
if (options.lockedBuild !== undefined && options.candidatePlan !== undefined) {
throw new Error("cave_execution_authorization_ambiguous");
}
if (options.candidatePlan !== undefined) {
throw new Error("cave_claude_candidate_execution_unavailable");
}
if (options.lockedBuild !== undefined) {
throw new Error("cave_claude_locked_execution_unavailable");
}
if (definition.memory !== undefined) {
throw new Error("cave_claude_memory_bridge_unavailable");
}
if (definition.tools.some((item) => item.runtime?.kind === "subagent")) {
throw new Error("cave_claude_subagent_bridge_unavailable");
}
const unsupportedTool = definition.tools.find((item) =>
item.effect !== "read" || item.result !== "inline");
if (unsupportedTool !== undefined) {
throw new Error(`cave_claude_tool_contract_unsupported:${unsupportedTool.name}`);
}
if (options.maxTurns !== undefined &&
(!Number.isSafeInteger(options.maxTurns) || options.maxTurns <= 0 || options.maxTurns > 1_000)) {
throw new Error("cave_claude_max_turns_invalid");
}
if (options.maxBudgetUsd !== undefined &&
(!Number.isFinite(options.maxBudgetUsd) || options.maxBudgetUsd <= 0)) {
throw new Error("cave_claude_max_budget_invalid");
}
const rootDir = resolve(options.rootDir ?? process.cwd());
const lowered = await lowerAgentContext(definition, { rootDir, input });
const bill = contextBill(lowered.ir);
const selected = resolveClaudeModel(definition, rootDir);
const reasoningOptions = claudeReasoningOptions(
selected,
definition.reasoning,
definition.output?.maxTokens,
);View on GitHub (pinned to 766dce6b13)