{"record":{"id":"1a0507da6eaedd77","repo":"Hmbown/CodeWhale","slug":"expected-resume-command","errorCode":null,"errorMessage":"expected resume command","messagePattern":"expected resume command","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":17355,"sourceCode":"            \"even the largest override stays finite\"\n        );\n    }\n\n    #[test]\n    fn exec_accepts_continue_for_latest_workspace_session() {\n        let cli = parse_cli(&[\"codewhale\", \"exec\", \"--continue\", \"follow up\"]);\n        let Some(Commands::Exec(args)) = cli.command else {\n            panic!(\"expected exec command\");\n        };\n\n        assert!(args.continue_session);\n    }\n\n    #[test]\n    fn sessions_footer_points_to_resume_subcommand() {\n        let cli = parse_cli(&[\"codewhale\", \"resume\", \"abc123\"]);\n        let Some(Commands::Resume { session_id, last }) = cli.command else {\n            panic!(\"expected resume command\");\n        };\n\n        assert_eq!(session_id.as_deref(), Some(\"abc123\"));\n        assert!(!last);\n        assert_eq!(sessions_resume_command(), \"codewhale resume\");\n        assert!(!sessions_resume_command().contains(\"--resume\"));\n    }\n\n    #[test]\n    fn plugin_registry_initialization_precedes_dotenv_for_all_launch_paths() {\n        use std::cell::Cell;\n\n        #[derive(Clone, Copy)]\n        enum Expected {\n            Plain,\n            Resume,\n            Fork,\n            Exec,","sourceCodeStart":17337,"sourceCodeEnd":17373,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/lib.rs#L17337-L17373","documentation":"Test assertion panic: parses 'codewhale resume abc123' and expects Commands::Resume so it can assert the session id and that the sessions footer points at 'codewhale resume'. The panic means the parsed command is not Commands::Resume.","triggerScenarios":"parse_cli(&[\"codewhale\",\"resume\",\"abc123\"]) returns a variant other than Commands::Resume { session_id, last }, so destructuring fails and the let-else panics.","commonSituations":"Resume subcommand renamed/removed; Resume variant fields changed shape so the pattern no longer matches; 'resume' absorbed into 'exec --continue'; stale test build.","solutions":["Print the actual cli.command variant in the panic message.","Confirm Commands::Resume still exists with session_id and last fields in that exact shape.","Verify the clap subcommand is still named 'resume'.","Rebuild the tui crate and rerun the sessions tests."],"exampleFix":"// before\nlet Some(Commands::Resume { session_id, last }) = cli.command else {\n    panic!(\"expected resume command\");\n};\n// after\nlet Some(Commands::Resume { session_id, last }) = cli.command else {\n    panic!(\"expected resume command, got {:?}\", cli.command);\n};","handlingStrategy":"validation","validationCode":"assert!(matches!(cli.command, Commands::Resume { .. }), \"got {:?}\", cli.command);","typeGuard":"fn as_resume(command: &Commands) -> Option<(Option<String>, bool)> {\n    match command {\n        Commands::Resume { session_id, last } => Some((session_id.clone(), *last)),\n        _ => None,\n    }\n}","tryCatchPattern":"let Some(Commands::Resume { session_id, last }) = cli.command else {\n    panic!(\"expected resume command, got {:?}\", cli.command);\n};","preventionTips":["Update destructuring patterns when Resume fields change","Test the sessions footer text against the real subcommand name","Print the actual variant on failure","Rename subcommand and tests atomically"],"tags":["rust","cli","testing","panic"],"backgroundTag":"invalid-cli-argument","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-22T10:30:35.592Z"}