You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement proper fix: also set the token expiration time when it's expired
The old load path in codex-rs/rmcp-client/src/oauth.rs only set expires_in when the stored expiry was in the future:
// codex-rs/rmcp-client/src/oauth.rs:369-374 (original)
if let Some(expires_at) = entry.expires_at
&& let Some(seconds) = expires_in_from_timestamp(expires_at)
{
let duration = Duration::from_secs(seconds);
token_response.set_expires_in(Some(&duration));
}
And expires_in_from_timestamp returned None for expired tokens:
// codex-rs/rmcp-client/src/oauth.rs:444-453 (original)
if expires_at <= now_ms {
None
} else {
Some((expires_at - now_ms) / 1000)
}
So when the stored token was already expired, set_expires_in was never called, RMCP saw “no expiry,” and it didn’t auto-refresh on handshake.
0 commit comments