{"record":{"id":"bb3f8ff81eb3a2dd","repo":"musistudio/claude-code-router","slug":"toolhub-mcp-runtime-was-not-found-rebuild-or-rein","errorCode":null,"errorMessage":"ToolHub MCP runtime was not found. Rebuild or reinstall CCR and try again. Checked: ${bundledToolHubMcpEntryPathCandidates().join(\", \")}","messagePattern":"ToolHub MCP runtime was not found\\. Rebuild or reinstall CCR and try again\\. Checked: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/profiles/service.ts","lineNumber":922,"sourceCode":"      model: toolHubResolverModel(config)\n    }\n  });\n  if (!runtime) {\n    return { changed: false };\n  }\n\n  const runtimeResult = ensureToolHubMcpRuntimeFile(entryPath);\n  return {\n    changed: runtimeResult.changed,\n    file: entryPath,\n    runtime\n  };\n}\n\nfunction ensureToolHubMcpRuntimeFile(file: string): { changed: boolean } {\n  const source = bundledToolHubMcpEntryPathCandidates().find((candidate) => existsSync(candidate));\n  if (!source) {\n    throw new Error(`ToolHub MCP runtime was not found. Rebuild or reinstall CCR and try again. Checked: ${bundledToolHubMcpEntryPathCandidates().join(\", \")}`);\n  }\n  return writeGeneratedFileIfChanged(file, readFileSync(source, \"utf8\"), { mode: publicExecutableMode });\n}\n\nfunction resolveCodexConfigFile(profile: ProfileConfig): string {\n  if (profile.agent === \"zcode\") {\n    return resolveZcodeConfigFile(profile);\n  }\n  if (isGeneratedProfileScope(profile.scope)) {\n    return path.join(ccrManagedProfileDir(profile), codexConfigSubdir(profile.agent), \"config.toml\");\n  }\n  const codexHome = profile.codexHome?.trim();\n  if (codexHome) {\n    return path.join(resolveUserPath(codexHome), \"config.toml\");\n  }\n  return resolveUserPath(profile.configFile || defaultCodexConfigFile(profile.agent));\n}\n","sourceCodeStart":904,"sourceCodeEnd":940,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/service.ts#L904-L940","documentation":"Error \"ToolHub MCP runtime was not found. Rebuild or reinstall CCR and try again. Checked: ${bundledToolHubMcpEntryPathCandidates().join(\", \")}\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/core/src/profiles/service.ts:922 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}