fix(ci): stabilize shared test state after 21012

This commit is contained in:
Stephen Schoettler 2026-05-14 14:28:14 -07:00
parent cd64bed55e
commit 5ce0067c08
7 changed files with 38 additions and 9 deletions

View file

@ -476,12 +476,14 @@ def _reset_module_state():
except Exception:
pass
# --- agent.auxiliary_client — runtime main provider/model override ---
# Set per-turn by AIAgent.run_conversation; tests that import it must
# see a clean state so config.yaml fallback works as expected.
# --- agent.auxiliary_client — runtime main provider/model override and
# payment-error health cache. Both are process-global in production;
# reset them per test so one worker's fallback/402 test does not make
# later auxiliary-client tests skip otherwise-available providers.
try:
from agent import auxiliary_client as _aux_mod
_aux_mod.clear_runtime_main()
_aux_mod._reset_aux_unhealthy_cache()
except Exception:
pass