{"record":{"id":"5636b15d7f3bc2b4","repo":"Hmbown/CodeWhale","slug":"codewhale-resume-session-id-resumes-the-interactive-tui-use","errorCode":null,"errorMessage":"`codewhale --resume {session_id}` resumes the interactive TUI. Use `codewhale exec --resume {session_id} <PROMPT>` to continue a session non-interactively.","messagePattern":"`codewhale --resume (.+?)` resumes the interactive TUI\\. Use `codewhale exec --resume (.+?) <PROMPT>` to continue a session non-interactively\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":2368,"sourceCode":"    let prompt =\n        cli.prompt_flag\n            .iter()\n            .chain(cli.prompt.iter())\n            .fold(String::new(), |mut acc, part| {\n                if !acc.is_empty() {\n                    acc.push(' ');\n                }\n                acc.push_str(part);\n                acc\n            });\n    if !prompt.is_empty() {\n        if cli.continue_session {\n            bail!(\n                \"`codewhale --continue` resumes the interactive TUI. Use `codewhale exec --continue <PROMPT>` to continue a session non-interactively.\"\n            );\n        }\n        if let Some(session_id) = resume_session_id {\n            bail!(\n                \"`codewhale --resume {session_id}` resumes the interactive TUI. Use `codewhale exec --resume {session_id} <PROMPT>` to continue a session non-interactively.\"\n            );\n        }\n        forwarded.push(\"--prompt\".to_string());\n        forwarded.push(prompt);\n    }\n\n    Ok(forwarded)\n}\n\nfn resolve_runtime_for_dispatch(\n    store: &mut ConfigStore,\n    runtime_overrides: &CliRuntimeOverrides,\n) -> ResolvedRuntimeOptions {\n    let runtime_secrets = Secrets::auto_detect();\n    resolve_runtime_for_dispatch_with_secrets(store, runtime_overrides, &runtime_secrets)\n}\n","sourceCodeStart":2350,"sourceCodeEnd":2386,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L2350-L2386","documentation":"Same guard family as `--continue` with a prompt: when a top-level positional prompt is present together with `--resume <session_id>`, the dispatcher bails because `--resume` at the top level launches the interactive TUI. The non-interactive path is `codewhale exec --resume <id> <PROMPT>`, which the error echoes with the concrete session id.","triggerScenarios":"Running `codewhale --resume <session_id> \"<prompt text>\"` — global `--resume` plus a bare, non-empty prompt argument.","commonSituations":"Automations that resume a known session with a follow-up prompt but target the wrong command surface, or users copying interactive resume syntax and appending a prompt.","solutions":["Rewrite as `codewhale exec --resume <session_id> \"<prompt>\"` for non-interactive continuation.","Drop the prompt argument if you want the interactive TUI: `codewhale --resume <session_id>`.","Fix automation scripts to place `--resume` under the `exec` subcommand when a prompt is supplied."],"exampleFix":"// before\ncodewhale --resume 3f9c1a2e-... \"run the tests now\"\n// error: `codewhale --resume 3f9c1a2e-...` resumes the interactive TUI...\n\n// after\ncodewhale exec --resume 3f9c1a2e-... \"run the tests now\"","handlingStrategy":"validation","validationCode":"# wrapper guard: prompt + --resume must go through exec\nSID=\"$1\"; shift\nif [ $# -gt 0 ]; then\n  exec codewhale exec --resume \"$SID\" \"$@\"\nfi\ncodewhale --resume \"$SID\"","typeGuard":null,"tryCatchPattern":"match run(args) {\n    Err(e) if e.to_string().contains(\"resumes the interactive TUI. Use `codewhale exec --resume\") => {\n        eprintln!(\"route prompt continuations through `codewhale exec --resume <id> <PROMPT>`\");\n    }\n    r => r?,\n}","preventionTips":["Place --resume under `exec` whenever a prompt follows it.","In automations, always target the exec subcommand for non-interactive resume.","Verify wrapper scripts distinguish interactive (no prompt) from exec (prompt) invocations."],"tags":["cli","session","flags","tui"],"backgroundTag":"mutually-exclusive-flags","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"}