Brooklyn Nicholson
665a42bb08
fix(auth): serialize MiniMax OAuth refresh and keep it a credential-only write
...
teknium1's request-changes review of #133534 , all four findings plus nits:
1. Concurrent refresh logged the user out (major): _minimax_fresh_state now
holds _auth_store_lock across read -> refresh -> save and re-reads state
inside the lock, so a second concurrent consumer (main agent + aux task)
sees the first caller's new expiry instead of replaying the single-use
refresh token into refresh_token_reused and quarantining the winner's
fresh tokens. Lock timeout outlives the refresh POST (codex pattern).
2. Aux refresh overwrote active_provider (medium): _minimax_save_auth_state
gains set_active; the refresh and quarantine paths persist with
set_active=False (the _save_provider_state_to_source rule), only
_minimax_oauth_login sets active.
3. Warning spam when logged out (medium, #21521 's complaint): the arm's
expected absent/not-logged-in/AuthError fall-throughs are debug-once
(contract test_auxiliary_client_resolve_dedup.py); only a genuinely
unexpected exception keeps exc_info, logged once.
4. Probe mode made a network call (minor): under _aux_probe_active() the arm
reads get_provider_auth_state("minimax-oauth") raw and stubs when
access_token + inference_base_url are present, skipping the refresh
(mirrors credential_pool.py::_seed_minimax_singleton).
Nits: the arm body lives directly in auxiliary_client_registry.py (one new
module, agent/auxiliary_client_minimax.py deleted), the in-tree
try/except ImportError wrappers are gone (only the build_anthropic_client
SDK-absent boundary remains, matching _try_anthropic), and the misnamed
..._with_oauth_semantics test is now ..._third_party_wire.
Tests: concurrent loopback-portal refresh race (1 POST, 0 errors, tokens
intact), aux refresh preserves active_provider, login still sets it,
logged-out resolutions are debug-once without traceback, probe mode with an
expired token makes 0 HTTP calls.
Co-authored-by: Ubxty <ubxty@users.noreply.github.com >
2026-10-05 22:38:27 -05:00
..
2026-09-29 03:28:46 +05:30
2026-09-28 10:21:41 -07:00
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-09-29 22:57:48 -04:00
2026-10-03 16:29:34 +05:30
2026-10-05 20:08:11 +05:30
2026-10-05 16:42:57 -05:00
2026-09-02 13:29:48 -07:00
2026-10-05 14:02:38 -05:00
2026-10-05 14:02:38 -05:00
2026-09-02 18:56:06 -07:00
2026-09-28 12:53:29 -05:00
2026-10-04 00:08:20 -07:00
2026-10-05 16:41:57 -05:00
2026-09-28 14:16:18 -07:00
2026-10-04 18:29:01 -07:00
2026-10-04 17:51:24 -07:00
2026-09-06 05:37:03 -07:00
2026-10-02 00:18:00 +05:30
2026-10-02 00:18:00 +05:30
2026-10-02 00:18:00 +05:30
2026-09-24 22:26:23 +05:30
2026-09-24 22:25:06 +05:30
2026-09-02 21:38:20 -07:00
2026-09-29 23:54:34 +05:30
2026-09-17 08:53:15 -07:00
2026-10-03 13:38:29 -07:00
2026-10-05 22:38:27 -05:00
2026-10-05 22:38:27 -05:00
2026-10-05 19:35:01 +05:30
2026-09-17 08:45:46 -07:00
2026-09-17 09:07:51 -07:00
2026-09-22 01:19:12 -07:00
2026-10-02 16:44:56 -07:00
2026-09-23 15:13:16 -07:00
2026-10-05 16:00:18 -07:00
2026-09-17 09:11:38 -07:00
2026-10-05 17:24:40 -07:00
2026-10-02 16:44:56 -07:00
2026-09-19 09:28:45 -07:00
2026-09-21 19:08:19 -04:00
2026-09-28 10:21:41 -07:00
2026-09-30 22:59:48 -05:00
2026-09-02 18:18:18 -07:00
2026-09-28 10:21:41 -07:00
2026-09-02 18:49:57 -07:00
2026-09-23 18:29:35 -05:00
2026-09-02 18:49:57 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-20 14:29:39 -07:00
2026-10-03 16:31:39 +05:30
2026-09-24 15:58:19 +05:30
2026-09-19 09:53:48 -07:00
2026-09-24 15:58:19 +05:30
2026-09-25 13:49:31 -05:00
2026-09-23 11:41:01 -04:00
2026-10-05 19:35:01 +05:30
2026-09-19 20:44:24 -07:00
2026-10-05 20:08:11 +05:30
2026-10-02 01:24:41 +05:30
2026-09-23 18:52:49 -05:00
2026-09-03 09:44:26 -07:00
2026-10-03 16:54:06 +05:30
2026-10-02 00:50:20 +05:30
2026-09-28 14:16:18 -07:00
2026-10-05 15:37:17 -07:00
2026-10-05 15:37:17 -07:00
2026-09-26 23:49:25 +05:30
2026-09-28 11:29:49 -05:00
2026-09-19 10:28:34 -07:00
2026-10-04 13:53:34 +05:30
2026-10-03 18:17:35 +05:30
2026-10-03 18:22:19 +05:30
2026-09-23 23:06:15 +05:30
2026-10-05 16:18:47 -07:00
2026-10-05 16:18:47 -07:00
2026-10-02 00:50:20 +05:30
2026-09-26 11:22:06 -07:00
2026-09-02 18:57:14 -07:00
2026-09-24 15:44:48 +05:30
2026-10-05 12:10:01 -05:00
2026-09-19 21:24:05 -07:00
2026-10-02 00:03:01 +05:30
2026-09-28 10:21:41 -07:00
2026-09-26 17:59:52 -05:00
2026-09-27 00:04:22 +05:30
2026-09-28 12:43:03 -07:00
2026-09-08 19:17:39 -04:00
2026-10-02 22:21:27 -05:00
2026-09-29 18:33:44 +05:30
2026-09-03 04:31:46 -07:00
2026-10-02 22:59:00 -05:00
2026-09-29 19:31:49 -05:00
2026-09-04 13:03:39 -04:00
2026-09-28 10:21:41 -07:00
2026-09-20 17:00:43 -07:00
2026-10-04 02:12:57 +05:30
2026-10-04 13:53:34 +05:30
2026-09-24 02:23:44 -04:00
2026-09-14 06:44:54 -07:00
2026-09-24 00:30:45 +00:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-17 13:52:36 +05:30
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-10-04 17:54:05 -07:00
2026-09-12 01:35:05 -07:00
2026-09-29 22:07:30 +05:30
2026-09-23 18:29:35 -05:00
2026-09-02 18:53:53 -07:00
2026-09-27 02:02:41 +05:30
2026-09-16 17:48:17 -07:00
2026-09-07 08:28:43 -07:00
2026-09-02 18:22:13 -07:00
2026-10-01 09:26:00 -04:00
2026-09-30 22:30:35 -04:00
2026-09-02 18:22:13 -07:00
2026-09-11 11:54:49 -07:00
2026-09-28 10:21:41 -07:00
2026-09-30 23:10:24 -05:00
2026-09-24 08:51:52 -04:00
2026-09-23 18:26:45 -07:00
2026-09-02 18:22:13 -07:00
2026-09-02 18:29:05 -07:00
2026-09-02 22:21:06 -07:00
2026-09-28 12:43:03 -07:00
2026-09-23 01:06:32 -07:00
2026-09-02 18:28:38 -07:00
2026-10-03 18:17:35 +05:30
2026-10-02 12:29:16 -04:00
2026-10-05 15:37:17 -07:00
2026-09-18 20:56:35 -07:00
2026-10-02 20:28:55 -05:00
2026-09-02 19:10:21 -07:00
2026-09-09 15:17:08 -04:00
2026-10-02 20:29:34 -05:00
2026-09-23 15:26:34 -04:00
2026-09-21 13:14:22 -07:00
2026-10-05 20:01:03 +05:30
2026-09-18 01:43:35 +05:30
2026-09-28 10:21:41 -07:00
2026-09-06 09:11:04 -07:00
2026-09-27 01:55:21 +05:30
2026-09-19 09:21:18 -07:00
2026-09-02 19:05:15 -07:00
2026-09-19 10:56:19 -07:00
2026-09-28 10:21:41 -07:00
2026-09-16 11:06:06 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-22 16:15:34 +05:30
2026-09-23 11:41:01 -04:00
2026-09-18 09:56:28 -07:00
2026-10-04 23:05:42 -07:00
2026-09-28 10:21:41 -07:00
2026-09-27 00:38:34 +05:30
2026-09-23 21:28:38 +05:30
2026-09-02 18:33:06 -07:00
2026-10-02 01:18:03 +05:30
2026-09-02 18:44:36 -07:00
2026-09-05 22:36:48 -04:00
2026-09-15 06:16:38 -07:00
2026-09-26 17:59:52 -05:00
2026-09-02 19:18:18 -07:00
2026-09-02 18:51:24 -07:00
2026-10-03 16:29:34 +05:30
2026-09-26 22:21:47 +05:30
2026-09-27 02:48:48 -05:00
2026-09-25 21:28:32 +05:30
2026-10-03 21:15:17 +05:30
2026-09-11 09:31:13 -07:00
2026-10-03 13:38:29 -07:00
2026-10-03 13:38:29 -07:00
2026-09-28 10:21:41 -07:00
2026-10-02 00:53:19 +05:30
2026-09-13 19:23:09 +05:30
2026-09-19 09:49:39 -07:00
2026-09-08 04:38:47 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 11:29:49 -05:00
2026-09-27 01:10:56 +05:30
2026-09-15 19:23:53 -07:00
2026-09-29 14:53:00 -05:00
2026-09-29 22:57:48 -04:00
2026-09-19 10:38:30 -07:00
2026-10-02 13:50:23 -04:00
2026-09-29 04:15:21 +05:30
2026-10-02 20:18:26 -05:00
2026-09-02 19:19:44 -07:00
2026-09-28 10:21:41 -07:00
2026-10-05 00:23:05 -07:00
2026-09-26 23:49:25 +05:30
2026-10-03 23:05:48 -07:00
2026-09-21 18:42:05 -04:00
2026-10-02 04:09:57 -07:00
2026-09-24 22:41:10 +05:30
2026-09-26 06:10:53 +05:30
2026-09-02 19:42:28 -07:00
2026-09-03 03:31:03 -07:00
2026-09-29 14:53:00 -05:00
2026-09-02 19:36:47 -07:00
2026-09-27 02:22:23 +05:30
2026-10-01 11:45:41 -07:00
2026-10-01 00:42:30 -05:00
2026-09-03 13:24:04 -07:00
2026-09-28 10:21:41 -07:00
2026-09-24 22:41:10 +05:30
2026-09-15 04:12:13 -07:00
2026-09-02 19:42:28 -07:00
2026-09-26 20:40:40 -05:00
2026-10-01 23:50:31 -07:00
2026-10-04 00:08:20 -07:00
2026-10-01 13:23:12 -07:00
2026-09-28 12:43:03 -07:00
2026-09-18 10:03:04 -07:00
2026-09-21 19:08:19 -04:00
2026-09-12 08:25:14 -07:00
2026-10-02 01:04:12 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-03 09:44:26 -07:00
2026-09-28 10:21:41 -07:00
2026-10-01 03:27:39 -05:00
2026-09-24 22:33:58 +05:30
2026-09-28 12:43:03 -07:00
2026-09-10 10:45:57 -07:00
2026-09-24 22:27:18 +05:30
2026-10-04 18:04:17 -07:00
2026-10-04 18:04:17 -07:00
2026-09-28 14:16:18 -07:00
2026-10-03 17:44:58 +05:30
2026-09-29 15:57:52 -05:00
2026-09-26 06:10:53 +05:30
2026-10-04 17:47:39 -07:00
2026-10-04 18:04:17 -07:00
2026-10-02 00:50:20 +05:30
2026-10-03 16:18:04 -05:00
2026-09-18 01:43:35 +05:30
2026-09-28 12:43:03 -07:00
2026-09-18 01:43:35 +05:30
2026-09-23 05:36:34 -07:00
2026-09-19 12:38:55 -07:00
2026-10-01 12:08:13 -07:00
2026-10-02 00:18:00 +05:30
2026-09-28 12:43:03 -07:00
2026-09-28 12:43:03 -07:00
2026-09-28 10:21:41 -07:00
2026-09-24 22:41:10 +05:30
2026-09-02 19:26:50 -07:00
2026-10-02 12:29:16 -04:00
2026-10-02 12:29:16 -04:00
2026-10-02 00:53:19 +05:30
2026-09-29 23:54:34 +05:30
2026-09-26 17:15:30 -05:00
2026-10-01 16:40:58 +05:30
2026-09-10 11:48:01 -07:00
2026-09-20 10:21:52 -07:00
2026-10-05 16:43:19 -05:00
2026-09-26 23:49:25 +05:30
2026-09-02 18:29:10 -07:00
2026-09-20 11:47:06 -04:00
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-09-15 04:48:20 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00