fix(codex): accept current ChatGPT workspace plans #8294
main fromrefs/pull/8294/head·opened View on GitHubWhat Changed#
- Add all five plan values emitted by current Codex but missing from T3 Code's pinned schemas:
self_serve_business_prolite,ent26,enterprise_cbp_automation,edu_plus, andedu_pro. - Keep the schema generator reproducible without pulling unrelated protocol changes from a newer upstream snapshot.
- Normalize future unknown plans only at the plan-bearing paths for
account/read,account/rateLimits/read,account/updated, andaccount/rateLimits/updated. - Classify legacy and current wire values using current product families: Business, Enterprise, and Edu. In particular, the legacy
teamwire value now displays as ChatGPT Business. - Add protocol, mock-peer, forward-compatibility, opaque-payload, and provider-label regression coverage.
Why#
Codex 0.149.1 can return account plan values that T3 Code's pinned protocol schema does not recognize. Schema decoding then rejects account/read during the provider probe and prevents the Codex provider from starting.
PR #7869 is an incomplete fix. It is framed around Edu Plus, does not add all five current values to the schema, and recursively rewrites every field named planType in every protocol payload. Its automated reviews correctly identified two problems with that approach: it can corrupt opaque tool or structured-content data, and it traverses and reallocates large unrelated payloads.
This change recognizes every plan in Codex's current PlanType enum and keeps a forward-compatible fallback constrained to the four account methods and their exact plan-bearing fields. Unrelated payloads retain object identity and opaque nested planType fields remain untouched.
ChatGPT for Teachers is a current offering, but Codex does not currently define a distinct Teachers/K–12 wire value. This PR deliberately does not invent one; any future distinct value safely decodes as unknown until the pinned schema is updated.
Fixes #8292. Also resolves #7828.
UI Changes#
No frontend component or layout changes. The existing provider status UI receives corrected account-family labels from the server, including ChatGPT Business for the legacy team wire value. This mapping is covered by a focused provider-status test.
Verification#
vp test run packages/effect-codex-app-server/src/_internal/shared.test.ts packages/effect-codex-app-server/src/client.test.ts packages/effect-codex-app-server/src/protocol.test.ts apps/server/src/provider/Layers/ProviderRegistry.test.ts— 72 tests passedvp run --filter effect-codex-app-server typecheck— passedvp run --filter t3 typecheck— passed- Targeted
vp lintandvp fmtfor all changed source and test files — passed
Checklist#
- This PR is small and focused
- I explained what changed and why
- No frontend component or layout changes require screenshots
- No animation or interaction changes require video
GPT-5 via Codex
Note
Medium Risk Changes Codex account protocol decoding and provider probe behavior on a critical startup path, but scope is limited to plan-type enums and targeted normalization rather than broad payload rewriting.
Overview
Fixes Codex provider startup when newer binaries return account planType values that the pinned app-server schema did not recognize (e.g. Codex 0.149.1), which caused account/read decoding to fail during the provider probe.
The pinned PlanType enums in generated schemas are expanded for five current wire values (self_serve_business_prolite, ent26, enterprise_cbp_automation, edu_plus, edu_pro), and the schema generator overrides selected plan-type definitions with a fixed list so decoding stays compatible without bumping the whole upstream protocol snapshot.
Forward compatibility: before decode, normalizeAccountPlanTypes maps unrecognized planType strings to unknown only on account-related methods and specific fields (account, rateLimits, rateLimitsByLimitId), leaving unrelated payloads and nested opaque planType fields unchanged.
On the server, codexAccountAuthLabel groups legacy and new workspace values into Business, Enterprise, and Edu families (including mapping legacy team to ChatGPT Business). Regression tests cover protocol decoding, client account/read, normalization behavior, and provider status labels.
Note
Accept current ChatGPT workspace planType values in Codex provider#
- Expands
planTypeenums across account schemas in schema.gen.ts to includeteam,self_serve_business_prolite,ent26,enterprise_cbp_automation,edu_plus,edu_pro, and other current workspace plan variants. - Introduces
normalizeAccountPlanTypesin shared.ts which coerces unrecognized futureplanTypevalues to'unknown'for targeted methods (account/read,account/rateLimits/read,account/updated,account/rateLimits/updated) before schema decoding, preventing decode failures on future plan types. - Updates
codexAccountAuthLabelin CodexProvider.ts to map the new plan variants to Business, Enterprise, and Edu subscription labels. - Pins
ACCOUNT_PLAN_TYPESin generate.ts so the generator overrides selectedplanTypeenums with a fixed list, decoupling decoding from unrelated upstream schema changes. - Behavioral Change: payloads with
planTypevalues not in the pinned set are normalized to'unknown'rather than causing decode failures; unrelated/opaque fields in those payloads are preserved by reference.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
11050beMacroscope's review found this PR approvable — The PR is a focused Codex compatibility fix that adds current workspace plan values, safely handles future account plans, and updates existing subscription labels. Runtime changes are confined to account decoding and provider status reporting, with targeted regression coverage and no broad behavioral or infrastructure impact.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Would be amazing to get this merged ASAP, as we can not currently use Codex via T3 Chat at all.
+1 - having problems using Codex via t3 code due to this exact issue.
Independent verification#
I re-ran the focused verification against exact head
8fc1578bea00b3ec1305f454d555f880ef1b4904using Node 24.14.1:vp test run packages/effect-codex-app-server/src/_internal/shared.test.ts packages/effect-codex-app-server/src/client.test.ts packages/effect-codex-app-server/src/protocol.test.ts apps/server/src/provider/Layers/ProviderRegistry.test.ts 4 test files passed; 72 tests passed vp run --filter effect-codex-app-server typecheck passed vp run --filter t3 typecheck passed, with only pre-existing Effect suggestionsI also checked the implementation against the complete current upstream
PlanTypematrix. It preserves all 17 current values, includes the five values missing from the pinned schema, classifies Business/Enterprise/Edu variants, and constrains future fallback handling to the exact account plan-bearing paths. The opaqueplanTyperegression coverage addresses the correctness concern raised on #7869.GitHub currently reports this PR as mergeable but
BLOCKED; the required repository test workflows are not present in the check rollup. A maintainer approval to run the fork workflows appears to be the remaining gate.Please please merge this asap, can't use Codex at all on an enterprise account presently
Note
🤖 GPT-5.6 Sol responding on behalf of Theo
We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.
#8447 has merged the five known Codex 0.150 plan values into main. The future-unknown fallback has not landed. We selected #7869 for that work because it applies the fallback at the generated
PlanTypeschema unions. This branch's path-specific normalization and provider label fixtures remain useful reference.If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
0a346a80-9929-40ed-88f4-2ea78bc620dbYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.