{"record":{"id":"8db9036d188702be","repo":"Hmbown/CodeWhale","slug":"current-codewhale-executable-path-is-not-valid-utf","errorCode":null,"errorMessage":"current Codewhale executable path is not valid UTF-8: {}","messagePattern":"current Codewhale executable path is not valid UTF-8: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":1297,"sourceCode":"    });\n    if let Some(token_budget) = token_budget {\n        payload[\"token_budget\"] = serde_json::json!(token_budget);\n    }\n    let input_json = serde_json::to_string(&payload)?;\n    let passthrough = vec![\n        \"workflow-tool\".to_string(),\n        \"--approval-source\".to_string(),\n        \"explicit-workflow-command\".to_string(),\n        \"--input-json\".to_string(),\n        input_json,\n    ];\n    let argv = {\n        // Build argv with explicit config path like the previous dispatcher did.\n        let mut args = Vec::new();\n        let executable = std::env::current_exe()\n            .context(\"resolve current Codewhale executable for workflow lane\")?;\n        let executable = executable.into_os_string().into_string().map_err(|path| {\n            anyhow!(\n                \"current Codewhale executable path is not valid UTF-8: {}\",\n                PathBuf::from(path).display()\n            )\n        })?;\n        args.push(executable);\n        // config_path is the explicit workflow config path; prefer it over cli.config\n        let cfg = Some(config_path);\n        if let Some(cp) = cfg {\n            args.push(\"--config\".to_string());\n            args.push(cp.display().to_string());\n        } else if let Some(cp) = cli.config.as_deref() {\n            args.push(\"--config\".to_string());\n            args.push(cp.display().to_string());\n        }\n        if let Some(profile) = cli.profile.as_ref() {\n            args.push(\"--profile\".to_string());\n            args.push(profile.clone());\n        }","sourceCodeStart":1279,"sourceCodeEnd":1315,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/cli/src/lib.rs#L1279-L1315","documentation":"Workflow-lane dispatch re-executes the current binary as `codewhale workflow-tool ...`, building argv as UTF-8 Strings. If the current executable's path contains non-UTF-8 bytes, into_string() fails and this error aborts the workflow lane before spawning. It is an environment/install-location defect, not workflow logic.","triggerScenarios":"The codewhale binary lives at a path whose bytes are not valid UTF-8 (legacy-encoding filenames on Linux, unusual install dirs) and any workflow command is invoked, forcing the self re-exec path.","commonSituations":"Containers or scripts copying the binary into byte-encoded paths; filesystems with non-UTF-8 locale names; extremely rare on standard installs.","solutions":["Reinstall or move the binary to a plain ASCII path (e.g. ~/.local/bin/codewhale)","Remove/rename non-UTF-8 directories from the install path","Check the shell/locale environment if the path looks normal but still fails"],"exampleFix":"# before\n /home/user/\\udcffbin/codewhale workflow run   # error: non-UTF-8 executable path\n\n# after\n mv /home/user/\\udcffbin/codewhale ~/.local/bin/codewhale \n ~/.local/bin/codewhale workflow run","handlingStrategy":"validation","validationCode":"fn codewhale_exe_is_utf8() -> bool {\n    std::env::current_exe()\n        .ok()\n        .and_then(|p| p.into_os_string().into_string().ok())\n        .is_some()\n}\n// Run at install/startup: refuse to install or invoke workflow lanes from non-UTF-8 paths.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the binary under plain ASCII paths (~/.local/bin)","In deployment scripts, assert the install path is UTF-8 before enabling workflow lanes","Avoid moving binaries into locale-encoded or user-mangled directories"],"tags":["cli","workflow","utf-8","path","platform","rust"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}