You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Respect active Codex Responses provider base URL for OpenAI-compatible traffic #374
autonomous: likelyProbably hands-off: clearly worth fixing, agent can do it, minor judgment needed.from-prIssue created from an external PR during triagepriority: lowP3 - nice to have / minor / cosmetic
When ~/.codex/config.toml configures a Responses-compatible gateway, JCode does not reuse that base URL and may send Codex/OpenAI Responses traffic to the wrong endpoint.
Credit: originally proposed in PR #95. This repo no longer accepts external PRs, so the problem is tracked here instead.
Confirmed in crates/jcode-base/src/provider/openai.rs. The Responses API base URL is resolved by resolve_api_base() (lines 861-900), which only checks env vars (JCODE_OPENAI_API_BASE, OPENAI_BASE_URL, OPENAI_API_BASE) and otherwise defaults to https://api.openai.com/v1. It never consults ~/.codex/config.toml. The only place we read that file is crates/jcode-base/src/mcp/protocol.rs (import_from_external, line 245) for MCP server import — not for the Responses base URL. So when a user has a Responses-compatible gateway configured in Codex's config.toml (model_provider base_url / wire_api), JCode ignores it and may send Codex/OpenAI Responses traffic to the default endpoint.
Fix path: in resolve_api_base() (API-key mode only; ChatGPT/Codex OAuth backend stays fixed per lines 840-844), after the env-var checks, fall back to parsing the active model_provider base_url from ~/.codex/config.toml before defaulting to OPENAI_API_BASE. Reuse the existing absolute-http(s) validation.
Labels: autonomous: likely (needs minor judgment on which Codex config field to honor and precedence vs env), priority: low (niche; env-var override already exists as a workaround).
autonomous: likelyProbably hands-off: clearly worth fixing, agent can do it, minor judgment needed.from-prIssue created from an external PR during triagepriority: lowP3 - nice to have / minor / cosmetic
Activity
1jehuang commentedon Jun 25, 2026
Triage: reproducible, clear fix path.
Confirmed in
crates/jcode-base/src/provider/openai.rs. The Responses API base URL is resolved byresolve_api_base()(lines 861-900), which only checks env vars (JCODE_OPENAI_API_BASE,OPENAI_BASE_URL,OPENAI_API_BASE) and otherwise defaults tohttps://api.openai.com/v1. It never consults~/.codex/config.toml. The only place we read that file iscrates/jcode-base/src/mcp/protocol.rs(import_from_external, line 245) for MCP server import — not for the Responses base URL. So when a user has a Responses-compatible gateway configured in Codex'sconfig.toml(model_provider base_url / wire_api), JCode ignores it and may send Codex/OpenAI Responses traffic to the default endpoint.Fix path: in
resolve_api_base()(API-key mode only; ChatGPT/Codex OAuth backend stays fixed per lines 840-844), after the env-var checks, fall back to parsing the active model_provider base_url from~/.codex/config.tomlbefore defaulting toOPENAI_API_BASE. Reuse the existing absolute-http(s) validation.Labels: autonomous: likely (needs minor judgment on which Codex config field to honor and precedence vs env), priority: low (niche; env-var override already exists as a workaround).
1jehuang commentedon Jun 25, 2026
Fixed in
b96dfa47(pending release). Built and tests pass on Linux. See commit message for the specific change for this issue.Fix several triaged GH issues (#369, #371, #373, #365, #374, #402)
1jehuang commentedon Jun 28, 2026
Released in v0.32.0. Run
jcode updateto get it.Fix several triaged GH issues (1jehuang#369, 1jehuang#371, 1jehuang#373…
Fix several triaged GH issues (1jehuang#369, 1jehuang#371, 1jehuang#373…