mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
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:
@@ -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"),
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user