rtk-ai/rtk · error

unknown recall mode ' ' (expected: sqlite, tee, disabled)

Error message

unknown recall mode '{other}' (expected: sqlite, tee, disabled)

What it means

`rtk config` (Recall mode action) accepts only the literal recall mode strings `sqlite`, `tee`, or `disabled`, which map to `core::retriever::RecoveryMode` variants. Any other string hits the `other => anyhow::bail!(...)` arm in the match at src/main.rs:2574 and aborts the config change. (The DIFF 'USED AT' hit in diff_cmd.rs:1728 is an unrelated byte-level match arm of the same shape, not the thrower.)

Solutions

  1. Re-run with one of the exact accepted values: `sqlite`, `tee`, or `disabled` (lowercase)
  2. Check the current valid values via `rtk config --help` or the error message itself
  3. If the intent was 'turn it off', use `disabled`, not `off`/`none`

Example fix

// before
rtk config recall --mode off
// after
rtk config recall --mode disabled
Defensive patterns

Strategy: validation

Validate before calling

// shell: validate mode before calling rtk config
RECALL_MODES=(sqlite tee disabled)
if [[ ! " ${RECALL_MODES[*]} " == *" $MODE "* ]]; then echo "invalid recall mode: $MODE" >&2; exit 1; fi
rtk config recall --mode "$MODE"

Try / catch

// Rust caller
match mode.as_str() {
    "sqlite" | "tee" | "disabled" => set_recall_mode(mode)?,
    other => eprintln!("invalid recall mode '{other}': expected sqlite, tee, disabled"),
}

Prevention

When it happens

Trigger: Running `rtk config ...` that resolves to `ConfigAction::Recall { mode: Some(mode) }` where `mode` is any string other than exactly "sqlite", "tee", or "disabled" — e.g. typos, different casing (`SQLITE`, `SQLite`), or synonyms (`off`, `none`, `file`).

Common situations: Typing `rtk config recall --mode disable` (missing 'd') or `--mode off`; assuming case-insensitivity; remembering the old mode name after a rename across rtk versions.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/9afe4d7ab33a3b81. Report an issue: GitHub.

Appendix: source

Thrown at src/main.rs:2574

            all,
            format,
        } => {
            analytics::cc_economics::run(daily, weekly, monthly, all, &format, cli.verbose)?;
            0
        }

        Commands::Config { create, action } => {
            match action {
                Some(ConfigAction::Recall { mode: None }) => {
                    core::config::show_recall_mode()?;
                }
                Some(ConfigAction::Recall { mode: Some(mode) }) => {
                    use core::retriever::RecoveryMode;
                    let parsed = match mode.as_str() {
                        "sqlite" => RecoveryMode::Sqlite,
                        "tee" => RecoveryMode::Tee,
                        "disabled" => RecoveryMode::Disabled,
                        other => anyhow::bail!(
                            "unknown recall mode '{other}' (expected: sqlite, tee, disabled)"
                        ),
                    };
                    let path = core::config::set_recall_mode(parsed)?;
                    println!("recall mode set to {mode} in {}", path.display());
                }
                None => {
                    if create {
                        let path = core::config::Config::create_default()?;
                        println!("Created: {}", path.display());
                    } else {
                        core::config::show_config()?;
                    }
                }
            }
            0
        }

View on GitHub (pinned to 0924356b4c)