forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 2
fix(codex): write token refresh to openai provider ID #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
00603d3
fix(codex): write refresh tokens to openai id
shuv1337 78fff0a
fix(auth): fallback to legacy codex entry
shuv1337 5667123
feat(config): add openai multi-account flag
shuv1337 7e7acc2
feat(plugin): add optional oauth email field
shuv1337 a660b76
fix(auth): migrate legacy codex oauth entry
shuv1337 8cb16e3
feat(plugin): add optional oauth name field
shuv1337 8bedb9a
feat(auth): add email field to OAuth schema
shuv1337 67002a1
feat(auth): add name field to OAuth schema
shuv1337 aa9aaf9
feat(auth): add plan field to OAuth schema
shuv1337 578d8b8
feat(auth): add orgName field to OAuth schema
shuv1337 af70e14
feat(auth): persist OAuth metadata fields in ProviderAuth.callback
shuv1337 d7496e3
test(auth): add codex-migration.test.ts with 5 tests
shuv1337 624d2ec
docs(agents): add testing notes for running tests from packages/opencode
shuv1337 4263482
test(auth): add token refresh migration test for openai provider ID
shuv1337 88bbc1a
docs(prd): mark migration tests as complete
shuv1337 ccbecb6
feat(codex): extract user info from id_token claims
shuv1337 7b4e652
docs(plugin): add JSDoc comments for OAuth metadata fields
shuv1337 5ac4b59
feat(codex): add ChatGPT user info fetch and plan normalization
shuv1337 96956f0
feat(codex): spawn background task to fetch ChatGPT user info
shuv1337 4043d10
feat(server): add GET /auth/info/:providerID endpoint
shuv1337 bf7f23f
feat(tui): load auth info during bootstrap
shuv1337 968112f
feat(tui): create AccountBadge component
shuv1337 07ccfce
feat(tui): integrate AccountBadge in footer
shuv1337 82311f3
feat(tui): show auth status in provider dialog
shuv1337 5cc3f96
feat(config): add skills registry configuration schema
shuv1337 df300ff
feat(skill): create skill registry module
shuv1337 5b136fe
Sync upstream v1.1.20 (#301)
shuv1337 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/opencode/src/cli/cmd/tui/component/account-badge.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { createMemo } from "solid-js" | ||
| import { useSync } from "@tui/context/sync" | ||
| import { useTheme } from "../context/theme" | ||
|
|
||
| export function AccountBadge() { | ||
| const sync = useSync() | ||
| const { theme } = useTheme() | ||
|
|
||
| const authInfo = createMemo(() => sync.data.provider_auth_info.openai) | ||
|
|
||
| return () => { | ||
| const info = authInfo() | ||
| if (!info?.authenticated || !info.email) return null | ||
|
|
||
| return ( | ||
| <box flexDirection="row" gap={1} alignItems="center"> | ||
| <text>{info.email}</text> | ||
| {info.plan && <text fg={theme.primary}>[{info.plan.charAt(0).toUpperCase() + info.plan.slice(1)}]</text>} | ||
| </box> | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a lock to prevent race conditions if
Auth.get("openai")called multiple times rapidly - each call could trigger duplicate migrations before the firstset()completes.Prompt To Fix With AI