Skip to content

Treat ChatGPT hc plan as Enterprise#15789

Merged
arnavdugar-openai merged 3 commits intomainfrom
dev/arnavdugar/codex/add-hc-as-valid-enterprise-plan-type
Mar 25, 2026
Merged

Treat ChatGPT hc plan as Enterprise#15789
arnavdugar-openai merged 3 commits intomainfrom
dev/arnavdugar/codex/add-hc-as-valid-enterprise-plan-type

Conversation

@arnavdugar-openai
Copy link
Contributor

@arnavdugar-openai arnavdugar-openai commented Mar 25, 2026

Motivation

  • Cloud requirements fetching only ran for Business or Enterprise accounts, but some ID tokens report chatgpt_plan_type: "hc", which should be treated as an enterprise-equivalent plan.

Description

  • Map raw plan string "hc" to KnownPlan::Enterprise in PlanType::from_raw_value by treating "enterprise" | "hc" as Enterprise in login/src/token_data.rs.
  • Add a unit test in login/src/token_data_tests.rs asserting a JWT with chatgpt_plan_type: "hc" parses as Enterprise and is considered a workspace account.
  • Add a unit test in cloud-requirements/src/lib.rs verifying hc accounts are eligible to fetch cloud requirements (treated like Enterprise).
  • Run formatting (just fmt) after changes.

Testing

  • Ran just fmt (succeeded).
  • Ran cargo test -p codex-login --lib id_token_info_parses_hc_plan_as_enterprise (passed).
  • Ran cargo test -p codex-cloud-requirements --lib fetch_cloud_requirements_allows_hc_plan_as_enterprise (passed) and cargo test -p codex-cloud-requirements (all tests passed).
  • Ran just argument-comment-lint-from-source (required installing cargo-dylint/dylint-link and the nightly toolchain as part of the run).
  • Note: a full cargo test -p codex-login run showed one unrelated, environment-dependent test failure (auth::default_client::tests::test_create_client_sets_default_headers) that is not caused by these changes; the targeted login unit added here passes.

Codex Task

@arnavdugar-openai arnavdugar-openai added the codex Label used by connector to tag PRs that have been reviewed by Codex label Mar 25, 2026 — with ChatGPT Codex Connector
@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@arnavdugar-openai
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 25, 2026
@arnavdugar-openai arnavdugar-openai merged commit eee692e into main Mar 25, 2026
36 checks passed
@arnavdugar-openai arnavdugar-openai deleted the dev/arnavdugar/codex/add-hc-as-valid-enterprise-plan-type branch March 25, 2026 22:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

codex Label used by connector to tag PRs that have been reviewed by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants