{"record":{"id":"da303e2acf305ff9","repo":"JuliusBrussee/caveman","slug":"cave-claude-reasoning-capability-unknown-model","errorCode":null,"errorMessage":"cave_claude_reasoning_capability_unknown:${model}","messagePattern":"cave_claude_reasoning_capability_unknown:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/claude-runtime.ts","lineNumber":518,"sourceCode":"  reasoning: AgentDefinition[\"reasoning\"],\n  outputMaxTokens: number | undefined,\n): Pick<ClaudeSDKOptions, \"thinking\" | \"effort\"> {\n  if (reasoning === \"off\") return { thinking: { type: \"disabled\" } };\n  const capability = claudeThinkingCapability(model);\n  if (capability === \"adaptive\") {\n    return {\n      thinking: { type: \"adaptive\" },\n      effort: claudeEffort(reasoning),\n    };\n  }\n  if (capability === \"manual\") {\n    const budgetTokens = reasoning === \"high\" ? 8_192 : reasoning === \"medium\" ? 4_096 : 1_024;\n    if (outputMaxTokens !== undefined && outputMaxTokens <= budgetTokens) {\n      throw new Error(\"cave_claude_output_budget_too_small_for_reasoning\");\n    }\n    return { thinking: { type: \"enabled\", budgetTokens } };\n  }\n  throw new Error(`cave_claude_reasoning_capability_unknown:${model}`);\n}\n\nfunction claudeThinkingCapability(model: string): \"adaptive\" | \"manual\" | \"unknown\" {\n  if (/^claude-(?:haiku-4-5|sonnet-4-5|opus-4-(?:1|5))(?:-\\d{8})?$/.test(model)) {\n    return \"manual\";\n  }\n  if (/^claude-(?:sonnet|opus)-4-[678](?:-\\d{8})?$/.test(model) ||\n      /^claude-(?:fable|mythos|sonnet|opus)-5(?:-\\d+)?$/.test(model)) {\n    return \"adaptive\";\n  }\n  return \"unknown\";\n}\n\n// Accepts ANY result subtype: error subtypes (error_max_turns, …) carry the\n// same provider `usage` a success does, so the receipt can be built from a\n// failed run too.\ntype ClaudeCredentialRegime = \"metered\" | \"subscription\" | \"unknown\";\n","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/packages/agent/src/claude-runtime.ts#L500-L536","documentation":"Guard in claudeReasoningOptions: claudeThinkingCapability returned something other than 'adaptive' or 'manual' for the configured model, so the harness does not know how to request thinking for it. The model name is embedded.","triggerScenarios":"Thrown at packages/agent/src/claude-runtime.ts:518 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a model whose thinking capability the adapter knows (check claudeThinkingCapability's table)","Update the agent package so its capability table covers the model","Set reasoning: 'off' to bypass thinking configuration for unknown models"],"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"}