{"record":{"id":"7492ebbddf38763e","repo":"openai/codex","slug":"unsupported-target-triple-targettriple","errorCode":null,"errorMessage":"Unsupported target triple: ${targetTriple}","messagePattern":"Unsupported target triple: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"codex-cli/bin/codex.js","lineNumber":76,"sourceCode":"        break;\n      case \"arm64\":\n        targetTriple = \"aarch64-pc-windows-msvc\";\n        break;\n      default:\n        break;\n    }\n    break;\n  default:\n    break;\n}\n\nif (!targetTriple) {\n  throw new Error(`Unsupported platform: ${platform} (${arch})`);\n}\n\nconst platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];\nif (!platformPackage) {\n  throw new Error(`Unsupported target triple: ${targetTriple}`);\n}\n\nfunction findCodexExecutable() {\n  let vendorRoot;\n  try {\n    const packageJsonPath = require.resolve(`${platformPackage}/package.json`);\n    vendorRoot = path.join(path.dirname(packageJsonPath), \"vendor\");\n  } catch {\n    vendorRoot = path.join(__dirname, \"..\", \"vendor\");\n  }\n\n  const codexExecutable = path.join(\n    vendorRoot,\n    targetTriple,\n    \"bin\",\n    process.platform === \"win32\" ? \"codex.exe\" : \"codex\",\n  );\n  if (existsSync(codexExecutable)) {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-cli/bin/codex.js#L58-L94","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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:*\"]"],"exampleFix":"// config.toml — before\n[network.mitm_hooks.match.query]\nper_page = []\n\n// after\n[network.mitm_hooks.match.query]\nper_page = [\"30\", \"100\"]\n\n// or, if the parameter should be unconstrained, delete the key entirely","handlingStrategy":"validation","validationCode":"for (name, values) in &hook.matcher.query {\n    if values.is_empty() {\n        return Err(anyhow!(\"query key {name:?} lists no allowed values\"));\n    }\n}","typeGuard":"fn query_constraints_satisfiable(hook: &MitmHookConfig) -> bool {\n    hook.matcher.query.values().all(|v| !v.is_empty())\n}","tryCatchPattern":"match validate_mitm_hook_config(&config) {\n    Ok(()) => {}\n    Err(err) if err.to_string().contains(\"must list at least one allowed value\") => { /* drop or fill the named key */ }\n    Err(err) => return Err(err),\n}","preventionTips":["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"],"tags":["rust","network-proxy","mitm-hooks","query-string","config-validation"],"backgroundTag":"config-validation-failed","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}