openai/codex · error · Error
starlark error
Error message
starlark error: {0} What it means
Wraps a Starlark interpreter error raised while evaluating the policy's Starlark source — syntax errors, undefined functions, or runtime failures inside the policy script. The payload carries the interpreter's message.
Solutions
- Read the wrapped Starlark message for the script location and cause
- Fix the syntax or runtime error in the policy's Starlark source
- Verify any functions called in the script are defined and permitted by the Starlark environment
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/execpolicy/src/error.rs:49 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/cea07b235a76ed5a.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/execpolicy/src/error.rs:49
InvalidExample(String),
#[error("invalid rule: {0}")]
InvalidRule(String),
#[error(
"expected every example to match at least one rule. rules: {rules:?}; unmatched examples: \
{examples:?}"
)]
ExampleDidNotMatch {
rules: Vec<String>,
examples: Vec<String>,
location: Option<ErrorLocation>,
},
#[error("expected example to not match rule `{rule}`: {example}")]
ExampleDidMatch {
rule: String,
example: String,
location: Option<ErrorLocation>,
},
#[error("starlark error: {0}")]
Starlark(StarlarkError),
}
impl Error {
pub fn with_location(self, location: ErrorLocation) -> Self {
match self {
Error::ExampleDidNotMatch {
rules,
examples,
location: None,
} => Error::ExampleDidNotMatch {
rules,
examples,
location: Some(location),
},
Error::ExampleDidMatch {
rule,
example,View on GitHub (pinned to 339751715c)