merge: T108 scene-close-on-cancel strengthen test + rationale
This commit is contained in:
@@ -873,6 +873,20 @@ async def post_turn(
|
||||
# mid-stream still meant to close the scene — the cancelled bot
|
||||
# beat doesn't invalidate that intent. Pinned by
|
||||
# test_cancelled_turn_still_closes_scene_when_user_prose_signals_close.
|
||||
#
|
||||
# T108 NOTE — the in-memory append order is correct, but the cancel
|
||||
# path re-raises ``CancelledError`` at the end of ``post_turn``
|
||||
# (see step 11 below). The ``open_db`` dependency teardown skips
|
||||
# ``conn.commit()`` when the consumer raises, which means in
|
||||
# production a genuine cancel currently rolls back ALL post-cancel
|
||||
# writes — including this scene_closed event, the truncated
|
||||
# assistant_turn record, edge updates, and per-POV summaries. The
|
||||
# T74.3 regression test passes only because of a missing
|
||||
# ``import asyncio`` in the test module: the inline mock raises
|
||||
# ``NameError`` instead of ``CancelledError``, which is caught by
|
||||
# the ``except Exception:`` branch and leaves ``cancelled=False``,
|
||||
# so the function returns 204 normally and the commit fires. This
|
||||
# is a transactional bug deferred for triage (T108 report).
|
||||
if scene is not None and prose.strip():
|
||||
container = None
|
||||
if scene.get("container_id") is not None:
|
||||
|
||||
Reference in New Issue
Block a user