{"record":{"id":"28a55a633cc91f9e","repo":"facebook/flow","slug":"unsupported-cli-socket-command","errorCode":null,"errorMessage":"Unsupported CLI socket command: {}","messagePattern":"Unsupported CLI socket command: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust_port/crates/flow_server_env/src/server_socket_rpc.rs","lineNumber":697,"sourceCode":"                input,\n                target,\n                verbose,\n                location_is_strict,\n                wait_for_recheck,\n                omit_targ_defaults,\n            } => Self::INSERT_TYPE {\n                input: input.into(),\n                target: target.into(),\n                verbose: verbose.map(VerboseWire::from),\n                location_is_strict,\n                wait_for_recheck,\n                omit_targ_defaults,\n            },\n            server_prot::request::Command::LLM_CONTEXT(input) => Self::LLM_CONTEXT(input.into()),\n            server_prot::request::Command::STATUS { include_warnings } => {\n                Self::STATUS { include_warnings }\n            }\n            command => panic!(\n                \"Unsupported CLI socket command: {}\",\n                server_prot::request::to_string(&command)\n            ),\n        }\n    }\n}\n\nimpl CliCommand {\n    pub fn into_server_command(self) -> server_prot::request::Command {\n        match self {\n            CliCommand::APPLY_CODE_ACTION {\n                input,\n                action,\n                wait_for_recheck,\n            } => server_prot::request::Command::APPLY_CODE_ACTION {\n                input: input.into_server_file_input(),\n                action: action.into(),\n                wait_for_recheck,","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_server_env/src/server_socket_rpc.rs#L679-L715","documentation":"The CLI socket layer converts each incoming server_prot request Command into a CliCommand. The match covers every command the CLI knows; a command with no CLI representation hits this panic, printing the wire name of the command. In practice this fires on protocol skew: the wire enum deserializes fine, but the running server binary predates the command.","triggerScenarios":"A newer CLI or editor plugin sends a newly added command (e.g. LLM_CONTEXT-era additions) to a long-running older daemon on the socket: deserialization succeeds because the wire format is forward-compatible, then the TryInto<CliCommand> conversion panics on the unrecognized variant and kills the request handler.","commonSituations":"A daemon that survived a package upgrade still listening on the old socket; multiple Flow versions on PATH so client and server resolve to different releases; IDE plugin auto-updating ahead of the CLI; stale connections reused after a version bump.","solutions":["Stop the stale daemon so the next command spawns a server of the current version: flow stop (or kill the pid recorded in the server lock/log), then retry the command.","Verify client and server versions match: flow version against the version the daemon logs at startup.","Pin the editor plugin and CLI to the same release until daemons have been restarted.","If you maintain a fork, map unknown commands to an error response instead of a panic in this conversion."],"exampleFix":"# before: old daemon still serving a new CLI's commands\nflow lsp suggest ...  # panic: Unsupported CLI socket command: ...\n\n# after: recycle the daemon so versions match\nflow stop && flow lsp suggest ...","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match send_command(cmd) {\n    Ok(resp) => resp,\n    Err(e) if is_unsupported_command(&e) => {\n        flow_stop(&root)?;             // recycle the stale daemon\n        wait_for_socket_release(&root)?;\n        send_command(cmd)              // retry against a fresh, same-version server\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Restart all flow daemons right after upgrading the CLI or IDE plugin.","Keep exactly one Flow installation on PATH so client and server cannot skew.","Add a version handshake to your client: read the server's version before sending commands.","Treat 'Unsupported CLI socket command' as a recycle signal in supervision tooling, not a bug report."],"tags":["protocol","version-mismatch","socket","cli","server","upgrade"],"backgroundTag":"client-server-version-mismatch","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}