openai/codex · error · Error
Unsupported target triple: ${targetTriple}
Error message
Unsupported target triple: ${targetTriple} What it means
A match.query entry in a MITM hook maps a query-parameter name to an empty list of allowed values. Each value must be a matcher — an exact literal by default, a literal forced with the literal: prefix, or a glob with the pattern: prefix — and at least one is required because an empty list would constrain nothing while looking like it does. Raised by validate_query_constraints while validate_mitm_hook_config walks the hooks at config load.
Source
Thrown at codex-cli/bin/codex.js:76
break;
case "arm64":
targetTriple = "aarch64-pc-windows-msvc";
break;
default:
break;
}
break;
default:
break;
}
if (!targetTriple) {
throw new Error(`Unsupported platform: ${platform} (${arch})`);
}
const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
if (!platformPackage) {
throw new Error(`Unsupported target triple: ${targetTriple}`);
}
function findCodexExecutable() {
let vendorRoot;
try {
const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
vendorRoot = path.join(path.dirname(packageJsonPath), "vendor");
} catch {
vendorRoot = path.join(__dirname, "..", "vendor");
}
const codexExecutable = path.join(
vendorRoot,
targetTriple,
"bin",
process.platform === "win32" ? "codex.exe" : "codex",
);
if (existsSync(codexExecutable)) {View on GitHub (pinned to 339751715c)
Solutions
- Remove the query key entirely if the parameter should not be constrained
- List at least one allowed value: per_page = ["30", "100"]
- To explicitly accept any value, use a catch-all glob: per_page = ["pattern:*"]
Example fix
// config.toml — before [network.mitm_hooks.match.query] per_page = [] // after [network.mitm_hooks.match.query] per_page = ["30", "100"] // or, if the parameter should be unconstrained, delete the key entirely
Defensive patterns
Strategy: validation
Validate before calling
for (name, values) in &hook.matcher.query {
if values.is_empty() {
return Err(anyhow!("query key {name:?} lists no allowed values"));
}
} Type guard
fn query_constraints_satisfiable(hook: &MitmHookConfig) -> bool {
hook.matcher.query.values().all(|v| !v.is_empty())
} Try / catch
match validate_mitm_hook_config(&config) {
Ok(()) => {}
Err(err) if err.to_string().contains("must list at least one allowed value") => { /* drop or fill the named key */ }
Err(err) => return Err(err),
} Prevention
- Omit a query key rather than mapping it to [] when the parameter is unconstrained
- Snapshot-test the deserialized MitmHookConfig so empty lists surface in review
- Validate config at startup, not at first request
When it happens
Trigger: A mitm_hooks entry with [network.mitm_hooks.match.query] per_page = [] — a TOML key mapped to an empty array; equally, a Rust-built BTreeMap<String, Vec<String>> with an empty Vec for some key. Validation fails before the proxy starts.
Common situations: Placeholder arrays from a template that were never filled in; intending 'allow any value for this parameter' — dropping the key entirely is how that is expressed, not an empty list; leftover entries after all values were removed in a config cleanup.
Understand the failure class
Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.
Related errors
- Unsupported platform: ${platform} (${arch})
- Missing optional dependency ${platformPackage}. Reinstall Co
- invalid agent graph store request: {message}
- agent graph store internal error: {message}
- Agent Identity only supports production and staging ChatGPT
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/7492ebbddf38763e.
Report an issue: GitHub.