Skip to content

🐛 fix(rmcp-client): refresh OAuth tokens using expires_at - #6574

Merged
gpeal merged 5 commits into
openai:mainfrom
LaelLuo:fix/refresh-oauth-expires-at
Nov 18, 2025
Merged

gpeal merged 5 commits into
openai:mainfrom
LaelLuo:fix/refresh-oauth-expires-at

Conversation

@LaelLuo

@LaelLuo LaelLuo commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Summary

  • persist OAuth credential expiry timestamps and rehydrate expires_in
  • proactively refresh rmcp OAuth tokens when expires_at is near, then persist

Testing

  • just fmt
  • just fix -p codex-rmcp-client
  • cargo test -p codex-rmcp-client

Fixes #6572

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

Copy link
Copy Markdown
Contributor

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.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/rmcp-client/src/oauth.rs Resolved
@LaelLuo LaelLuo changed the title ✨ feat(rmcp-client): auto refresh OAuth tokens using expires_at 🐛 fix(rmcp-client): refresh OAuth tokens using expires_at Nov 13, 2025
@LaelLuo
LaelLuo force-pushed the fix/refresh-oauth-expires-at branch from a94ed9a to f9365c4 Compare November 13, 2025 03:25
@LaelLuo

LaelLuo commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

Updated persist_if_needed so that we reuse the previously stored expires_at whenever the token response is unchanged and only compute a new timestamp when rmcp returns fresh credentials. That keeps the expiry anchored to the original issuance time and allows the refresh skew logic to trigger instead of drifting indefinitely.

@LaelLuo

LaelLuo commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gpeal
gpeal merged commit f3d4e21 into openai:main Nov 18, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2025
@LaelLuo
LaelLuo deleted the fix/refresh-oauth-expires-at branch November 21, 2025 00:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rmcp OAuth tokens never refresh based on expires_at

2 participants