{"record":{"id":"ec342f0c202e2198","repo":"Hmbown/CodeWhale","slug":"continue-resume-session-id-apply-to-the-interactive-session","errorCode":null,"errorMessage":"--continue/--resume/--session-id apply to the interactive session and cannot be combined with a subcommand. Run them without a subcommand, or use the subcommand's own flag (for example `codewhale exec --session-id <id>`).","messagePattern":"--continue/--resume/--session-id apply to the interactive session and cannot be combined with a subcommand\\. Run them without a subcommand, or use the subcommand's own flag \\(for example `codewhale exec --session-id <id>`\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":2013,"sourceCode":"\n    let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(\".\"));\n    let config_path =\n        config_store_path_for_dispatch(cli.config.clone(), project_bundle_scope, &cwd);\n    let mut store = ConfigStore::load(config_path).map_err(|error| {\n        if pipe_api_key_handoff {\n            anyhow!(\"unavailable credential\")\n        } else {\n            error\n        }\n    })?;\n    // Root session flags only reach the TUI through the `None` branch below;\n    // no subcommand handler reads them. Accepting them silently resumes\n    // nothing -- `codewhale --resume abc exec \"...\"` would start a fresh\n    // session while looking like it continued one.\n    if command.is_some()\n        && (cli.continue_session || cli.resume.is_some() || cli.session_id.is_some())\n    {\n        anyhow::bail!(\n            \"--continue/--resume/--session-id apply to the interactive session and \\\n             cannot be combined with a subcommand. Run them without a subcommand, or \\\n             use the subcommand's own flag (for example `codewhale exec --session-id <id>`).\"\n        );\n    }\n    // Only config inspection needs the store overlay. Runtime overrides use\n    // the dedicated flags above and must never enter a store that another\n    // command (or legacy credential migration) can save.\n    if matches!(command, Some(Commands::Config(_))) {\n        apply_per_run_overrides(&mut store, &cli.overrides)?;\n    }\n\n    match command {\n        Some(Commands::Run(args)) => {\n            let resolved_runtime = resolve_runtime_for_dispatch(&mut store, &runtime_overrides);\n            run_tui_in_process(&cli, &resolved_runtime, args.args)\n        }\n        Some(Commands::Doctor(args)) => {","sourceCodeStart":1995,"sourceCodeEnd":2031,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L1995-L2031","documentation":"Session-selection flags `--continue`, `--resume`, and `--session-id` belong to the interactive TUI session only. The dispatcher bails when any subcommand is present AND any of these flags is set, because no subcommand handler reads them — accepting silently would start a fresh session while looking like a resumed one. The message points users at the subcommand's own flags.","triggerScenarios":"Invocations like `codewhale --resume abc exec \"...\"`, `codewhale --continue mcp ...`, or `codewhale --session-id X app-server` — any subcommand combined with one of the three session flags.","commonSituations":"Wrapping scripts that prepend session flags to a base command, users expecting global flags to flow into subcommands, or copying an interactive invocation and appending a subcommand.","solutions":["Run the interactive resume without a subcommand: `codewhale --resume abc` (or `--continue`).","Use the subcommand's own session flag: `codewhale exec --session-id <id>` or `codewhale exec --resume <id> <PROMPT>`.","If the script must support both modes, branch: pass session flags only when no subcommand is used."],"exampleFix":"// before\ncodewhale --resume abc exec \"summarize\"\n// error: --continue/--resume/--session-id apply to the interactive session...\n\n// after\ncodewhale exec --resume abc \"summarize\"","handlingStrategy":"validation","validationCode":"# wrapper guard\nhas_sub=false; for a in \"$@\"; do case \"$a\" in exec|mcp|auth|app-server|config|workflow) has_sub=true;; esac; done\nif $has_sub; then\n  case \"$*\" in *--continue*|*--resume*|*--session-id*) echo \"use the subcommand's own session flag\"; exit 2;; esac\nfi","typeGuard":null,"tryCatchPattern":"match run(args) {\n    Err(e) if e.to_string().contains(\"apply to the interactive session\") => {\n        eprintln!(\"move session flags under the subcommand or run interactively\");\n    }\n    r => r?,\n}","preventionTips":["Treat --continue/--resume/--session-id as interactive-only flags.","In scripts, pass session ids to `exec --session-id`/`exec --resume` instead.","Document wrapper commands so session flags never get prepended globally."],"tags":["cli","session","flags","argument-parsing"],"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"}