{"record":{"id":"ace650b8777fd6d5","repo":"block/buzz","slug":"pi-launcher-paths-must-be-valid-utf-8","errorCode":null,"errorMessage":"Pi launcher paths must be valid UTF-8","messagePattern":"Pi launcher paths must be valid UTF-8","errorType":"exception","errorClass":"io::Error (InvalidData)","httpStatus":null,"severity":"error","filePath":"crates/buzz-acp/src/pi_launcher.rs","lineNumber":181,"sourceCode":"    prompt_path: Option<&Path>,\n    managed_skills_dir: &Path,\n) -> io::Result<String> {\n    let system_prompt_arg = match prompt_path {\n        Some(prompt_path) => format!(\" --system-prompt {}\", shell_quote(prompt_path.as_os_str())?),\n        None => String::new(),\n    };\n    Ok(format!(\n        \"#!/bin/sh\\nexec {}{} --skill {} \\\"$@\\\"\\n\",\n        shell_quote(OsStr::new(pi_command))?,\n        system_prompt_arg,\n        shell_quote(managed_skills_dir.as_os_str())?,\n    ))\n}\n\n#[cfg(unix)]\nfn shell_quote(value: &OsStr) -> io::Result<String> {\n    let value = value.to_str().ok_or_else(|| {\n        io::Error::new(\n            io::ErrorKind::InvalidData,\n            \"Pi launcher paths must be valid UTF-8\",\n        )\n    })?;\n    Ok(format!(\"'{}'\", value.replace('\\'', \"'\\\"'\\\"'\")))\n}\n\n#[cfg(windows)]\nfn launcher_script(\n    pi_command: &str,\n    prompt_path: Option<&Path>,\n    managed_skills_dir: &Path,\n) -> io::Result<String> {\n    let system_prompt_arg = match prompt_path {\n        Some(prompt_path) => {\n            let prompt_path = prompt_path.to_str().ok_or_else(|| {\n                io::Error::new(\n                    io::ErrorKind::InvalidData,","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-acp/src/pi_launcher.rs#L163-L199","documentation":"Raised in shell_quote (unix) when the given OsStr — a Pi launcher command, system-prompt path, or managed skills dir path — cannot be converted to valid UTF-8 (to_str returns None). The generated POSIX shell script is plain text, so non-UTF-8 paths (e.g. raw bytes from a non-UTF-8 locale filesystem) cannot be safely embedded; the guard converts that into an InvalidData io::Error instead of emitting a corrupt script.","triggerScenarios":"Thrown at crates/buzz-acp/src/pi_launcher.rs:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename or move the Pi command / prompt / skills directory to a path containing only valid UTF-8 characters","Fix the locale/filesystem encoding so paths are reported as UTF-8","Pass ASCII-safe paths via Buzz's agent configuration rather than raw OS strings"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dad5a33865fc81a2e55b3b60746632f615ec1e3a","analyzedAt":"2026-09-05T18:13:50.666Z","contentChangedAt":"2026-09-05T18:13:50.666Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}