pub struct CodexAuthJsonRefresher;Expand description
A session refresher that re-reads Codex’s auth.json to obtain fresh tokens.
Codex-owned refresh tokens are not rotated by VT Code — copying or redeeming them could race Codex’s refresh cycle or invalidate Codex-maintained credentials. Instead, this refresher relies on Codex refreshing its auth.json independently (e.g. when Codex is running) and re-reads the file.
Codex writes auth.json by truncating and rewriting without an atomic
rename, so a single read can observe an empty or partial file during a
concurrent Codex refresh. The refresher retries a few times with short
backoff before giving up, and only replaces the in-memory session after a
complete, valid parse.
Trait Implementations§
Source§impl OpenAIChatGptSessionRefresher for CodexAuthJsonRefresher
impl OpenAIChatGptSessionRefresher for CodexAuthJsonRefresher
fn refresh_session<'life0, 'life1, 'async_trait>(
&'life0 self,
current: &'life1 OpenAIChatGptSession,
) -> Pin<Box<dyn Future<Output = Result<OpenAIChatGptSession>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for CodexAuthJsonRefresher
impl RefUnwindSafe for CodexAuthJsonRefresher
impl Send for CodexAuthJsonRefresher
impl Sync for CodexAuthJsonRefresher
impl Unpin for CodexAuthJsonRefresher
impl UnsafeUnpin for CodexAuthJsonRefresher
impl UnwindSafe for CodexAuthJsonRefresher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more