stablyai/orca · warning · Error

Preset name is too long.

Error message

Preset name is too long.

What it means

Thrown by normalizeSparsePresetName when the trimmed name exceeds 80 characters. This guards storage and UI display width. It runs only after the empty-name check (1289) passes, so the input is guaranteed non-empty.

Source

Thrown at src/main/ipc/repos.ts:2769

    // Why: a broadcast failure must never fail the mutation the user actually asked for.
    console.error('[repos] failed to notify remote clients of repo change', err)
  }
  scheduleCurrentWorktreeBaseDirectoryWatcherSync()
}

function notifySparsePresetsChanged(mainWindow: BrowserWindow, repoId: string): void {
  if (!mainWindow.isDestroyed()) {
    mainWindow.webContents.send('sparsePresets:changed', { repoId })
  }
}

function normalizeSparsePresetName(name: string): string {
  const trimmed = name.trim()
  if (!trimmed) {
    throw new Error('Preset name is required.')
  }
  if (trimmed.length > 80) {
    throw new Error('Preset name is too long.')
  }
  return trimmed
}

function normalizeSparsePresetDirectories(directories: string[]): string[] {
  let normalized: string[]
  try {
    normalized = normalizeSparseDirectories(directories)
  } catch (err) {
    if (
      err instanceof Error &&
      err.message === 'Sparse checkout directories must be repo-relative paths.'
    ) {
      throw new Error('Preset directories must be repo-relative paths.')
    }
    throw err
  }
  if (normalized.length === 0) {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Enforce maxlength=80 on the name input in the renderer.
  2. Validate name.trim().length <= 80 before the IPC call.
  3. Truncate generated names to <=80 chars with a visible ellipsis policy.
  4. On catch, highlight the input and report the 80-character limit.

Example fix

// before
<input value={name} onChange={(e) => setName(e.target.value)} />

// after
<input
  value={name}
  maxLength={80}
  onChange={(e) => setName(e.target.value)}
/>
// plus renderer guard:
if (name.trim().length > 80) { setError('Max 80 characters'); return }
Defensive patterns

Strategy: validation

Validate before calling

const name = rawName.trim()
if (name.length > 80) {
  setError(`Name must be 80 characters or fewer (currently ${name.length})`)
  return
}
await ipc.invoke('sparsePresets:save', { repoId, name, directories })

Type guard

function isValidPresetNameLength(value: unknown): value is string {
  return typeof value === 'string' && value.trim().length > 0 && value.trim().length <= 80
}

Try / catch

try {
  await ipc.invoke('sparsePresets:save', { repoId, name, directories })
} catch (e) {
  if (/too long/i.test((e as Error).message)) setError('Name must be 80 characters or fewer.')
  else throw e
}

Prevention

When it happens

Trigger: A user pastes a long descriptive title, or a programmatic flow uses a generated string (e.g. a full path or timestamp list) as the preset name. Any name over 80 chars after trim triggers it.

Common situations: Auto-generated names from directory lists; users copying commit messages or filenames as labels; migration importing verbose external names.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/67b2942eec3d356f. Report an issue: GitHub.