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

{field_label} may only contain ASCII letters, digits, spaces

Error message

{field_label} may only contain ASCII letters, digits, spaces, hyphens, and underscores

What it means

Error "{field_label} may only contain ASCII letters, digits, spaces, hyphens, and underscores" thrown in openai/codex.

Source

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

        if normalized_nickname.is_empty() {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidInput,
                format!("{field_label} cannot contain blank names"),
            ));
        }

        if !seen_candidates.insert(normalized_nickname.to_owned()) {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidInput,
                format!("{field_label} cannot contain duplicates"),
            ));
        }

        if !normalized_nickname
            .chars()
            .all(|c| c.is_ascii_alphanumeric() || matches!(c, ' ' | '-' | '_'))
        {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidInput,
                format!(
                    "{field_label} may only contain ASCII letters, digits, spaces, hyphens, and underscores"
                ),
            ));
        }

        normalized_candidates.push(normalized_nickname.to_owned());
    }

    Ok(Some(normalized_candidates))
}

async fn discover_agent_roles_in_dir(
    fs: &dyn ExecutorFileSystem,
    agents_dir: &AbsolutePathBuf,
    declared_role_files: &BTreeSet<PathBuf>,
    startup_warnings: &mut Vec<String>,

View on GitHub (pinned to 339751715c)

Solutions

  1. Restrict {field_label} entries to ASCII letters, digits, spaces, hyphens, and underscores.

When it happens

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