Skip to content

let codex force ChatGPT login by org too#18390

Draft
rreichel3-oai wants to merge 5 commits into
mainfrom
rreichel3/forced-chatgpt-org-id-list
Draft

let codex force ChatGPT login by org too#18390
rreichel3-oai wants to merge 5 commits into
mainfrom
rreichel3/forced-chatgpt-org-id-list

Conversation

@rreichel3-oai
Copy link
Copy Markdown
Contributor

What problem this is solving

The backend stack teaches authorize/auth enforcement about allowed_org_id, but Codex still only knows how to force ChatGPT login to specific workspace IDs.

This adds the parallel org-level config path so we can say "any workspace in this org is fine" instead of having to enumerate workspace IDs.

This is stacked on top of #18161.

What I changed

  • add forced_chatgpt_org_id to config.toml, runtime config, and app-server config surfaces
  • make it accept either a single string or a list, the same way forced_chatgpt_workspace_id does
  • reject configs that try to set both workspace and org restrictions at once
  • thread org restrictions through browser login, device-code login, and local auth checks
  • enforce org restrictions from the ChatGPT token's organization_id claim
  • add regression coverage for org restriction enforcement plus the mutual-exclusion config check

Validation

  • cargo test -p codex-login
  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-core config:: --lib
  • cargo test -p codex-tui local_chatgpt_auth

codex-rs/core/src/config/mod.rs: honor a debug-only CODEX_DISABLE_MANAGED_CONFIG env var in the main config loader so local interactive testing can ignore managed config and managed preferences outside app-server flows.
Add forced_chatgpt_org_id config parsing, runtime validation, and mutual exclusion with forced_chatgpt_workspace_id.\n\nThread org restrictions through browser and device-code login flows, auth enforcement, local auth loading, and app-server config schemas, with focused regression coverage for org restriction handling.
@rreichel3-oai rreichel3-oai force-pushed the rreichel3/forced-chatgpt-workspace-id-list branch 3 times, most recently from fd71d7c to e12d9db Compare April 22, 2026 19:50
@rreichel3-oai rreichel3-oai force-pushed the rreichel3/forced-chatgpt-workspace-id-list branch 5 times, most recently from cd69a02 to 949782b Compare May 8, 2026 20:39
@rreichel3-oai rreichel3-oai force-pushed the rreichel3/forced-chatgpt-workspace-id-list branch 2 times, most recently from e2503f3 to d14a17b Compare May 13, 2026 21:06
Base automatically changed from rreichel3/forced-chatgpt-workspace-id-list to main May 14, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant