{"record":{"id":"8fbc9a5052e02d22","repo":"zellij-org/zellij","slug":"failed-to-convert-serialized-command","errorCode":null,"errorMessage":"failed to convert serialized command: {}","messagePattern":"failed to convert serialized command: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"zellij-server/src/plugins/zellij_exports.rs","lineNumber":174,"sourceCode":"    }\n}\n\npub fn zellij_exports(linker: &mut Linker<PluginEnv>) {\n    linker\n        .func_wrap(\"zellij\", \"host_run_plugin_command\", host_run_plugin_command)\n        .unwrap();\n}\n\nfn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {\n    let mut env = caller.data_mut();\n    let plugin_command = env.name();\n    let err_context = || format!(\"failed to run plugin command {}\", plugin_command);\n    wasi_read_bytes(env)\n        .and_then(|bytes| {\n            let command: ProtobufPluginCommand = ProtobufPluginCommand::decode(bytes.as_slice())?;\n            let command: PluginCommand = command\n                .try_into()\n                .map_err(|e| anyhow!(\"failed to convert serialized command: {}\", e))?;\n            match check_command_permission(&env, &command) {\n                (PermissionStatus::Granted, _) => match command {\n                    PluginCommand::Subscribe(event_list) => subscribe(env, event_list)?,\n                    PluginCommand::Unsubscribe(event_list) => unsubscribe(env, event_list)?,\n                    PluginCommand::SetSelectable(selectable) => set_selectable(env, selectable),\n                    PluginCommand::ShowCursor(cursor_position) => show_cursor(env, cursor_position),\n                    PluginCommand::GetPluginIds => get_plugin_ids(env),\n                    PluginCommand::GetZellijVersion => get_zellij_version(env),\n                    PluginCommand::GenerateRandomName => generate_random_name(env),\n                    PluginCommand::DumpLayout(layout_name) => dump_layout(env, layout_name),\n                    PluginCommand::ParseLayout(layout_string) => parse_layout(env, layout_string),\n                    PluginCommand::GetLayoutDir => get_layout_dir(env),\n                    PluginCommand::GetFocusedPaneInfo => get_focused_pane_info(env),\n                    PluginCommand::SaveSession => save_session(env),\n                    PluginCommand::CurrentSessionLastSavedTime => {\n                        current_session_last_saved_time(env)\n                    },\n                    PluginCommand::GetPaneInfo(pane_id) => get_pane_info(env, pane_id),","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/plugins/zellij_exports.rs#L156-L192","documentation":"host_run_plugin_command decodes a ProtobufPluginCommand from the plugin's WASI bytes and converts it to the internal PluginCommand enum. This error means decoding succeeded but the TryInto to PluginCommand failed — typically an unknown or unsupported command discriminant.","triggerScenarios":"A plugin compiled against a newer/older zellij-tile SDK emits a command variant the host does not know; the plugin writes malformed bytes that decode to an unmapped tag.","commonSituations":"Using a plugin built for a different zellij version (command enum changed between releases); stale plugin .wasm after upgrading zellij; hand-crafted WASI messages.","solutions":["Rebuild the plugin with the zellij-tile version matching your zellij binary","Update zellij to the version the plugin targets (or pin the plugin version matching your zellij)","Check the plugin's release notes for the zellij version it was built against","If developing the host, make PluginCommand conversion tolerant of unknown tags (skip + log) instead of erroring"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"```bash\nzellij --version && # compare with the zellij-tile version in the plugin's Cargo.toml\ncargo tree -p zellij-tile\n```","typeGuard":null,"tryCatchPattern":"match command.try_into() {\n    Ok(cmd) => dispatch(cmd),\n    Err(e) => log::warn!(\"plugin sent unsupported command: {e}\"), // skip instead of aborting the host call\n}","preventionTips":["Pin the plugin's zellij-tile dependency to the version of the zellij binary it runs on","Rebuild and redistribute plugin .wasm files after upgrading zellij major/minor versions"],"tags":["plugin","protobuf","version-mismatch","wasi","command"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}