From 352fd687577d7da29e6889eb7a29f148b3ec2fdb Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Tue, 6 Oct 2026 11:00:25 +0530 Subject: [PATCH] test(tui_gateway): pin the tools.configure busy refusal during a compaction 6822acc49c made tools.configure refuse with 4009 while the session is running, because its agent reset bumps history_version and a live turn would drop its reply. No test reached that guard: reverting the hunk left the suite green. The existing manual-compaction test now calls tools.configure while the compaction holds the busy claim and expects 4009 (4017 without the guard). Gate finding: C04 r2 2ab [Low TOOTHLESS]. Refs #133504 --- tests/tui_gateway/test_busy_compression_demotion.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tui_gateway/test_busy_compression_demotion.py b/tests/tui_gateway/test_busy_compression_demotion.py index bb7d3ba041..b5d93d421c 100644 --- a/tests/tui_gateway/test_busy_compression_demotion.py +++ b/tests/tui_gateway/test_busy_compression_demotion.py @@ -220,6 +220,8 @@ def test_submit_during_manual_compress_is_queued_and_reply_persists(monkeypatch) assert session["running"] is True second = server._methods["session.compress"]("r3", {"session_id": "sid"}) # the locked claim maps to busy assert second["error"]["code"] == 4009 + # tools.configure rebuilds the agent (history_version bump): refused before it reads the action + assert server._methods["tools.configure"]("r4", {"session_id": "sid"})["error"]["code"] == 4009 # "/compress --aggressive" never touches history: answered without claiming (or draining) the busy session assert server._compress_live_with_feedback("sid", session, agent, "--aggressive", snapshot_kwargs=True) == \ ccm.AGGRESSIVE_UNSUPPORTED