{"record":{"id":"c671ab7fda67f697","repo":"Hmbown/CodeWhale","slug":"unknown-computer","errorCode":"unknown_computer","errorMessage":"no computer registered with id \"${id}\". Use computer_list.","messagePattern":"no computer registered with id \"(.+?)\"\\. Use computer_list\\.","errorType":"error_code","errorClass":"RegistryError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/registry.mjs","lineNumber":62,"sourceCode":"  fs.mkdirSync(stateDir(), { recursive: true });\n  const tmp = registryPath() + \".tmp\";\n  fs.writeFileSync(tmp, JSON.stringify(reg, null, 2) + \"\\n\");\n  fs.renameSync(tmp, registryPath());\n  return reg;\n}\n\nexport function list() {\n  const reg = load();\n  // Keep the local entry truthful even if the state file is stale.\n  reg.computers.local = { ...(reg.computers.local ?? {}), ...localEntry() };\n  if (!reg.computers[reg.active]) reg.active = \"local\";\n  return reg;\n}\n\nexport function get(id) {\n  const reg = list();\n  const c = reg.computers[id];\n  if (!c) throw new RegistryError(\"unknown_computer\", `no computer registered with id \"${id}\". Use computer_list.`);\n  return c;\n}\n\nexport function active() { return get(list().active); }\n\n/** Switch the active computer. Returns the computer entry. */\nexport function switchTo(id) {\n  const c = get(id); // throws unknown_computer\n  const reg = load();\n  reg.active = c.id;\n  save(reg);\n  return c;\n}\n\n/** Register or update a computer. Returns the entry. */\nexport function register({ id, transport, label, ...rest }) {\n  if (!id || !ID_RE.test(id)) throw new RegistryError(\"invalid_id\", \"computer id must match \" + ID_RE);\n  if (![\"local\", \"ssh\", \"hdc\", \"docker\"].includes(transport)) {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/registry.mjs#L44-L80","documentation":"registry.get looks up a computer entry by id in the persisted registry; when no entry with that id exists it throws RegistryError with code 'unknown_computer' and points the caller at computer_list. The registry file exists and parsed fine — the id simply does not match any registered computer.","triggerScenarios":"Calling get(id) or active() with an id that was never registered, an id from a deleted registration, a typo'd/renamed computer id, or a registry file from a different machine/profile that lacks the id; active() also throws this when the stored active id is stale.","commonSituations":"Registry reset or moved between machines leaving ids dangling; renaming a computer then using the old id in scripts; calling get before ever registering a computer; concurrent runs where another process deregistered the entry.","solutions":["Call computer_list (or list()) and use one of the ids it returns.","If no computer exists, register one first via the registry's add/register path, then get it.","Fix the stale active pointer if active() is the thrower — set active to a currently registered id.","Verify you are reading the expected registry (same user/profile/machine) if ids are shared across sessions."],"exampleFix":"// before\nconst computer = registry.get('my-desktop');\n// after\nconst reg = registry.list();\nconst id = reg.computers['my-desktop'] ? 'my-desktop' : Object.keys(reg.computers)[0];\nif (!id) throw new Error('no computers registered — run computer_use_register first');\nconst computer = registry.get(id);","handlingStrategy":"validation","validationCode":"const reg = registry.list();\nconst ids = Object.keys(reg.computers);\nif (!ids.includes(id)) throw new Error(`unknown computer \"${id}\"; registered: ${ids.join(', ')}`);","typeGuard":"const isUnknownComputer = (e) =>\n  e != null && e.code === 'unknown_computer';","tryCatchPattern":"try {\n  return registry.get(id);\n} catch (e) {\n  if (isUnknownComputer(e)) {\n    const reg = registry.list();\n    return registry.get(Object.keys(reg.computers)[0]); // or prompt registration\n  }\n  throw e;\n}","preventionTips":["Discover ids with computer_list instead of hardcoding them.","Re-resolve ids after renaming or re-registering computers.","Refresh the active pointer when it references a deregistered entry.","Confirm the same user/profile registry is being read when ids come from other sessions."],"tags":["registry","lookup","configuration","not-found"],"backgroundTag":"record-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}