{"record":{"id":"e66a6424603a3d0d","repo":"zellij-org/zellij","slug":"closefocusbypaneid-missing-pane-id","errorCode":null,"errorMessage":"CloseFocusByPaneId missing pane_id","messagePattern":"CloseFocusByPaneId missing pane_id","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"zellij-utils/src/ipc/protobuf_conversion.rs","lineNumber":3057,"sourceCode":"                        .ok_or_else(|| anyhow!(\"ToggleNoUiFullscreenByPaneId missing pane_id\"))?\n                        .try_into()?,\n                },\n            ),\n            ActionType::TogglePaneEmbedOrFloatingByPaneId(a) => Ok(\n                crate::input::actions::Action::TogglePaneEmbedOrFloatingByPaneId {\n                    pane_id: a\n                        .pane_id\n                        .ok_or_else(|| {\n                            anyhow!(\"TogglePaneEmbedOrFloatingByPaneId missing pane_id\")\n                        })?\n                        .try_into()?,\n                },\n            ),\n            ActionType::CloseFocusByPaneId(a) => {\n                Ok(crate::input::actions::Action::CloseFocusByPaneId {\n                    pane_id: a\n                        .pane_id\n                        .ok_or_else(|| anyhow!(\"CloseFocusByPaneId missing pane_id\"))?\n                        .try_into()?,\n                })\n            },\n            ActionType::RenamePaneByPaneId(a) => {\n                Ok(crate::input::actions::Action::RenamePaneByPaneId {\n                    pane_id: a.pane_id.map(|p| p.try_into()).transpose()?,\n                    name: a.name,\n                })\n            },\n            ActionType::UndoRenamePaneByPaneId(a) => {\n                Ok(crate::input::actions::Action::UndoRenamePaneByPaneId {\n                    pane_id: a\n                        .pane_id\n                        .ok_or_else(|| anyhow!(\"UndoRenamePaneByPaneId missing pane_id\"))?\n                        .try_into()?,\n                })\n            },\n            ActionType::TogglePanePinnedByPaneId(a) => {","sourceCodeStart":3039,"sourceCodeEnd":3075,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-utils/src/ipc/protobuf_conversion.rs#L3039-L3075","documentation":"CloseFocusByPaneId closes one specific pane (the ByPaneId form of CloseFocus). Its protobuf message CloseFocusByPaneIdAction has one optional pane_id field which the internal Action requires. With pane_id = None the conversion fails with 'CloseFocusByPaneId missing pane_id', so the pane is never closed.","triggerScenarios":"Sending ActionType::CloseFocusByPaneId while CloseFocusByPaneIdAction.pane_id is None.","commonSituations":"Plugins closing panes by id where the id lookup failed and None was forwarded; default-constructed messages; contract version skew; intending the plain CloseFocus variant.","solutions":["Set pane_id: Some(PaneId { pane_type: Some(PaneType::Terminal(id)) }).","Use the plain CloseFocus action for the focused pane.","Never forward an unresolved Option pane id into the action; fall back or error at the call site.","Rebuild custom clients against the current contract."],"exampleFix":"// before\nlet action = ActionType::CloseFocusByPaneId(\n    CloseFocusByPaneIdAction { pane_id: None },\n); // -> \"CloseFocusByPaneId missing pane_id\"\n\n// after\nlet action = ActionType::CloseFocusByPaneId(\n    CloseFocusByPaneIdAction {\n        pane_id: Some(PaneId { pane_type: Some(PaneType::Terminal(1)) }),\n    },\n);","handlingStrategy":"validation","validationCode":"fn is_sendable(a: &CloseFocusByPaneIdAction) -> bool {\n    a.pane_id\n        .as_ref()\n        .and_then(|p| p.pane_type.as_ref())\n        .is_some()\n}","typeGuard":"fn has_valid_pane_id(a: &CloseFocusByPaneIdAction) -> bool {\n    matches!(\n        a.pane_id.as_ref().and_then(|p| p.pane_type.as_ref()),\n        Some(pane_id::PaneType::Terminal(_)) | Some(pane_id::PaneType::Plugin(_))\n    )\n}","tryCatchPattern":"match Action::try_from(proto_action) {\n    Ok(action) => dispatch(action),\n    Err(e) if e.to_string().contains(\"CloseFocusByPaneId missing pane_id\") => {\n        log::warn!(\"close action without pane target - pane NOT closed: {e}\");\n    },\n    Err(e) => return Err(e),\n}","preventionTips":["Closing panes is destructive - fail loudly at the call site if the pane id is unknown.","Use CloseFocus for the focused pane.","Confirm pane existence via a pane-list query before issuing close-by-id."],"tags":["zellij","ipc","protobuf","rust","pane-id","lifecycle"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}