{"record":{"id":"044be593f985d260","repo":"JuliusBrussee/caveman","slug":"caveman-proxy-probe-version-lacks-current-nativ","errorCode":null,"errorMessage":"caveman-proxy ${probe.version} lacks current native_runtime_v1 capability; run `caveman setup --install`","messagePattern":"caveman-proxy (.+?) lacks current native_runtime_v1 capability; run `caveman setup --install`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":6996,"sourceCode":"  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\" };\n    const value = `${out.stdout ?? \"\"} ${out.stderr ?? \"\"}`.trim();\n    if (out.status !== 0) return { binary, launchable: false, version: value ? value.slice(0, 160) : null, error: `version_probe_exit_${out.status ?? \"unknown\"}` };\n    return { binary, launchable: true, version: value ? value.slice(0, 160) : null, error: null };\n  } catch {\n    return { binary, launchable: false, version: null, error: \"version_probe_failed\" };\n  }\n}\n\nfunction detectedAgentVersion(agent: AgentProfile): string | null { return nativeHostProbe(agent).version; }","sourceCodeStart":6978,"sourceCodeEnd":7014,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L6978-L7014","documentation":"After locating the `caveman-proxy` binary, the CLI probes it with `probeVersionedBinary(binary, \"native_runtime_v1\")`. If the binary's reported version does not support the current `native_runtime_v1` capability, it is stale relative to the CLI and is refused to avoid protocol mismatches. Reinstall via `caveman setup --install` to get a matching binary.","triggerScenarios":"Calling `nativeProxyBinaryRequired(gw)` with `wrapMode(gw) === \"local\"` where caveman-proxy exists and is found, but `probeVersionedBinary(binary, \"native_runtime_v1\").current` is false — i.e. the binary predates the current native runtime protocol.","commonSituations":"Upgrading the CLI npm package without re-running setup, leaving an older caveman-proxy; manually copying an old binary into the bin directory; pinning CAVEMAN_PROXY_BIN to a project-local outdated build.","solutions":["Run `caveman setup --install` to replace caveman-proxy with a current build","Remove the outdated binary and re-run setup so the fresh one is fetched","Update the pinned CAVEMAN_PROXY_BIN path to the newly installed binary","Run `caveman doctor` to confirm the probe reports current before retrying"],"exampleFix":"// before: pinned old build\nexport CAVEMAN_PROXY_BIN=~/tools/caveman-proxy-0.8.1\n// after\n$ caveman setup --install\nunset CAVEMAN_PROXY_BIN  # let resolveGoBin pick the current install","handlingStrategy":"validation","validationCode":"const probe = probeVersionedBinary(proxyPath, 'native_runtime_v1');\nif (!probe.current) {\n  console.warn(`caveman-proxy ${probe.version} outdated — run: caveman setup --install`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await startProxy();\n} catch (e) {\n  if (String(e.message).includes('lacks current native_runtime_v1 capability')) {\n    await exec('caveman setup --install');\n    return startProxy();\n  }\n  throw e;\n}","preventionTips":["Upgrade binaries and CLI together; never pin CAVEMAN_PROXY_BIN to an old build","Re-run `caveman setup --install` after npm upgrades","Add a version check (`caveman doctor`) to CI pipelines","Avoid manually copying caveman-proxy binaries between machines"],"tags":["cli","binary-version","capability-probe","proxy"],"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"}