mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
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.