{"record":{"id":"8c3a01cfb832ec5a","repo":"Hmbown/CodeWhale","slug":"no-session-selected","errorCode":null,"errorMessage":"No session selected.","messagePattern":"No session selected\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":5296,"sourceCode":"            0\n        } else {\n            1\n        })\n    }\n\n    println!();\n    println!(\"Windows note: enter a session id or prefix from the list above.\");\n    println!(\"You can also run `codewhale resume --last` to skip this prompt.\");\n    print!(\"Session id/prefix (Enter to cancel): \");\n    io::stdout().flush()?;\n\n    let mut input = String::new();\n    io::stdin()\n        .read_line(&mut input)\n        .context(\"failed to read session selection\")?;\n    let session_id = input.trim();\n    if session_id.is_empty() {\n        bail!(\"No session selected.\");\n    }\n\n    run_tui_in_process(\n        cli,\n        resolved_runtime,\n        vec![\"resume\".to_string(), session_id.to_string()],\n    )\n}\n\nfn should_pick_resume_in_dispatcher(passthrough: &[String], is_windows: bool) -> bool {\n    is_windows && passthrough == [\"resume\"]\n}\n\nfn run_tui_in_process(\n    cli: &Cli,\n    resolved_runtime: &ResolvedRuntimeOptions,\n    passthrough: Vec<String>,\n) -> Result<()> {","sourceCodeStart":5278,"sourceCodeEnd":5314,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L5278-L5314","documentation":"When resuming a session interactively, the CLI reads a session id from stdin; if the user presses enter without typing anything, the empty selection aborts with this error instead of launching the TUI with an invalid session.","triggerScenarios":"The session-selection prompt read an empty line from stdin (io::stdin().read_line) and `input.trim()` was empty before `run_tui_in_process` is called with `resume <session_id>`.","commonSituations":"User hit Enter at the selection prompt without typing a session id; stdin was EOF/closed (piped or non-interactive) so read_line returned zero bytes; script driving the CLI omitted the input.","solutions":["Type the session id shown in the prompt and press Enter.","Find a valid session id first (e.g. via the session listing command) and resume non-interactively: `codewhale resume <session-id>`.","If running non-interactively, pipe the session id: `echo <session-id> | codewhale ...`."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if session_id.trim().is_empty() {\n    eprintln!(\"no session id supplied; run 'codewhale resume <session-id>'\");\n} else {\n    run_tui_in_process(cli, resolved_runtime, vec![\"resume\".into(), session_id.trim().into()])?;\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string() == \"No session selected.\" => {\n        eprintln!(\"selection was empty — pass a session id explicitly\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["List sessions first and resume by explicit id rather than relying on the interactive prompt.","In non-interactive contexts, always pipe or pass the session id; stdin may be EOF.","Trim and validate user input before forwarding it to resume."],"tags":["cli","session","stdin"],"backgroundTag":"missing-required-argument","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}