{"record":{"id":"35d47f8806783c9a","repo":"kovidgoyal/kitty","slug":"unsupported-version-received-in-edit-protocol-se","errorCode":null,"errorMessage":"Unsupported version received in edit protocol: {self.version}","messagePattern":"Unsupported version received in edit protocol: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/launch.py","lineNumber":1021,"sourceCode":"        for k, v in parse_message(msg, simple):\n            if k == 'file_inode':\n                q = map(int, v.split(':'))\n                self.file_inode = next(q), next(q)\n                self.file_size = next(q)\n            elif k == 'a':\n                self.args.append(v)\n            elif k == 'file_data':\n                import base64\n\n                self.file_data = base64.standard_b64decode(v)\n            elif k == 'version':\n                self.version = int(v)\n            else:\n                setattr(self, k, v)\n        if self.abort_signaled:\n            return\n        if self.version > 0:\n            raise ValueError(f'Unsupported version received in edit protocol: {self.version}')\n        self.opts, extra_args = parse_opts_for_clone(['--type=overlay'] + self.args)\n        self.file_spec = extra_args.pop()\n        self.line_number = 0\n        import re\n\n        pat = re.compile(r'\\+(-?\\d+)')\n        for x in extra_args:\n            m = pat.match(x)\n            if m is not None:\n                self.line_number = int(m.group(1))\n        self.file_name = os.path.basename(self.file_spec)\n        self.file_localpath = os.path.normpath(os.path.join(self.cwd, self.file_spec))\n        self.is_local_file = False\n        with suppress(OSError):\n            st = os.stat(self.file_localpath)\n            self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode and os.access(self.file_localpath, os.W_OK | os.R_OK)\n        if not self.is_local_file:\n            import tempfile","sourceCodeStart":1003,"sourceCodeEnd":1039,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/launch.py#L1003-L1039","documentation":"Raised by the edit/clone protocol kitten when the version number sent by the remote peer is greater than 0 (this build only speaks version 0 of the protocol). It is a protocol-negotiation failure: the value arrived in the message payload (e.g. via a 'v' key parsed as an integer), so the other side is newer or speaking a different protocol.","triggerScenarios":"Calling the kitten (e.g. kitty @ launch --type=overlay clone or the hints/scrollback 'edit in kitty' flow) against a kitty instance or remote-control message that includes a protocol version > 0; also any custom client that sends {\"v\": 1, ...}.","commonSituations":"Mixing kitty versions (newer kitty client talking to older kitty server, or vice versa), or a hand-rolled remote-control script that adds a version field. Upgrading one side of a socket/ssh setup without the other.","solutions":["Make sure both ends of the connection run the same (or compatible) kitty version; restart the listening kitty instance after upgrading","If writing a custom client, do not send a 'v' field or send v=0","Check that the message payload only contains keys this protocol version defines"],"exampleFix":"// before\npayload = {'v': 1, 'args': [...], 'file': 'f.txt'}\n// after\npayload = {'args': [...], 'file': 'f.txt'}","handlingStrategy":"validation","validationCode":"version = payload.get('v', 0)\nif not isinstance(version, int) or version > 0:\n    raise ValueError('peer speaks unsupported edit protocol version')","typeGuard":null,"tryCatchPattern":"try:\n    req = CloneRequest.parse(payload)\nexcept ValueError as e:\n    log.warning('edit protocol handshake failed: %s', e)\n    reconnect_with_matching_version()","preventionTips":["Pin both kitty ends to the same version","Never inject a 'v' key into edit-protocol payloads unless implementing a newer spec","Version-gate custom remote-control clients"],"tags":["kitty","protocol","version-mismatch","remote-control"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}