{"record":{"id":"5627d36ef88f0e28","repo":"NousResearch/hermes-agent","slug":"rename-is-not-available","errorCode":null,"errorMessage":"Rename is not available","messagePattern":"Rename is not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/lib/desktop-fs.ts","lineNumber":140,"sourceCode":"export async function desktopDefaultCwd(): Promise<{ branch: string; cwd: string } | null> {\n  if (!isDesktopFsRemoteMode()) {\n    return null\n  }\n\n  return remoteFsApi<{ branch: string; cwd: string }>('/api/fs/default-cwd')\n}\n\n// Reveal a path in the OS file manager (Finder / Explorer / Files). Local only.\nexport async function revealDesktopPath(path: string): Promise<void> {\n  await bridge().revealPath?.(path)\n}\n\n// Rename a file/folder in place; returns the new absolute path. Local only.\nexport async function renameDesktopPath(path: string, newName: string): Promise<string> {\n  const desktop = bridge()\n\n  if (!desktop.renamePath) {\n    throw new Error('Rename is not available')\n  }\n\n  const result = await desktop.renamePath(path, newName)\n\n  return result.path\n}\n\n// Move a file/folder to the OS trash (recoverable). Local only.\nexport async function trashDesktopPath(path: string): Promise<void> {\n  const desktop = bridge()\n\n  if (!desktop.trashPath) {\n    throw new Error('Delete is not available')\n  }\n\n  await desktop.trashPath(path)\n}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/lib/desktop-fs.ts#L122-L158","documentation":"Thrown by renameDesktopPath() in apps/desktop/src/lib/desktop-fs.ts:140 when the bridge has no `renamePath` capability. Rename is a LOCAL-ONLY desktop IPC capability; when the preload bridge does not expose it (older shell, web context, partial stub), the function refuses with this error instead of attempting anything.","triggerScenarios":"Invoking renameDesktopPath when window.hermesDesktop is undefined... no — bridge() already covers that; this fires when the bridge exists but renamePath is absent: older Electron build, remote-gateway session (rename intentionally not offered remotely), test stub without renamePath.","commonSituations":"Renderer newer than the installed shell after a partial update; running against a remote backend where the file lives on another machine so local rename is deliberately unsupported; feature-flagged preloads.","solutions":["Hide the rename affordance when the capability is missing: `if (!window.hermesDesktop?.renamePath) hideRename()`.","Update/restart the desktop app to a shell that ships renamePath.","For remote sessions, provide the rename via the backend API instead of the local bridge.","In tests, add renamePath to the bridge stub."],"exampleFix":"// before\nconst newPath = await renameDesktopPath(path, newName)\n\n// after\nif (!window.hermesDesktop?.renamePath) {\n  notify({ kind: 'error', title: 'Rename requires an updated desktop app' })\n  return\n}\nconst newPath = await renameDesktopPath(path, newName)","handlingStrategy":"type-guard","validationCode":"function canRename(): boolean {\n  return typeof window.hermesDesktop?.renamePath === 'function'\n}","typeGuard":"function hasRename(w: Window): w is Window & { hermesDesktop: { renamePath: (p: string, n: string) => Promise<{ path: string }> } } {\n  return typeof (w as any).hermesDesktop?.renamePath === 'function'\n}","tryCatchPattern":"if (!canRename()) { hideRenameAction(); return }\ntry { const next = await renameDesktopPath(path, newName) } catch (e) { notifyError(e, 'Rename failed') }","preventionTips":["Rename is local-only — hide it for remote sessions","Capability-check before rendering context-menu items","Update the shell when new IPC capabilities ship","Test rename flows with a full bridge stub"],"tags":["desktop","electron","filesystem","rename","capability"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}