stablyai/orca · error · Error
Unable to parse shortcut.
Error message
Unable to parse shortcut.
What it means
Thrown by normalizeWriteBindingValue when normalizeKeybindingArrayForAction returns a non-array result whose .ok is true — i.e. a single normalized binding object instead of the expected array form. The 'Unable to parse shortcut.' message is the fallback when no specific error string was produced, signalling an internal shape inconsistency in the per-action normalizer.
Source
Thrown at src/main/keybindings/keybinding-file.ts:124
return Array.isArray(normalized)
? { ok: true, value: normalized }
: normalized.ok
? { ok: true, value: [normalized.value] }
: normalized
}
return { ok: false, error: 'Use a string, string array, null, or false.' }
}
function normalizeWriteBindingValue(actionId: KeybindingActionId, value: unknown): string[] | null {
if (value === null) {
return null
}
if (!Array.isArray(value) || !value.every((binding) => typeof binding === 'string')) {
throw new Error('Use a string array or null.')
}
const normalized = normalizeKeybindingArrayForAction(actionId, value)
if (!Array.isArray(normalized)) {
throw new Error(normalized.ok ? 'Unable to parse shortcut.' : normalized.error)
}
return normalized
}
function parseBindingSection(
value: unknown,
section: string,
diagnostics: KeybindingFileDiagnostic[],
options: { skipRootKeys?: boolean } = {}
): KeybindingOverrides {
if (value === undefined) {
return {}
}
if (!isJsonObject(value)) {
diagnostics.push({
severity: 'error',
section,
message: `${section} must be an object.`View on GitHub (pinned to 1136503c6a)
Solutions
- Check normalizeKeybindingArrayForAction for the offending actionId and ensure it returns string[] on success.
- Report the actionId to the Orca maintainers with the value that triggered it.
- As a workaround, re-enter the binding through the UI capture control which produces array form.
Example fix
// before
function normalizeKeybindingArrayForAction(actionId, value) { return { ok: true, value: 'Cmd+K' } }
// after
function normalizeKeybindingArrayForAction(actionId, value) { return ['Cmd+K'] } Defensive patterns
Strategy: try-catch
Validate before calling
const normalized = normalizeKeybindingArrayForAction(actionId, value) if (!Array.isArray(normalized)) reportInternalNormalizerShape(actionId, normalized)
Type guard
function isStringArray(v: unknown): v is string[] { return Array.isArray(v) && v.every((x) => typeof x === 'string') } Try / catch
try { writeKeybindingOverride(path, platform, actionId, bindings) }
catch (e) { if (/Unable to parse shortcut/.test(String((e as Error).message))) reportOrcaBug(actionId, bindings); else throw e } Prevention
- Report actionIds that hit this path — it indicates an internal normalizer inconsistency.
- Use the UI capture control to produce well-formed array bindings.
- Add a unit test asserting each KeybindingActionId normalizer returns string[] on success.
When it happens
Trigger: The per-action normalizer for an actionId returned a single-binding success object ({ok:true,value}) rather than an array, while the write path expected an array. This is an internal/programming error, not a user typo.
Common situations: A new KeybindingActionId was added whose normalizer has a different return shape, or the action's binding semantics were changed to single-binding without updating the write path.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Could not normalize legacy binding for "${failedActionIds.jo
- Could not read keybindings file.
- error
- Use a string array or null.
- Unknown keybinding action "${actionId}".
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/65cfca6748ef4e47.
Report an issue: GitHub.