openai/codex · error · anyhow::Error
managed Codex version output was malformed
Error message
managed Codex version output was malformed
What it means
parse_codex_version splits the `codex --version` output on whitespace and expects the second token (the version string) to exist and be non-empty; output that is empty, a single token, or has a blank second token triggers this sentinel error.
Solutions
- Run the managed binary's `--version` manually and inspect its output format
- Reinstall the standalone Codex install if the binary prints unexpected output
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/app-server-daemon/src/managed_install.rs:97 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/1ba3097b10ec9703.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/app-server-daemon/src/managed_install.rs:97
#[cfg(unix)]
pub(crate) fn executable_identity_from_bytes(bytes: &[u8]) -> ExecutableIdentity {
ExecutableIdentity {
digest: Sha256::digest(bytes).into(),
}
}
fn managed_codex_file_name() -> &'static str {
if cfg!(windows) { "codex.exe" } else { "codex" }
}
#[cfg(unix)]
fn parse_codex_version(output: &str) -> Result<String> {
let version = output
.split_whitespace()
.nth(1)
.filter(|version| !version.is_empty())
.ok_or_else(|| anyhow!("managed Codex version output was malformed"))?;
Ok(version.to_string())
}
#[cfg(all(test, unix))]
#[path = "managed_install_tests.rs"]
mod tests;
View on GitHub (pinned to 339751715c)