NousResearch/hermes-agent · error

Rename is not available

Error message

Rename is not available

What it means

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.

Source

Thrown at apps/desktop/src/lib/desktop-fs.ts:140

export async function desktopDefaultCwd(): Promise<{ branch: string; cwd: string } | null> {
  if (!isDesktopFsRemoteMode()) {
    return null
  }

  return remoteFsApi<{ branch: string; cwd: string }>('/api/fs/default-cwd')
}

// Reveal a path in the OS file manager (Finder / Explorer / Files). Local only.
export async function revealDesktopPath(path: string): Promise<void> {
  await bridge().revealPath?.(path)
}

// Rename a file/folder in place; returns the new absolute path. Local only.
export async function renameDesktopPath(path: string, newName: string): Promise<string> {
  const desktop = bridge()

  if (!desktop.renamePath) {
    throw new Error('Rename is not available')
  }

  const result = await desktop.renamePath(path, newName)

  return result.path
}

// Move a file/folder to the OS trash (recoverable). Local only.
export async function trashDesktopPath(path: string): Promise<void> {
  const desktop = bridge()

  if (!desktop.trashPath) {
    throw new Error('Delete is not available')
  }

  await desktop.trashPath(path)
}

View on GitHub (pinned to c896c09c42)

Solutions

  1. Hide the rename affordance when the capability is missing: `if (!window.hermesDesktop?.renamePath) hideRename()`.
  2. Update/restart the desktop app to a shell that ships renamePath.
  3. For remote sessions, provide the rename via the backend API instead of the local bridge.
  4. In tests, add renamePath to the bridge stub.

Example fix

// before
const newPath = await renameDesktopPath(path, newName)

// after
if (!window.hermesDesktop?.renamePath) {
  notify({ kind: 'error', title: 'Rename requires an updated desktop app' })
  return
}
const newPath = await renameDesktopPath(path, newName)
Defensive patterns

Strategy: type-guard

Validate before calling

function canRename(): boolean {
  return typeof window.hermesDesktop?.renamePath === 'function'
}

Type guard

function hasRename(w: Window): w is Window & { hermesDesktop: { renamePath: (p: string, n: string) => Promise<{ path: string }> } } {
  return typeof (w as any).hermesDesktop?.renamePath === 'function'
}

Try / catch

if (!canRename()) { hideRenameAction(); return }
try { const next = await renameDesktopPath(path, newName) } catch (e) { notifyError(e, 'Rename failed') }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/5627d36ef88f0e28. Report an issue: GitHub.