openai/codex · error
must match ^[a-zA-Z0-9_-]+$
Error message
{LABEL} must match ^[a-zA-Z0-9_-]+$ What it means
The namespace in {LABEL} contains characters outside ASCII alphanumerics, underscore, and hyphen, violating ^[a-zA-Z0-9_-]+$. The strict charset keeps namespaces unambiguous across protocol, filesystem, and display contexts.
Solutions
- Use only letters, digits, underscores, and hyphens in {LABEL}.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/core/src/config/mod.rs:3078 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/c14a0c4d770d9fa6.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/core/src/config/mod.rs:3078
return Ok(());
};
if namespace.is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{LABEL} must not be empty"),
));
}
if namespace.trim() != namespace {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{LABEL} must not have leading or trailing whitespace"),
));
}
if !namespace
.bytes()
.all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-'))
{
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{LABEL} must match ^[a-zA-Z0-9_-]+$"),
));
}
if namespace.chars().count() > MAX_LEN {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{LABEL} must be at most {MAX_LEN} characters"),
));
}
if namespace == "mcp"
|| namespace.starts_with("mcp__")
|| RESERVED_RESPONSES_NAMESPACES.contains(&namespace)
{
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{LABEL} uses a reserved namespace: {namespace}"),
));View on GitHub (pinned to 339751715c)