Skip to content

Reset ChatGPT Codex auth during OAuth setup#8569

Merged
jh-block merged 3 commits into
aaif-goose:mainfrom
vincenzopalazzo:fix/chatgpt-codex-auth-reset
Apr 20, 2026
Merged

Reset ChatGPT Codex auth during OAuth setup#8569
jh-block merged 3 commits into
aaif-goose:mainfrom
vincenzopalazzo:fix/chatgpt-codex-auth-reset

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Contributor

Summary

  • force chatgpt_codex reconfiguration to start a fresh OAuth flow instead of silently reusing cached tokens
  • restore the previous cached token if the new OAuth attempt fails or is cancelled
  • register chatgpt_codex cleanup so deleting the provider clears cached OAuth state

Review Notes

  • Production-safety review passed (3 rounds)
  • Focus area: explicit re-auth should let users switch ChatGPT subscriptions without breaking existing auth on failed relogin

Test plan

  • cargo test -p goose chatgpt_codex --no-default-features --features rustls-tls -- --nocapture
  • cargo clippy -p goose --no-default-features --features rustls-tls --lib -- -D warnings
  • CI passes
  • Reconfigure ChatGPT Codex after existing login and verify browser flow prompts for a fresh login
  • Cancel reconfigure midway and verify the previous login still works

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9bcb84262

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/providers/chatgpt_codex.rs Outdated
Copy link
Copy Markdown
Collaborator

@jh-block jh-block left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but can you rebase and fix the conflicts?

vincenzopalazzo and others added 3 commits April 20, 2026 07:25
Co-authored-by: goose <goose@aaif.dev>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Co-authored-by: goose <goose@aaif.dev>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@vincenzopalazzo vincenzopalazzo force-pushed the fix/chatgpt-codex-auth-reset branch from 957e66f to 1855092 Compare April 20, 2026 11:30
@vincenzopalazzo
Copy link
Copy Markdown
Contributor Author

Rebased in 1855092. Conflict in crates/goose/src/providers/init.rs was a simple merge of two independent set_cleanup entries (kimi_code from main, chatgpt_codex from this PR) -- kept both. cargo check and cargo clippy -D warnings pass locally.

Copy link
Copy Markdown
Collaborator

@jh-block jh-block left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@jh-block jh-block added this pull request to the merge queue Apr 20, 2026
Merged via the queue into aaif-goose:main with commit f2350f8 Apr 20, 2026
20 checks passed
lifeizhou-ap added a commit that referenced this pull request Apr 21, 2026
* main:
  feat(hooks): add Husky git hooks for ui/goose2 (#8577)
  fix: links in chat could not be opened (#8544)
  fix: run setup before dev and dev-debug in goose2 justfile (#8718)
  Manage skills as sources over ACP (#8675)
  handle full node paths in goose2 kill recipe (#8709)
  overhaul provider inventory and agent/model selection (#8652)
  Remove unused import (#8676)
  delete the goose2 migration plan prompt (#8678)
  Add health score badge to README (#8677)
  feat(goose2): voice dictation via direct-ACP pattern (#8609)
  consistently use actions-rust-lang/setup-rust-toolchain (#8671)
  fix(developer): run shell tool under bash/sh regardless of login shell (#8659)
  refactor(providers): extract shared OAuth device-flow helper (#8619)
  Add a goose2 release workflow (#8629)
  chore(deps): bump ncipollo/release-action from 1.20.0 to 1.21.0 (#8664)
  docs: add blog post about Mesh LLM provider option (#8655)
  fix: append /chat/completions for prefixed v1 base URLs (#8521)
  Reset ChatGPT Codex auth during OAuth setup (#8569)
  chore(deps): bump EmbarkStudios/cargo-deny-action from 2.0.15 to 2.0.17 (#8665)
  Add dependabot config for pnpm workspace, cargo, and actions (#8660)
@vincenzopalazzo vincenzopalazzo deleted the fix/chatgpt-codex-auth-reset branch April 21, 2026 12:30
spikewang pushed a commit to spikewang/goose that referenced this pull request Apr 22, 2026
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Co-authored-by: goose <goose@aaif.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants