{"record":{"id":"e5d4d1a2ceb188d8","repo":"kovidgoyal/kitty","slug":"must-specify-an-action","errorCode":null,"errorMessage":"Must specify an action","messagePattern":"Must specify an action","errorType":"exception","errorClass":"RemoteControlErrorWithoutTraceback","httpStatus":null,"severity":"error","filePath":"kitty/rc/action.py","lineNumber":71,"sourceCode":"    )\n\n    args = RemoteCommand.Args(\n        spec='ACTION [ARGS FOR ACTION...]',\n        json_field='action',\n        minimum_count=1,\n        completion=RemoteCommand.CompletionSpec.from_string('type:special group:complete_actions'),\n    )\n\n    def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:\n        return {'action': ' '.join(args), 'self': opts.self, 'match_window': opts.match}\n\n    def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType:\n        w = self.windows_for_match_payload(boss, window, payload_get)\n        if w:\n            window = w[0]\n        ac = payload_get('action')\n        if not ac:\n            raise RemoteControlErrorWithoutTraceback('Must specify an action')\n\n        try:\n            consumed = boss.combine(str(ac), window, raise_error=True)\n        except (Exception, SystemExit) as e:\n            raise RemoteControlErrorWithoutTraceback(str(e))\n\n        if not consumed:\n            raise RemoteControlErrorWithoutTraceback(f'Unknown action: {ac}')\n        return None\n\n\naction = Action()\n","sourceCodeStart":53,"sourceCodeEnd":84,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/rc/action.py#L53-L84","documentation":"Thrown by the @ action remote-control command in kitty when the payload contains no 'action' field. The remote control API requires an action string (e.g. 'send_text', 'scroll_line_down', or a keymap definition) to execute; an empty payload is rejected with RemoteControlErrorWithoutTraceback, which prints the message to the remote-control client without a Python traceback.","triggerScenarios":"Running 'kitten @ action' with no --action/-a argument, or constructing a raw remote-control payload (JSON or escape-code based) that omits the 'action' key.","commonSituations":"Shell scripts that build the command dynamically and pass an empty string, passing action args in the wrong position, or JSON payloads with a typo'd key like 'actions'.","solutions":["Pass the action explicitly: kitten @ action --action=send_text or use the shorthand kitten @ action send_text msg Hello","Check the action name is a valid kitty action (see the mappings/actions docs or 'kitten @ run --help')","If scripting raw payloads, verify the 'action' key exists and is non-empty before sending"],"exampleFix":"# before\nkitten @ action\n\n# after\nkitten @ action send_text all Hello","handlingStrategy":"validation","validationCode":"ac = payload.get('action') if isinstance(payload, dict) else payload_get('action')\nif not ac:\n    raise SystemExit('refusing to send action rc command without an action')\nsubprocess.run(['kitten', '@', 'action', str(ac)], check=True)","typeGuard":"def has_action_payload(payload: dict) -> bool:\n    return bool(payload.get('action')) and isinstance(payload['action'], str)","tryCatchPattern":"from kittens.rpc import RemoteControlErrorWithoutTraceback  # conceptually\ntry:\n    run_action_rc(ac)\nexcept RemoteControlErrorWithoutTraceback as e:\n    print(f'action rc failed: {e}')  # message printed without traceback; handle gracefully","preventionTips":["Always build the action command with a required, non-empty --action value in scripts","Fail fast on empty action variables before shelling out"],"tags":["kitty","remote-control","action","cli"],"backgroundTag":"missing-required-parameter","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}