{"record":{"id":"b09b82dbed93a959","repo":"kovidgoyal/kitty","slug":"no-valid-action-specified-in-file-transmission-com","errorCode":null,"errorMessage":"No valid action specified in file transmission command","messagePattern":"No valid action specified in file transmission command","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/file_transmission.py","lineNumber":358,"sourceCode":"            field = fmap.get(key)\n            if field is None:\n                return\n            if inspect.isclass(field.type) and issubclass(field.type, Enum):\n                setattr(ans, field.name, field.type[str(val, 'utf-8')])\n            elif field.type == bytes | memoryview:\n                setattr(ans, field.name, base64_decode(val))\n            elif field.type is int:\n                setattr(ans, field.name, int(val))\n            elif field.type is str:\n                if field.metadata.get('base64'):\n                    sval = base64_decode(val).decode('utf-8')\n                else:\n                    sval = safe_string(str(val, 'utf-8'))\n                setattr(ans, field.name, sval)\n\n        parse_ftc(data, handle_item)\n        if ans.action is Action.invalid:\n            raise ValueError('No valid action specified in file transmission command')\n\n        return ans\n\n\nclass IdentityDecompressor:\n    def __call__(self, data: bytes | memoryview, is_last: bool = False) -> bytes:\n        return bytes(data)\n\n\nclass ZlibDecompressor:\n    def __init__(self) -> None:\n        import zlib\n\n        self.d = zlib.decompressobj(wbits=0)\n\n    def __call__(self, data: bytes | memoryview, is_last: bool = False) -> bytes:\n        ans = self.d.decompress(data)\n        if is_last:","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/file_transmission.py#L340-L376","documentation":"FileTransmissionCommand.deserialize parses the OSC 52-style escape sequence payload into a FileTransmissionCommand. If no recognizable action field was set, ans.action remains Action.invalid and the payload is rejected as malformed.","triggerScenarios":"_on_osc / handle_serialized_command receiving an OSC file-transmission sequence whose p1/p2 tokens contain no valid action key, or garbage bytes that parse into no known field.","commonSituations":"A bug in the sending side (kitten/remote app) constructing the escape sequence; a terminal multiplexer or filter mangling escape sequences; log-replay tooling feeding truncated sequences.","solutions":["Verify the emitter builds the sequence with a valid action (e.g. 'action=file' then 'action=data').","Capture the raw sequence and test with kitty --debug-input to spot mangling.","Update both ends to the same kitty protocol version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from kitty.file_transmission import Action\n# before deserialize, sanity-check the raw payload contains an action token\nassert b'action=' in data or data.startswith(('file,', 'data,')), 'no action in payload'","typeGuard":null,"tryCatchPattern":"try:\n    ftc = FileTransmissionCommand.deserialize(data)\nexcept ValueError as e:\n    log_bad_frame(data); return  # drop malformed frame","preventionTips":["Round-trip test your emitter with deserialize in unit tests.","Avoid routing file-transfer escape sequences through filters that may truncate."],"tags":["kitty","file-transfer","protocol","malformed-payload"],"backgroundTag":"protocol-message-invalid","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}