From cc71fb4d0145de61dd405f8431554efffe8c3568 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 27 Apr 2026 02:23:55 -0400 Subject: [PATCH] chore: clarify regenerate lifecycle warning wording (T90.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warning said "lifecycle transitions from superseded turn ARE NOT being rolled back". When regenerating an OLDER turn, the listed transitions can include intervening-turn ones that legitimately stand on their own — they weren't authored by the superseded turn itself. Reword to "lifecycle transitions at-or-after turn " so operators reading logs aren't misled into thinking every listed event id was emitted by the target turn. Cosmetic change to a single log message. Test: extends test_regenerate_with_prior_lifecycle_logs_warning to assert the new phrasing is present and the old phrasing is gone. --- chat/services/regenerate.py | 8 ++++++-- tests/test_regenerate.py | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/chat/services/regenerate.py b/chat/services/regenerate.py index b2aba9a..0678a76 100644 --- a/chat/services/regenerate.py +++ b/chat/services/regenerate.py @@ -182,9 +182,13 @@ async def regenerate_assistant_turn( (chat_id, original_assistant_event_id), ).fetchall() if unrolled_lifecycle: + # T90.2: phrased as "at-or-after turn " rather than "from + # superseded turn" because regenerating an OLDER turn lists + # intervening-turn transitions that legitimately stand on their + # own — those weren't authored by the superseded turn itself. _log.warning( - "regenerate_assistant_turn: %d lifecycle transition(s) from " - "superseded turn %s are NOT being rolled back (Phase 4 " + "regenerate_assistant_turn: %d lifecycle transition(s) " + "at-or-after turn %s are NOT being rolled back (Phase 4 " "follow-up). Affected event ids: %s", len(unrolled_lifecycle), original_assistant_event_id, diff --git a/tests/test_regenerate.py b/tests/test_regenerate.py index d8a2d65..b6d5e92 100644 --- a/tests/test_regenerate.py +++ b/tests/test_regenerate.py @@ -757,6 +757,13 @@ def test_regenerate_with_prior_lifecycle_logs_warning(tmp_path, monkeypatch, cap # row's id. assert str(at_id) in msg assert str(completed_id) in msg + # T90.2: wording was tightened from "from superseded turn" to + # "at-or-after turn " — when regenerating an OLDER turn, the + # listed transitions may include legitimate intervening-turn ones + # that stand on their own. The new phrasing avoids implying the + # warning's target turn directly authored every listed transition. + assert "at-or-after turn" in msg + assert "from superseded turn" not in msg def test_regenerate_sibling_lookup_scoped_to_chat(tmp_path, monkeypatch):