Title: opencode-route-proxy: GPT providers resolved to api.openai.com (PAYG door) instead of the credential-backed Codex backend · Issue #4444 · developing-today/code · GitHub
Open Graph Title: opencode-route-proxy: GPT providers resolved to api.openai.com (PAYG door) instead of the credential-backed Codex backend · Issue #4444 · developing-today/code
X Title: opencode-route-proxy: GPT providers resolved to api.openai.com (PAYG door) instead of the credential-backed Codex backend · Issue #4444 · developing-today/code
Description: Defect The route proxy resolves the plan-backed GPT providers (openai, openai.alternate) to the wrong backend door. code#3256 recorded that both provider blocks in the deployed config are empty shells. OpenCode tolerates that because its...
Open Graph Description: Defect The route proxy resolves the plan-backed GPT providers (openai, openai.alternate) to the wrong backend door. code#3256 recorded that both provider blocks in the deployed config are empty she...
X Description: Defect The route proxy resolves the plan-backed GPT providers (openai, openai.alternate) to the wrong backend door. code#3256 recorded that both provider blocks in the deployed config are empty she...
Opengraph URL: https://github.com/developing-today/code/issues/4444
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"opencode-route-proxy: GPT providers resolved to api.openai.com (PAYG door) instead of the credential-backed Codex backend","articleBody":"## Defect\n\nThe route proxy resolves the plan-backed GPT providers (`openai`, `openai.alternate`) to the wrong backend door.\n\ncode#3256 recorded that both provider blocks in the deployed config are empty shells. OpenCode tolerates that because its built-in `openai` provider wires the ACTIVE credential to its proper backend: `chatgpt-browser` (main) and `chatgpt-headless` (alternate) both talk to the ChatGPT/Codex backend, not to `api.openai.com`.\n\ncode PR #3830 closed the proxy symptom by adding built-in endpoint defaults in `bin/opencode-route-proxy.mjs`, including `https://api.openai.com/v1` for `openai`. That is the PAYG platform door. Live proof on 2026-11-02 (see code#2518 evidence: https://github.com/developing-today/code/issues/2518#issuecomment-6581998868) showed both GPT members answering 429 through the proxy, with the main leaf reporting \"no credits remaining\" from the platform door, while the fork's internal routing to the same plans works.\n\n## Required fix\n\nThe proxy must resolve a leaf provider the way OpenCode itself resolves it: provider + its active credential determines the backend. No invented vendor defaults.\n\n- Configured `baseURL` wins when present.\n- Otherwise use built-in resolution keyed by the provider's ACTIVE credential type: `chatgpt-browser` / `chatgpt-headless` -> ChatGPT/Codex backend using the fork's exact request contract; a genuine platform/API-key credential -> platform door.\n- Remove the `api.openai.com` default for plan-backed providers.\n- Fail closed on unresolvable leaves. NEVER fall back to the PAYG API door.\n\n## Acceptance\n\n- Proxy tests cover the credential-keyed resolution and the fail-closed behavior.\n- After merge + one restart of `opencode-route-proxy.service`, live proof on production :18750: `terra-plan` reaches the Codex backend (main member success, or a genuine Codex-backend plan/quota response); the alternate member's wall (weekly, until Nov 6) presents as the Codex backend's quota response, never \"no credits remaining\" from api.openai.com.\n- OpenCode session counts in opencode.db unchanged across the proof; route_attempt rows recorded with `session_id` NULL.\n\n\n## Acceptance criteria\n- The route proxy resolves the `openai` and `openai.alternate` leaves by their active credential the way OpenCode does — to the ChatGPT/Codex backend (chatgpt-browser / chatgpt-headless) — and never defaults a plan-backed provider to `https://api.openai.com/v1`.\n- A route attempt through the proxy for both GPT providers reaches the credential-backed backend: no platform-door 'no credits remaining' 429 of the kind recorded on issue #2518 while the same plans answer via the fork's internal routing.\n- Proxy tests cover provider resolution by active credential, including the case where a leaf's config block is an empty shell (issue #3256).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-02T16:16:58Z","url":"https://github.com/developing-today/code/issues/4444"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d641c060-c3fe-7056-2d72-cde5ea2e4528 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81FA:1A09C8:C9CDEA:10518CB:6B064180 |
| html-safe-nonce | 9c547664eb5a018455a2d13bc4133af5c1f8b60d4eddcf9ce9e4459d0288ba18 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUZBOjFBMDlDODpDOUNERUE6MTA1MThDQjo2QjA2NDE4MCIsInZpc2l0b3JfaWQiOiIzODc3NjQxMDI4MDQzNjg2MjcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 50a0f51c86354d9c50e40e2a8548390866701220c0f6bd4f9f4d5b8418d3e2ce |
| hovercard-subject-tag | issue:6166399816 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/4444/issue_layout |
| twitter:image | https://opengraph.githubassets.com/abc382acc460a351ee46240d1033d0b6a5532b0c4cd77be930c7b87f543a3731/developing-today/code/issues/4444 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/abc382acc460a351ee46240d1033d0b6a5532b0c4cd77be930c7b87f543a3731/developing-today/code/issues/4444 |
| og:image:alt | Defect The route proxy resolves the plan-backed GPT providers (openai, openai.alternate) to the wrong backend door. code#3256 recorded that both provider blocks in the deployed config are empty she... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width