{"record":{"id":"d782a11713c2e2b1","repo":"zeroclaw-labs/zeroclaw","slug":"openai-codex-endpoint-override-must-use-http-or","errorCode":null,"errorMessage":"OpenAI Codex endpoint override must use http:// or https://","messagePattern":"OpenAI Codex endpoint override must use http:// or https://","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/openai_codex.rs","lineNumber":178,"sourceCode":"    let candidate = base_or_endpoint.trim();\n    if candidate.is_empty() {\n        anyhow::bail!(\"OpenAI Codex endpoint override cannot be empty\");\n    }\n\n    let mut parsed = reqwest::Url::parse(candidate).map_err(|_| {\n        ::zeroclaw_log::record!(\n            WARN,\n            ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Reject)\n                .with_outcome(::zeroclaw_log::EventOutcome::Failure)\n                .with_attrs(::serde_json::json!({\"candidate\": candidate})),\n            \"openai_codex: endpoint override is not a valid URL\"\n        );\n        anyhow::Error::msg(\"OpenAI Codex endpoint override must be a valid URL\")\n    })?;\n\n    match parsed.scheme() {\n        \"http\" | \"https\" => {}\n        _ => anyhow::bail!(\"OpenAI Codex endpoint override must use http:// or https://\"),\n    }\n\n    let path = parsed.path().trim_end_matches('/');\n    if !path.ends_with(\"/responses\") {\n        let with_suffix = if path.is_empty() || path == \"/\" {\n            \"/responses\".to_string()\n        } else {\n            format!(\"{path}/responses\")\n        };\n        parsed.set_path(&with_suffix);\n    }\n\n    parsed.set_query(None);\n    parsed.set_fragment(None);\n\n    Ok(parsed.to_string())\n}\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/openai_codex.rs#L160-L196","documentation":"The openai-codex endpoint override parsed successfully as a URL, but its scheme is neither http nor https (e.g. file://, unix://, ftp://), which reqwest cannot use for the Responses API call. build_responses_url enforces the scheme right after parsing, before appending the /responses path.","triggerScenarios":"provider_api_url set to a unix socket path (unix:///var/run/...), a file:// path, or a copy-pasted internal address with a protocol prefix reqwest does not speak.","commonSituations":"Pointing the codex provider at a local proxy via a socket path; typoed scheme (htps://, https:/); pasting a scraping/proxy target URL that uses a custom scheme.","solutions":["Use an http:// or https:// URL; for local proxies use http://127.0.0.1:<port>.","Fix typoed schemes in the override value.","Remove the override entirely to restore the default OpenAI Responses endpoint."],"exampleFix":"# before\n[providers.models.openai-codex.main]\napi_url = \"unix:///run/codex-proxy.sock\"\n\n# after\n[providers.models.openai-codex.main]\napi_url = \"http://127.0.0.1:8080\"","handlingStrategy":"validation","validationCode":"let ok = url.starts_with(\"https://\") || url.starts_with(\"http://\");\nif !ok {\n    return Err(anyhow::anyhow!(\"endpoint override must be http(s)\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the scheme before writing the override into config","For local proxies use http://127.0.0.1:<port>, never socket paths","Copy endpoint URLs from the provider's docs, not from internal notes"],"tags":["openai-codex","url","scheme","validation","endpoint-override"],"backgroundTag":"invalid-endpoint-url","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}