{"record":{"id":"e000301f1574429a","repo":"BloopAI/vibe-kanban","slug":"handled-non-session-commands-earlier","errorCode":null,"errorMessage":"handled non-session commands earlier","messagePattern":"handled non-session commands earlier","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/executors/src/executors/opencode/slash_commands.rs","lineNumber":513,"sourceCode":"                )\n                .await\n            })\n        }\n        OpencodeSlashCommand::Custom { name, arguments } => Box::pin(async move {\n            sdk::session_command(\n                &request_client,\n                &request_base_url,\n                &request_directory,\n                &request_session_id,\n                name,\n                arguments,\n                request_agent,\n                request_model,\n                request_model_variant,\n            )\n            .await\n        }),\n        _ => unreachable!(\"handled non-session commands earlier\"),\n    };\n\n    let request_result = sdk::run_request_with_control(\n        request_fut,\n        &mut control_rx,\n        &pending_approvals,\n        cancel.clone(),\n    )\n    .await;\n\n    if cancel.is_cancelled() {\n        sdk::send_abort(&client, &config.base_url, &config.directory, &session_id).await;\n        event_handle.abort();\n        return Ok(());\n    }\n\n    event_handle.abort();\n","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/executors/src/executors/opencode/slash_commands.rs#L495-L531","documentation":"In opencode's slash_commands::execute, a match over the command kind builds a request future; session-kind commands are handled in the match arms, and the catch-all asserts `unreachable!(\"handled non-session commands earlier\")`. Panicking here means a non-session command variant reached this match, i.e. the earlier filter/dispatch that should have handled non-session commands (help, custom, etc.) was bypassed or a new variant was added.","triggerScenarios":"Calling execute() with a slash command variant that is neither one of the session command arms nor filtered out earlier — e.g. a newly added SlashCommand variant not covered by the pre-dispatch, or the early guard's condition drifting out of sync with this match.","commonSituations":"Adding a new slash command type and updating only one of the two dispatch sites; a custom/agent command whose classification changed so it falls through to the session-only match.","solutions":["Check the backtrace for the command id/variant that reached the unreachable arm and add an explicit early handler for it.","Align the earlier 'non-session commands' guard with this match so both enumerate the same variants exhaustively (prefer matching on all variants instead of a wildcard guard).","Add a unit test per SlashCommand variant through execute() to catch dispatch drift when new variants are added."],"exampleFix":"// before\n_ => unreachable!(\"handled non-session commands earlier\"),\n// after\nSlashCommand::NewKind { .. } => { /* handle explicitly */ }\n_ => unreachable!(\"handled non-session commands earlier\"),","handlingStrategy":"type-guard","validationCode":"// Pre-check before execute()\nfn is_session_command(cmd: &SlashCommand) -> bool {\n  matches!(cmd, SlashCommand::Session{..} /* all session kinds */)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the early non-session filter and this match in sync — avoid wildcard guards on enums","Add a test exercising every SlashCommand variant through execute()","When adding a slash command kind, update both dispatch sites in the same commit"],"tags":["rust","panic","enum-match","slash-commands"],"backgroundTag":"unhandled-enum-variant","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}