fix(sdk): don't log out Codex/OCA users when token refresh fails transiently (#13565)
* fix(sdk): don't log out Codex/OCA users when token refresh fails transiently Port the cline-provider refresh semantics to openai-codex and oca: a transient refresh failure (network error, timeout, server 5xx) with an already-expired access token now rethrows instead of returning null. A null return means the refresh token was REJECTED and re-auth is required; treating an outage blip as a rejection is what turned it into a forced 'openai-codex requires re-authentication.' task stop while the settings UI still showed the user as signed in. Both providers also emit user.auth_refresh_soft_failure telemetry on transient failures (the 'prevented logout' counter the cline provider already has) and attach status/errorCode details to the genuine invalid_grant logout event. * refactor: collapse duplicate soft-failure telemetry branches and test Review feedback: compute tokenExpired once and emit the soft-failure event once in both providers, then return current credentials or rethrow. Fold the codex soft-failure telemetry assertions into the existing still-usable-token test instead of a near-duplicate case.
M
Mikołaj Kondratek committed
006de710d59d4c4d6f70817bc87051b661590b88
Parent: 62f471f
Committed by GitHub <noreply@github.com>
on 8/27/2026, 8:10:00 PM