{"record":{"id":"3c0f1b025c91ae12","repo":"multica-ai/multica","slug":"runtime-local-skill-discovery-failed","errorCode":null,"errorMessage":"runtime local skill discovery failed","messagePattern":"runtime local skill discovery failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/runtimes/local-skills.ts","lineNumber":45,"sourceCode":"const IMPORT_POLL_TIMEOUT_MS = 4 * 60_000; // 4 minutes\n\nexport async function resolveRuntimeLocalSkills(\n  runtimeId: string,\n): Promise<RuntimeLocalSkillsResult> {\n  const initial = await api.initiateListLocalSkills(runtimeId);\n  const start = Date.now();\n  let current = initial;\n\n  while (current.status === \"pending\" || current.status === \"running\") {\n    if (Date.now() - start > POLL_TIMEOUT_MS) {\n      throw new Error(\"runtime local skill discovery timed out\");\n    }\n    await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));\n    current = await api.getListLocalSkillsResult(runtimeId, initial.id);\n  }\n\n  if (current.status === \"failed\" || current.status === \"timeout\") {\n    throw new Error(current.error || \"runtime local skill discovery failed\");\n  }\n\n  return {\n    skills: current.skills ?? [],\n    supported: current.supported,\n\tmcpServers: current.mcp_servers ?? [],\n\tmcpSupported: current.mcp_supported === true,\n  };\n}\n\nexport async function resolveRuntimeLocalSkillImport(\n  runtimeId: string,\n  payload: CreateRuntimeLocalSkillImportRequest,\n): Promise<RuntimeLocalSkillImportResult> {\n  const initial = await api.initiateImportLocalSkill(runtimeId, payload);\n  const start = Date.now();\n  let current = initial;\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/packages/core/runtimes/local-skills.ts#L27-L63","documentation":"Wrap thrown by prepareHermesHome when writeDerivedHermesConfig fails. The derived config is re-derived from the shared home's config plus the task's env overrides and written into the overlay; it can hold inline api_key secrets. Fail-closed by design: a Hermes that would boot without the derived config could miss its providers/keys, so prepare aborts instead.","triggerScenarios":"writeDerivedHermesConfig(sharedHome, hermesHome, env, logger) errors — the shared config is unreadable or unparseable, a required value cannot be rendered, or the derived file cannot be written into hermes-home (permissions/full disk).","commonSituations":"User hand-edited the shared hermes config into invalid syntax; env override map contains values that cannot be represented in the config format; leftover derived config in a recycled overlay owned by another user; env var interpolation producing invalid content.","solutions":["Validate the shared home's config file parses (e.g. `hermes` CLI or a local parse) and repair syntax errors.","Sanitize env override values passed via params.HermesEnv; drop keys that are not valid config inputs.","Fix write permissions/ownership of the overlay's config path or delete the stale overlay.","Free disk space and retry."],"exampleFix":"# before: invalid line in shared config\n$ cat ~/.hermes/config.toml\napi_key =  broken  ← syntax error\n\n# after\napi_key = \"sk-...\"   # quoted, valid","handlingStrategy":"validation","validationCode":"if _, err := toml.ParseFile(filepath.Join(sharedHome, \"config.toml\")); err != nil { // or hermes CLI check\n    return fmt.Errorf(\"shared hermes config invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := prepareHermesHome(...); err != nil {\n    if strings.Contains(err.Error(), \"derive hermes config\") {\n        // surface the wrapped parse/write error; repair the shared config or env overrides; no silent minimal-config fallback\n    }\n}","preventionTips":["Lint the shared hermes config on change (parse check).","Whitelist which HermesEnv keys may override config.","Version the hermes config format with the daemon upgrade."],"tags":["go","hermes","execenv","config","secrets","fail-closed"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}