openai/codex · error · LegacyAppPathStringError
opaque fallback path URI
Error message
opaque fallback path URI `{path}` cannot be recovered as a native path What it means
The OpaqueFallback variant of LegacyAppPathStringError: the PathUri was created as an opaque fallback (from_path_uri could not build a real filesystem path), and render_windows_path was then asked to recover a native Windows path from it. Opaque URIs intentionally carry no recoverable native path, so conversion is impossible.
Solutions
- Keep the value as a URI string instead of forcing native-path conversion
- Reconstruct the PathUri from the original absolute path rather than the fallback
- Handle the opaque case upstream and skip path-based operations for it
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/utils/path-uri/src/api_path_string.rs:352 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/84ae29d023236d84.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/utils/path-uri/src/api_path_string.rs:352
}
fn decode_native_segment(segment: &str) -> String {
// Decode exactly once. Thus `%20` becomes a space and `%252F` becomes the
// literal text `%2F`, rather than being decoded a second time into `/`.
let bytes = urlencoding::decode_binary(segment.as_bytes());
String::from_utf8_lossy(&bytes).into_owned()
}
fn incompatible_convention(path: &PathUri, convention: PathConvention) -> LegacyAppPathStringError {
LegacyAppPathStringError::IncompatibleConvention {
path: path.to_string(),
convention,
}
}
#[derive(Debug, Error, PartialEq, Eq)]
pub enum LegacyAppPathStringError {
#[error("opaque fallback path URI `{path}` cannot be recovered as a native path")]
OpaqueFallback { path: String },
#[error("path URI `{path}` cannot be rendered using {convention} path syntax")]
IncompatibleConvention {
path: String,
convention: PathConvention,
},
#[error(
"path `{path}` is not absolute{convention}",
convention = .convention.map(|convention| format!(" using {convention} path syntax")).unwrap_or_default()
)]
InvalidNativePath {
path: String,
convention: Option<PathConvention>,
},
}
#[cfg(test)]
#[path = "api_path_string_tests.rs"]View on GitHub (pinned to 339751715c)