Hmbown/CodeWhale · error

`codewhale --resume ` resumes the interactive TUI. Use…

Error message

`codewhale --resume {session_id}` resumes the interactive TUI. Use `codewhale exec --resume {session_id} <PROMPT>` to continue a session non-interactively.

What it means

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.

Solutions

  1. Rewrite as `codewhale exec --resume <session_id> "<prompt>"` for non-interactive continuation.
  2. Drop the prompt argument if you want the interactive TUI: `codewhale --resume <session_id>`.
  3. Fix automation scripts to place `--resume` under the `exec` subcommand when a prompt is supplied.

Example fix

// before
codewhale --resume 3f9c1a2e-... "run the tests now"
// error: `codewhale --resume 3f9c1a2e-...` resumes the interactive TUI...

// after
codewhale exec --resume 3f9c1a2e-... "run the tests now"
Defensive patterns

Strategy: validation

Validate before calling

# wrapper guard: prompt + --resume must go through exec
SID="$1"; shift
if [ $# -gt 0 ]; then
  exec codewhale exec --resume "$SID" "$@"
fi
codewhale --resume "$SID"

Try / catch

match run(args) {
    Err(e) if e.to_string().contains("resumes the interactive TUI. Use `codewhale exec --resume") => {
        eprintln!("route prompt continuations through `codewhale exec --resume <id> <PROMPT>`");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Running `codewhale --resume <session_id> "<prompt text>"` — global `--resume` plus a bare, non-empty prompt argument.

Common situations: 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.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/5636b15d7f3bc2b4. Report an issue: GitHub.

Appendix: source

Thrown at crates/cli/src/lib.rs:2368

    let prompt =
        cli.prompt_flag
            .iter()
            .chain(cli.prompt.iter())
            .fold(String::new(), |mut acc, part| {
                if !acc.is_empty() {
                    acc.push(' ');
                }
                acc.push_str(part);
                acc
            });
    if !prompt.is_empty() {
        if cli.continue_session {
            bail!(
                "`codewhale --continue` resumes the interactive TUI. Use `codewhale exec --continue <PROMPT>` to continue a session non-interactively."
            );
        }
        if let Some(session_id) = resume_session_id {
            bail!(
                "`codewhale --resume {session_id}` resumes the interactive TUI. Use `codewhale exec --resume {session_id} <PROMPT>` to continue a session non-interactively."
            );
        }
        forwarded.push("--prompt".to_string());
        forwarded.push(prompt);
    }

    Ok(forwarded)
}

fn resolve_runtime_for_dispatch(
    store: &mut ConfigStore,
    runtime_overrides: &CliRuntimeOverrides,
) -> ResolvedRuntimeOptions {
    let runtime_secrets = Secrets::auto_detect();
    resolve_runtime_for_dispatch_with_secrets(store, runtime_overrides, &runtime_secrets)
}

View on GitHub (pinned to 73e0f67d83)