fix(coreapi): honor exchange expires_in when caching exchanged tokens
main·
Commit

storeToken always used the fixed 4m cachedTokenTTL and discarded the expires_in PostOAuthToken returns. A server token shorter than 4m could be served stale, producing a 401 the cache assumed impossible. Thread expires_in through and cache for min(expires_in - buffer, cachedTokenTTL), declining to cache lifetimes shorter than the buffer.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 1edf9ab1ef2c
Checkpoints
Checkpoint 1