{"record":{"id":"b7ac09fc4b54faeb","repo":"JuliusBrussee/caveman","slug":"cave-execution-authorization-ambiguous","errorCode":null,"errorMessage":"cave_execution_authorization_ambiguous","messagePattern":"cave_execution_authorization_ambiguous","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/claude-runtime.ts","lineNumber":86,"sourceCode":"  return runClaudeAgentWithOptions(definition, input, options);\n}\n\n/** CLI/test lane. Locked execution fails closed before provider use. */\nexport async function runClaudeAgentInternal(\n  definition: AgentDefinition,\n  input: string,\n  options: ClaudeInternalRunOptions,\n): Promise<RunResult> {\n  return runClaudeAgentWithOptions(definition, input, options);\n}\n\nasync function runClaudeAgentWithOptions(\n  definition: AgentDefinition,\n  input: string,\n  options: ClaudeInternalRunOptions,\n): Promise<RunResult> {\n  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  }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/agent/src/claude-runtime.ts#L68-L104","documentation":"Error \"cave_execution_authorization_ambiguous\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at packages/agent/src/claude-runtime.ts:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disambiguate execution authorization: specify exactly one authorization scope for the Claude run."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}