{"record":{"id":"150f433d2744e4d2","repo":"kovidgoyal/kitty","slug":"unknown-notify-on-cmd-finish-action-parts-2","errorCode":null,"errorMessage":"Unknown notify_on_cmd_finish action: {parts[2]}","messagePattern":"Unknown notify_on_cmd_finish action: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":930,"sourceCode":"    action: str = 'notify'\n    cmdline: tuple[str, ...] = ()\n    clear_on: tuple[ClearOn, ...] = default_clear_on\n\n\ndef notify_on_cmd_finish(x: str) -> NotifyOnCmdFinish:\n    parts = x.split(maxsplit=3)\n    if parts[0] not in ('never', 'unfocused', 'invisible', 'always'):\n        raise ValueError(f'Unknown notify_on_cmd_finish value: {parts[0]}')\n    when = parts[0]\n    duration = 5.0\n    if len(parts) > 1:\n        duration = float(parts[1])\n    action = 'notify'\n    cmdline: tuple[str, ...] = ()\n    clear_on = default_clear_on\n    if len(parts) > 2:\n        if parts[2] not in ('notify', 'bell', 'notify-bell', 'command'):\n            raise ValueError(f'Unknown notify_on_cmd_finish action: {parts[2]}')\n        action = parts[2]\n        if action.startswith('notify'):\n            if len(parts) > 3:\n                con: list[ClearOn] = []\n                for x in parts[3].split():\n                    if x not in all_clear_on:\n                        raise ValueError(f'notify_on_cmd_finish: notify clear_on value \"{x}\" is invalid. Valid values are: {\", \".join(all_clear_on)}')\n                    con.append(cast(ClearOn, x))\n                clear_on = tuple(con)\n        elif action == 'command':\n            if len(parts) > 3:\n                cmdline = tuple(to_cmdline(parts[3]))\n            else:\n                raise ValueError('notify_on_cmd_finish `command` action needs a command line')\n    return NotifyOnCmdFinish(when, duration, action, cmdline, clear_on)\n\n\ndef config_or_absolute_path(x: str, env: dict[str, str] | None = None) -> str | None:","sourceCodeStart":912,"sourceCodeEnd":948,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L912-L948","documentation":"Raised by notify_on_cmd_finish when the third token (the action) is not one of notify, bell, notify-bell, command. The action selects how the finish is signaled.","triggerScenarios":"notify_on_cmd_finish always 5.0 sound, or any misspelled action token when three or more tokens are present.","commonSituations":"Typos ('comand'), or expecting action names from other tools (e.g. 'alert').","solutions":["Use notify, bell, notify-bell, or command as the action","Omit the action to default to notify"],"exampleFix":"# before\nnotify_on_cmd_finish always 5.0 alart\n# after\nnotify_on_cmd_finish always 5.0 notify","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def is_notify_action(x: str) -> bool:\n    return x in ('notify','bell','notify-bell','command')","tryCatchPattern":null,"preventionTips":["Omit the action token unless you need bell/command behavior"],"tags":["kitty","config","notifications"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}