From b899ffd1ea846753b2fa9a28fe76b28191a45e90 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:28:12 -0700 Subject: [PATCH] test(e2e): stub reset-notice session info to deflake test_new_resets_session (#60175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /new's handler calls _reset_notice_session_info, which resolves live provider credentials and can probe model context length over HTTP. In CI there are no credentials, so resolution walks the entire fallback chain (the failed run's log shows 'Primary provider auth failed ... trying fallback' captured inside the test) and on a slow runner the first parametrization can blow past send_and_capture's 2s poll window, making adapter.send appear never-called. Stub it to return an empty info block in the e2e runner fixture — these tests exercise gateway command dispatch, not provider resolution, and no other network-touching path exists in the /new flow. Flaked in run 28856659216 (telegram param only); tests/e2e now 57/57 locally. --- tests/e2e/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 193f7f125d8..46c98b5d084 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -228,6 +228,13 @@ def make_runner(platform: Platform, session_entry: SessionEntry = None) -> "Gate # Disable destructive slash confirm gate so /new executes immediately runner._read_user_config = lambda: {"approvals": {"destructive_slash_confirm": False}} + # Keep /new hermetic: the real _reset_notice_session_info resolves provider + # credentials and may probe model context length over the network. CI has no + # credentials, so resolution walks the whole fallback chain and can exceed + # send_and_capture's poll window on slow runners (flaked in run 28856659216, + # telegram param only — first parametrization pays the cold-resolution cost). + runner._reset_notice_session_info = lambda source: "" + runner.pairing_store = MagicMock() runner.pairing_store._is_rate_limited = MagicMock(return_value=False) runner.pairing_store.generate_code = MagicMock(return_value="ABC123")