openai/codex · error · std::io::Error

cannot be blank

Error message

{field_label} cannot be blank

What it means

A normalization helper for string fields (description, nickname candidate, etc.) received a value that is present but trims to empty whitespace. Blank values are rejected because the field label names where it came from and an empty value is indistinguishable from missing.

Solutions

  1. Provide a non-blank value for {field_label}.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/core/src/config/agent_roles.rs:339 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/ee7f9c4505184570. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/core/src/config/agent_roles.rs:339

    let path_uri = PathUri::from_abs_path(path);
    let contents = fs
        .read_file_text(&path_uri, ReadFileOptions::default(), /*sandbox*/ None)
        .await?;
    let config_base_dir = path.parent().unwrap_or_else(|| path.clone());
    parse_agent_role_file_contents(
        &contents,
        path.as_path(),
        config_base_dir.as_path(),
        role_name_hint,
    )
}

fn normalize_agent_role_description(
    field_label: &str,
    description: Option<&str>,
) -> std::io::Result<Option<String>> {
    match description.map(str::trim) {
        Some("") => Err(std::io::Error::new(
            std::io::ErrorKind::InvalidInput,
            format!("{field_label} cannot be blank"),
        )),
        Some(description) => Ok(Some(description.to_string())),
        None => Ok(None),
    }
}

fn validate_required_agent_role_description(
    role_name: &str,
    description: Option<&str>,
) -> std::io::Result<()> {
    if description.is_some() {
        Ok(())
    } else {
        Err(std::io::Error::new(
            std::io::ErrorKind::InvalidInput,
            format!("agent role `{role_name}` must define a description"),

View on GitHub (pinned to 339751715c)