{"record":{"id":"7b45b3ebba4236f9","repo":"JuliusBrussee/caveman","slug":"cave-claude-tool-contract-unsupported-unsupporte","errorCode":null,"errorMessage":"cave_claude_tool_contract_unsupported:${unsupportedTool.name}","messagePattern":"cave_claude_tool_contract_unsupported:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/claude-runtime.ts","lineNumber":103,"sourceCode":"  if (options.lockedBuild !== undefined && options.candidatePlan !== undefined) {\n    throw new Error(\"cave_execution_authorization_ambiguous\");\n  }\n  if (options.candidatePlan !== undefined) {\n    throw new Error(\"cave_claude_candidate_execution_unavailable\");\n  }\n  if (options.lockedBuild !== undefined) {\n    throw new Error(\"cave_claude_locked_execution_unavailable\");\n  }\n  if (definition.memory !== undefined) {\n    throw new Error(\"cave_claude_memory_bridge_unavailable\");\n  }\n  if (definition.tools.some((item) => item.runtime?.kind === \"subagent\")) {\n    throw new Error(\"cave_claude_subagent_bridge_unavailable\");\n  }\n  const unsupportedTool = definition.tools.find((item) =>\n    item.effect !== \"read\" || item.result !== \"inline\");\n  if (unsupportedTool !== undefined) {\n    throw new Error(`cave_claude_tool_contract_unsupported:${unsupportedTool.name}`);\n  }\n  if (options.maxTurns !== undefined &&\n      (!Number.isSafeInteger(options.maxTurns) || options.maxTurns <= 0 || options.maxTurns > 1_000)) {\n    throw new Error(\"cave_claude_max_turns_invalid\");\n  }\n  if (options.maxBudgetUsd !== undefined &&\n      (!Number.isFinite(options.maxBudgetUsd) || options.maxBudgetUsd <= 0)) {\n    throw new Error(\"cave_claude_max_budget_invalid\");\n  }\n  const rootDir = resolve(options.rootDir ?? process.cwd());\n  const lowered = await lowerAgentContext(definition, { rootDir, input });\n  const bill = contextBill(lowered.ir);\n  const selected = resolveClaudeModel(definition, rootDir);\n  const reasoningOptions = claudeReasoningOptions(\n    selected,\n    definition.reasoning,\n    definition.output?.maxTokens,\n  );","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/packages/agent/src/claude-runtime.ts#L85-L121","documentation":"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.","triggerScenarios":"Thrown at packages/agent/src/claude-runtime.ts:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}