chore(cancel): address Copilot review nits

- 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.
This commit is contained in:
Patrick Buckley
2026-06-26 03:27:49 -07:00
parent bc93b1f748
commit 4aaf6feac4
2 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -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"),
+6 -6
View File
@@ -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"