{"record":{"id":"a8be00d0860da1bf","repo":"nikivdev/code","slug":"empty-resolver-command-for","errorCode":null,"errorMessage":"empty resolver command for {}","messagePattern":"empty resolver command for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ai.rs","lineNumber":12576,"sourceCode":"    for candidate in candidates {\n        if !resolver\n            .matches\n            .iter()\n            .any(|pattern| wildcard_match(pattern, candidate))\n        {\n            continue;\n        }\n\n        let command_text = render_reference_resolver_command(\n            &resolver.command,\n            candidate,\n            query_text,\n            target_path,\n        );\n        let args = shell_words::split(&command_text)\n            .with_context(|| format!(\"invalid resolver command: {}\", command_text))?;\n        let Some((program, rest)) = args.split_first() else {\n            bail!(\"empty resolver command for {}\", resolver.name);\n        };\n        let output = Command::new(program)\n            .args(rest)\n            .current_dir(target_path)\n            .output()\n            .with_context(|| format!(\"failed to run resolver {}\", resolver.name))?;\n        if !output.status.success() {\n            let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();\n            bail!(\n                \"resolver {} failed for {}: {}\",\n                resolver.name,\n                candidate,\n                if stderr.is_empty() {\n                    format!(\"exit status {}\", output.status)\n                } else {\n                    stderr\n                }\n            );","sourceCodeStart":12558,"sourceCodeEnd":12594,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/ai.rs#L12558-L12594","documentation":"External session resolvers are configured as command-line strings. The tool splits the command with `shell_words::split`; if the split yields no tokens (empty or whitespace-only command), it cannot spawn a process and bails naming the resolver.","triggerScenarios":"A resolver entry whose command text is empty after trimming — e.g. a config file with `command = \"\"`, or a command consisting solely of comments/whitespace.","commonSituations":"Mis-edited config where the command line was deleted but the resolver entry kept; environment substitution producing an empty command; copy-paste that dropped the actual program path.","solutions":["Set a real command for the resolver in config (e.g. `fzf ...` or a script path)","Remove the empty resolver entry entirely if unneeded","Check whether env expansion emptied the command and fix the variable"],"exampleFix":"// before (config)\n[[resolver]]\nname = \"pick\"\ncommand = \"\"\n// after\n[[resolver]]\nname = \"pick\"\ncommand = \"f codex sessions --json | fzf\"","handlingStrategy":"validation","validationCode":"if resolver.command.trim().is_empty() {\n    eprintln!(\"resolver '{}' has an empty command\", resolver.name);\n    return;\n}\nlet args = shell_words::split(&resolver.command)?;\nif args.is_empty() { eprintln!(\"resolver command splits to nothing\"); return; }","typeGuard":"fn resolver_command_ok(cmd: &str) -> bool {\n    shell_words::split(cmd).map(|a| !a.is_empty()).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Validate resolver config at startup and fail with a clear message","Never ship resolver entries with placeholder/empty commands","Test resolver config changes in a dry-run mode"],"tags":["config","resolver","empty-command","validation"],"backgroundTag":"empty-config-value","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}