Skip to content

Conversation

@fdematos
Copy link
Contributor

@fdematos fdematos commented Jan 10, 2026

Summary

  • Extracts ChatGPT account/workspace ID from OAuth JWT claims (including nested auth claims).
  • Stores accountId in OAuth credentials and reuses it for Codex API requests.
  • Adds unit tests for JWT parsing and account ID extraction.

Details

  • Uses ChatGPT-Account-Id header required by organization plans.
  • Preserves accountId during token refresh.

Testing

  • bun test test/plugin/codex.test.ts

Issue

Fixes #7570

Store and reuse ChatGPT workspace identifiers from OAuth tokens so Codex API
requests include the account header needed for organization plans. Add unit
tests for JWT claim parsing and account id extraction.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Users with organization subscriptions who were already authenticated
before this fix will need to re-authenticate (opencode auth logout
then opencode auth login) to get the accountId stored.
Remove custom base64UrlDecode function in favor of built-in Buffer API.
@rekram1-node rekram1-node merged commit 1662e14 into anomalyco:dev Jan 10, 2026
5 checks passed
fwang pushed a commit to lifefloating/opencode that referenced this pull request Jan 10, 2026
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.

OpenAI does Not work when trying with Organization Subscription

2 participants