{"record":{"id":"89e4b040a3e481b9","repo":"zed-industries/zed","slug":"in-place-requires-exactly-one-input-file","errorCode":null,"errorMessage":"--in-place requires exactly one input file","messagePattern":"--in-place requires exactly one input file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":654,"sourceCode":"\n    #[test]\n    fn prediction_provider_jumps_non_batched_alias_round_trips_to_primary_spelling() {\n        let provider: PredictionProvider = \"teacher_jumps_non_batching:gpt52\".parse().unwrap();\n        assert_eq!(\n            provider,\n            PredictionProvider::TeacherJumpsNonBatching(TeacherBackend::Gpt52)\n        );\n        assert_eq!(provider.to_string(), \"teacher-jumps-non-batching:gpt52\");\n    }\n}\n\nimpl EpArgs {\n    fn output_path(&self) -> Option<PathBuf> {\n        if self.in_place {\n            if self.inputs.len() == 1 {\n                self.inputs.first().cloned()\n            } else {\n                panic!(\"--in-place requires exactly one input file\")\n            }\n        } else {\n            self.output.clone()\n        }\n    }\n}\n\n/// Minimum Zed version required for Snowflake queries.\n/// This version introduced the current request schema with predicted edits in the edit\n/// history, and open source repos distinguished.\nconst MIN_CAPTURE_VERSION: pull_examples::MinCaptureVersion = pull_examples::MinCaptureVersion {\n    major: 0,\n    minor: 224,\n    patch: 1,\n};\n\nfn deduplicate_examples(examples: &mut Vec<Example>, max_per_cluster: usize) {\n    let total_before_exact = examples.len();","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L636-L672","documentation":"EpArgs::output_path resolves where results are written. With `--in-place`, the tool writes back into the single input file, so `self.inputs` must contain exactly one path; zero or multiple inputs panic immediately with '--in-place requires exactly one input file'. This is a CLI argument consistency check.","triggerScenarios":"Invoking the CLI with `--in-place` but no input file, or with two or more input files/directories (e.g. `--in-place --inputs a.jsonl b.jsonl`).","commonSituations":"Scripts that loop over several files pass them all at once while keeping `--in-place`; a flag combination copied from a batch invocation.","solutions":["Pass exactly one input file when using --in-place","Or drop --in-place and write to an explicit path with --output","For multiple files, invoke the command once per file (or in a loop) with --in-place"],"exampleFix":"# before\nedit-prediction-cli run --in-place --inputs a.jsonl b.jsonl  # panic\n\n# after\nedit-prediction-cli run --in-place --inputs a.jsonl\nedit-prediction-cli run --in-place --inputs b.jsonl","handlingStrategy":"validation","validationCode":"if args.in_place {\n    anyhow::ensure!(\n        args.inputs.len() == 1,\n        \"--in-place requires exactly one input file (got {})\",\n        args.inputs.len()\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In wrapper scripts, assert `$# -eq 1` before calling with --in-place","Prefer explicit --output for batch jobs instead of --in-place"],"tags":["edit-prediction-cli","cli-arguments","panic","in-place"],"backgroundTag":"invalid-cli-argument","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}