Skip to content

fix: preserve ChatGPT OAuth refresh token#25765

Open
kill74 wants to merge 1 commit intoanomalyco:devfrom
kill74:fix-chatgpt-oauth-refresh-25757
Open

fix: preserve ChatGPT OAuth refresh token#25765
kill74 wants to merge 1 commit intoanomalyco:devfrom
kill74:fix-chatgpt-oauth-refresh-25757

Conversation

@kill74
Copy link
Copy Markdown

@kill74 kill74 commented May 4, 2026

Issue for this PR

Closes #25757

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Preserves the existing ChatGPT OAuth refresh token when refreshing the access token.

The old refresh path always saved tokens.refresh_token. If the refresh response did not include a new refresh token, the stored auth could become invalid after restart. This keeps the previous refresh token unless the server returns a replacement.

It also checks that initial browser/headless login responses include a refresh token before saving OAuth auth.

How did you verify your code works?

Ran bun run --cwd packages/opencode typecheck.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.

Missing Authentication header when I try to use open code

1 participant