The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(codex): surface session-expired error when OAuth token refresh fails on expired token\n\nWhen Codex OAuth refresh fails and the token has already passed expiry,\nthe previous code silently continued with the stale access token. The next\ninference call then hit a 401 that classify_inference_error() could not\nroute because the error string from openai_codex.rs had no 'session\nexpired' marker.\n\nNow we return an Err whose message contains 'Codex session expired', which\nis_session_expired_message() in observability.rs matches, so\nclassify_inference_error() routes to session_expired and the user sees\n'Please sign in again to continue' instead of 'Something went wrong'.\n\nCloses #5869\n
shanu3600b3e4f7eb
diff --git a/src/openhuman/inference/openai_oauth/store.rs b/src/openhuman/inference/openai_oauth/store.rsindex 807fb42635..2a9923b1ca 100644--- a/src/openhuman/inference/openai_oauth/store.rs+++ b/src/openhuman/inference/openai_oauth/store.rs@@ -332,6 +332,18 @@ pub fn lookup_openai_oauth_credentials(}Err(e) => {log::warn!("{LOG_PREFIX} oauth refresh failed: {e}");+ // If the token has already passed its expiry there is no+ // point proceeding — the next inference call will hit 401+ // and the user sees a generic error with no remedy.+ // Surface it as a session-expired error so the classifier+ // routes the user to sign in again rather than showing+ // "Something went wrong". (#5869)+ if token_set.is_expiring_within(std::time::Duration::ZERO) {+ return Err(format!(+ "Codex session expired — token refresh failed: {e}. \+ Please sign in to Codex again in Settings → Integrations."+ ));+ }}}}