openai/codex · error · std::io::Error
agents. .config_file must point to a file
Error message
agents.{role_name}.config_file must point to a file: {} What it means
Metadata for agents.{role_name}.config_file was retrieved successfully but reports the path is not a regular file (a directory, fifo, device, etc.). The config_file must point to an actual file containing TOML config.
Solutions
- Point `agents.{role_name}.config_file` at a regular file, not a directory.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/core/src/config/agent_roles.rs:416 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/c55dc76054330880.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/core/src/config/agent_roles.rs:416
.get_metadata(
&config_file_uri,
GetMetadataOptions::default(),
/*sandbox*/ None,
)
.await
.map_err(|e| {
std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!(
"agents.{role_name}.config_file must point to an existing file at {}: {e}",
config_file.as_path().display()
),
)
})?;
if metadata.is_file {
Ok(())
} else {
Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!(
"agents.{role_name}.config_file must point to a file: {}",
config_file.as_path().display()
),
))
}
}
fn normalize_agent_role_nickname_candidates(
field_label: &str,
nickname_candidates: Option<&[String]>,
) -> std::io::Result<Option<Vec<String>>> {
let Some(nickname_candidates) = nickname_candidates else {
return Ok(None);
};
if nickname_candidates.is_empty() {View on GitHub (pinned to 339751715c)