{"record":{"id":"9fbaff703daf56be","repo":"JuliusBrussee/caveman","slug":"cave-claude-candidate-execution-unavailable","errorCode":"cave_claude_candidate_execution_unavailable","errorMessage":"cave_claude_candidate_execution_unavailable","messagePattern":"cave_claude_candidate_execution_unavailable","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent/src/claude-runtime.ts","lineNumber":89,"sourceCode":"/** 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  }\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\");","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/claude-runtime.ts#L71-L107","documentation":"Fail-closed guard in runClaudeAgentWithOptions: a candidatePlan was supplied, but the Claude runtime implements no candidate-execution lane. The run aborts before any provider call rather than silently executing the candidate under the wrong authorization.","triggerScenarios":"Thrown at packages/agent/src/claude-runtime.ts:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Route candidate-plan execution to a harness that supports the candidate lane","Drop candidatePlan and run the Claude lane with its default authorization","Extend the Claude runtime with an explicit candidate executor before passing this option"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}