{"record":{"id":"4dab3c35cfcabece","repo":"JuliusBrussee/caveman","slug":"caveman-mcp-compatible-probe-version-lacks-curr","errorCode":null,"errorMessage":"caveman-mcp ${compatible.probe.version} lacks current mcp_recovery capability; run `caveman setup --install`","messagePattern":"caveman-mcp (.+?) lacks current mcp_recovery capability; run `caveman setup --install`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":6987,"sourceCode":"  try {\n    unlinkSync(path);\n    fsyncParentDirectory(path);\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n  }\n}\n\nfunction parseJsonFileObject(path: string, bytes: Buffer | null): Record<string, unknown> {\n  if (!bytes || bytes.length === 0) return {};\n  const parsed = JSON.parse(bytes.toString(\"utf8\"));\n  if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) throw new Error(`${path} is not a JSON object`);\n  return parsed as Record<string, unknown>;\n}\n\nfunction nativeMcpBinaryRequired(): string {\n  const compatible = probeMcpBinary();\n  if (!compatible) throw new Error(\"caveman-mcp not found; run `caveman setup --install`\");\n  if (!compatible.probe.current) throw new Error(`caveman-mcp ${compatible.probe.version} lacks current mcp_recovery capability; run \\`caveman setup --install\\``);\n  return compatible.binary;\n}\n\nfunction nativeProxyBinaryRequired(gw: string): void {\n  if (wrapMode(gw) !== \"local\") return;\n  const binary = resolveGoBin(\"caveman-proxy\", \"CAVEMAN_PROXY_BIN\");\n  if (!binary) throw new Error(\"caveman-proxy not found; run `caveman setup --install`\");\n  const probe = probeVersionedBinary(binary, \"native_runtime_v1\");\n  if (!probe.current) throw new Error(`caveman-proxy ${probe.version} lacks current native_runtime_v1 capability; run \\`caveman setup --install\\``);\n}\n\nfunction nativeHostProbe(agent: AgentProfile): { binary: string | null; launchable: boolean; version: string | null; error: string | null } {\n  const binary = which(binOf(agent));\n  if (!binary) return { binary: null, launchable: false, version: null, error: \"binary_not_found\" };\n  try {\n    const invocation = portableInvocation(binary, [\"--version\"]);\n    const out = spawnSync(invocation.command, invocation.args, { encoding: \"utf8\", timeout: 3000 });\n    if (out.error) return { binary, launchable: false, version: null, error: boundedHookString(out.error.message, 240) ?? \"version_probe_failed\" };","sourceCodeStart":6969,"sourceCodeEnd":7005,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L6969-L7005","documentation":"The CLI requires the companion `caveman-mcp` binary to advertise the current `mcp_recovery` capability before it will wire it up. `nativeMcpBinaryRequired()` probes the binary with `probeMcpBinary()`; if the probe reports `current: false`, the installed binary is either too old or a stale cached build that predates the capability. The fix is to reinstall the binary via `caveman setup --install`.","triggerScenarios":"Calling any CLI command that resolves the native MCP binary via `nativeMcpBinaryRequired()` when the probe finds a caveman-mcp binary but its reported version/capability set does not include the current mcp_recovery capability (`compatible.probe.current === false`).","commonSituations":"Upgrading the CLI (npm) without re-running `caveman setup --install`, so an older caveman-mcp from a previous release is still on PATH; a leftover binary in ~/.caveman/bin from an old install; partial upgrades where the probe cache has a stale version.","solutions":["Run `caveman setup --install` to download/install a current caveman-mcp binary","Remove the stale caveman-mcp binary (check PATH and ~/.caveman/bin) and re-run setup","Reinstall/upgrade the caveman CLI package so binary and CLI versions match, then re-run setup","Check `caveman doctor` output to confirm the probe now reports current"],"exampleFix":"// before: stale binary left from previous install\n$ caveman serve  # throws: caveman-mcp 0.9.2 lacks current mcp_recovery capability\n// after\n$ caveman setup --install   # installs current caveman-mcp\n$ caveman serve             # proceeds","handlingStrategy":"validation","validationCode":"// Before invoking CLI commands that need the native MCP binary:\nconst probe = probeMcpBinary();\nif (!probe || !probe.probe.current) {\n  console.warn('caveman-mcp outdated/missing — run: caveman setup --install');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCaveman(args);\n} catch (e) {\n  if (String(e.message).includes('lacks current mcp_recovery capability')) {\n    await exec('caveman setup --install');\n    return retry();\n  }\n  throw e;\n}","preventionTips":["Always re-run `caveman setup --install` after upgrading the caveman CLI package","Pin CLI and Go binary versions to matching releases","Run `caveman doctor` in CI before invoking commands that need native binaries","Don't keep stale caveman-mcp copies earlier on PATH than the managed install"],"tags":["cli","binary-version","capability-probe","setup"],"backgroundTag":"incompatible-source-type","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"}