From cc88b3b8e5bb9f7d9f23ed6ae85a52fd7b5b9ed6 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Wed, 2 Sep 2026 02:45:20 +0300 Subject: feat: add stable client endpoint compatibility (#3509) * feat: add stable client endpoint compatibility * fix: keep portable-pty patch checks composable * ci: run maintenance checks in pull requests * fix: reject endpoint errors from terminal clients * feat: keep compatible servers running across updates --- src/client/shell/config.rs | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'src/client/shell/config.rs') diff --git a/src/client/shell/config.rs b/src/client/shell/config.rs index 0273cefb..1c2993b7 100644 --- a/src/client/shell/config.rs +++ b/src/client/shell/config.rs @@ -200,16 +200,8 @@ impl ClientShellConfig { }; config.keys.command = commands .iter() - .map(|command| crate::config::CommandKeybindConfig { - key: if command.binding_labels.len() == 1 { - crate::config::BindingConfig::One(command.binding_labels[0].clone()) - } else { - crate::config::BindingConfig::Many(command.binding_labels.clone()) - }, - // The client never executes this field; preserve the opaque endpoint ID - // through the shared config collision resolver. - command: command.command_id.clone(), - action_type: match command.action { + .filter_map(|command| { + let action_type = match command.action { crate::protocol::ClientShellCommandAction::Shell => { crate::config::CommandKeybindType::Shell } @@ -222,10 +214,22 @@ impl ClientShellConfig { crate::protocol::ClientShellCommandAction::PluginAction => { crate::config::CommandKeybindType::PluginAction } - }, - description: command.description.clone(), - width: None, - height: None, + crate::protocol::ClientShellCommandAction::Unknown => return None, + }; + Some(crate::config::CommandKeybindConfig { + key: if command.binding_labels.len() == 1 { + crate::config::BindingConfig::One(command.binding_labels[0].clone()) + } else { + crate::config::BindingConfig::Many(command.binding_labels.clone()) + }, + // The client never executes this field; preserve the opaque endpoint ID + // through the shared config collision resolver. + command: command.command_id.clone(), + action_type, + description: command.description.clone(), + width: None, + height: None, + }) }) .collect(); config @@ -236,6 +240,9 @@ impl ClientShellConfig { }; if self.keybinding_source == ClientShellKeybindingSource::Endpoint { for command in commands { + let Ok(action) = command.action.try_into() else { + continue; + }; keybinds .keybinds .custom_commands @@ -245,7 +252,7 @@ impl ClientShellConfig { )?, label: command.binding_label.clone(), command: command.command_id.clone(), - action: command.action.into(), + action, description: command.description.clone(), width: None, height: None, -- cgit v1.2.3