Skip to content

[codex] Align JCode OpenAI base URL with Codex config - #95

Closed
Cloudymap1e wants to merge 2 commits into
1jehuang:masterfrom
Cloudymap1e:codex/align-jcode-codex-base-url
Closed

Cloudymap1e wants to merge 2 commits into
1jehuang:masterfrom
Cloudymap1e:codex/align-jcode-codex-base-url

Conversation

@Cloudymap1e

@Cloudymap1e Cloudymap1e commented May 2, 2026 •

Copy link
Copy Markdown

Summary

  • read the active Codex CLI model_provider from ~/.codex/config.toml
  • when that provider uses wire_api = "responses" and requires_openai_auth = true, route JCode OpenAI Responses traffic to its base_url
  • apply the same base URL override to sidecar OpenAI calls
  • add regression coverage for config parsing and response URL selection
  • keep session reasoning_effort persisted so overnight session cloning compiles with the existing field usage
  • update OpenRouter test constructors for existing provider fields

Why

JCode could trust Codex auth, but its OpenAI provider still hard-coded OpenAI/ChatGPT base URLs. If Codex was configured to use a Responses-compatible gateway, JCode would send the stale API key to the wrong endpoint and fail with invalid key errors.

Impact

This enables JCode to reuse any active Codex-configured HTTP(S) Responses-compatible base URL that explicitly requires OpenAI auth. It does not treat arbitrary chat-completions providers as OpenAI Responses endpoints.

Validation

  • cargo test configured_responses_base_url
  • cargo test responses_url_uses_active_codex_provider_base_url

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

@Cloudymap1e
Cloudymap1e marked this pull request as ready for review May 2, 2026 08:21
@1jehuang 1jehuang added the triage: converted PR triage: worth tracking as an issue label Jun 12, 2026
@1jehuang

Copy link
Copy Markdown
Owner

Thanks! This repo no longer accepts external PRs, but the underlying problem is real - it's now tracked in #374 (with credit to this PR). Closing.

@1jehuang 1jehuang closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage: converted PR triage: worth tracking as an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants