zellij-org/zellij · error

failed to convert serialized command: {}

Error message

failed to convert serialized command: {}

What it means

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.

Source

Thrown at zellij-server/src/plugins/zellij_exports.rs:174

    }
}

pub fn zellij_exports(linker: &mut Linker<PluginEnv>) {
    linker
        .func_wrap("zellij", "host_run_plugin_command", host_run_plugin_command)
        .unwrap();
}

fn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {
    let mut env = caller.data_mut();
    let plugin_command = env.name();
    let err_context = || format!("failed to run plugin command {}", plugin_command);
    wasi_read_bytes(env)
        .and_then(|bytes| {
            let command: ProtobufPluginCommand = ProtobufPluginCommand::decode(bytes.as_slice())?;
            let command: PluginCommand = command
                .try_into()
                .map_err(|e| anyhow!("failed to convert serialized command: {}", e))?;
            match check_command_permission(&env, &command) {
                (PermissionStatus::Granted, _) => match command {
                    PluginCommand::Subscribe(event_list) => subscribe(env, event_list)?,
                    PluginCommand::Unsubscribe(event_list) => unsubscribe(env, event_list)?,
                    PluginCommand::SetSelectable(selectable) => set_selectable(env, selectable),
                    PluginCommand::ShowCursor(cursor_position) => show_cursor(env, cursor_position),
                    PluginCommand::GetPluginIds => get_plugin_ids(env),
                    PluginCommand::GetZellijVersion => get_zellij_version(env),
                    PluginCommand::GenerateRandomName => generate_random_name(env),
                    PluginCommand::DumpLayout(layout_name) => dump_layout(env, layout_name),
                    PluginCommand::ParseLayout(layout_string) => parse_layout(env, layout_string),
                    PluginCommand::GetLayoutDir => get_layout_dir(env),
                    PluginCommand::GetFocusedPaneInfo => get_focused_pane_info(env),
                    PluginCommand::SaveSession => save_session(env),
                    PluginCommand::CurrentSessionLastSavedTime => {
                        current_session_last_saved_time(env)
                    },
                    PluginCommand::GetPaneInfo(pane_id) => get_pane_info(env, pane_id),

View on GitHub (pinned to 98a0837077)

Solutions

  1. Rebuild the plugin with the zellij-tile version matching your zellij binary
  2. Update zellij to the version the plugin targets (or pin the plugin version matching your zellij)
  3. Check the plugin's release notes for the zellij version it was built against
  4. If developing the host, make PluginCommand conversion tolerant of unknown tags (skip + log) instead of erroring
Defensive patterns

Strategy: validation

Validate before calling

```bash
zellij --version && # compare with the zellij-tile version in the plugin's Cargo.toml
cargo tree -p zellij-tile
```

Try / catch

match command.try_into() {
    Ok(cmd) => dispatch(cmd),
    Err(e) => log::warn!("plugin sent unsupported command: {e}"), // skip instead of aborting the host call
}

Prevention

When it happens

Trigger: 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.

Common situations: Using a plugin built for a different zellij version (command enum changed between releases); stale plugin .wasm after upgrading zellij; hand-crafted WASI messages.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/8fbc9a5052e02d22. Report an issue: GitHub.