{"record":{"id":"3e965a32a8ffc0f9","repo":"Hmbown/CodeWhale","slug":"invalid-fail-step-value","errorCode":null,"errorMessage":"invalid --fail-step '{value}'","messagePattern":"invalid --fail-step '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":3075,"sourceCode":"        );\n    }\n    std::fs::File::open(path)\n        .map_err(|error| anyhow!(\"could not securely open {}: {error}\", path.display()))\n}\n\n/// Generate shell completions for the given shell\nfn generate_completions(shell: Shell) {\n    let mut cmd = Cli::command();\n    let name = cmd.get_name().to_string();\n    generate(shell, &mut cmd, name, &mut io::stdout());\n}\n\n/// Run the offline evaluation harness (no network/LLM calls).\nfn run_eval(args: EvalArgs) -> Result<()> {\n    let fail_step = match args.fail_step.as_deref() {\n        Some(value) => ScenarioStepKind::parse(value)\n            .map(Some)\n            .ok_or_else(|| anyhow!(\"invalid --fail-step '{value}'\"))?,\n        None => None,\n    };\n\n    let config = EvalHarnessConfig {\n        fail_step,\n        shell_command: args.shell_command,\n        shell_expect_token: args.shell_expect_token,\n        max_output_chars: args.max_output_chars,\n        record_dir: args.record.clone(),\n        ..EvalHarnessConfig::default()\n    };\n\n    let harness = EvalHarness::new(config);\n    let run = harness.run().context(\"evaluation harness failed\")?;\n    let report = run.to_report();\n\n    if args.json {\n        let json = serde_json::to_string_pretty(&report)?;","sourceCodeStart":3057,"sourceCodeEnd":3093,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L3057-L3093","documentation":"Thrown by `run_eval` when the `--fail-step` CLI argument cannot be parsed into a `ScenarioStepKind` via `ScenarioStepKind::parse`. The offline evaluation harness only accepts known step-kind names for this flag; anything else aborts before the harness runs.","triggerScenarios":"Running the eval subcommand with `--fail-step` set to a string that is not a recognized scenario step kind, e.g. a typo (`--fail-step tool_use` when the kind is `tool`), wrong case, or an empty value.","commonSituations":"Copy-pasting a step name from docs of a different version; guessing step kinds without checking `--help`; shell quoting strips or mangles the value.","solutions":["Run `codewhale eval --help` (or the equivalent) to list valid --fail-step values.","Correct the spelling/case of the step kind exactly as `ScenarioStepKind::parse` expects.","Omit --fail-step entirely if you do not need to force a specific step failure."],"exampleFix":"// before\ncodewhale eval --fail-step toolcall\n// after\ncodewhale eval --fail-step tool","handlingStrategy":"validation","validationCode":"// check the value against accepted step kinds before running\nlet ok = [\"tool\", \"model\", /* ... */].contains(&value);\nif !ok { eprintln!(\"invalid --fail-step '{value}'\"); std::process::exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Consult --help for the exact accepted --fail-step values.","Script the eval call with values copy-pasted from the help output, not memory."],"tags":["cli","argument-parsing","eval"],"backgroundTag":"invalid-cli-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"}