From 4aaf6feac490e9ee6cf1bf4f4976343e4cbdf9a2 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Fri, 26 Jun 2026 03:27:49 -0700 Subject: [PATCH] chore(cancel): address Copilot review nits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - console/server.py: replace a stale hard-coded `session_routes.py:852-854` comment reference (already drifted to make_close_handler's signature) with a by-name reference to make_close_handler's not-found path. - test_cancel.py: rename test_marks_most_recent_action_unknown -> test_marks_in_flight_action_unknown; the disposition marks the first unanswered (in-flight) call, not the most recent — they merely coincide in this two-call case. --- tests/test_cancel.py | 5 +++-- turnstone/console/server.py | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/test_cancel.py b/tests/test_cancel.py index 017ab5c9..cd2219c3 100644 --- a/tests/test_cancel.py +++ b/tests/test_cancel.py @@ -984,9 +984,10 @@ class TestCancelledAgentDisposition: assert "no side effects" in out assert "UNKNOWN" not in out - def test_marks_most_recent_action_unknown(self, tmp_db): + def test_marks_in_flight_action_unknown(self, tmp_db): session = _make_session() - # bash completed; web_fetch was in flight (issued, no result yet). + # bash completed; web_fetch was in flight (issued, no result yet) — + # the first unanswered call is the in-flight boundary. msgs = [ self._assistant("t1", "bash"), self._result("t1"), diff --git a/turnstone/console/server.py b/turnstone/console/server.py index bb2d854d..c517549e 100644 --- a/turnstone/console/server.py +++ b/turnstone/console/server.py @@ -3928,12 +3928,12 @@ async def _fanout_on_children( # behaviour parity with the pre-lift outcome. # NOTE: this branch is reachable from the cancel-cascade # caller (``_cascade_cancel_to_children``) but unreachable - # from the close-cascade caller (``close_all_children``); the - # close handler at ``session_routes.py:852-854`` 404s - # for both missing and already-closed-evicted rows and - # never emits a 400 "No session". Kept as shared code - # rather than gated by caller — the branch is cheap and - # the symmetry makes future cascade verbs easier to add. + # from the close-cascade caller (``close_all_children``): + # ``make_close_handler``'s not-found path 404s for both + # missing and already-closed-evicted rows and never emits a + # 400 "No session". Kept as shared code rather than gated by + # caller — the branch is cheap and the symmetry makes future + # cascade verbs easier to add. if result.get("status") == 400 and result.get("error") == "No session": return cid, "skipped" return cid, "failed"