Skip to content

Commit 3e049fc

Browse files
committed
sessions: satisfy summary timestamp lint rule
Use an explicit branch for the retained-event timestamp anchor so flake8 W504 passes without changing behavior.\n\nUpdates #89\n\nRELEASE NOTES: NONE
1 parent 44bb8df commit 3e049fc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

trpc_agent_sdk/sessions/_session_summarizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,9 @@ async def create_session_summary_by_events(
391391
# Persistent services reconstruct event order from timestamps. Anchor the
392392
# summary just before the retained window so its logical leading position
393393
# survives a database round trip.
394-
summary_timestamp = (events[insert_index].timestamp -
395-
0.000001 if insert_index < len(events) else time.time())
394+
summary_timestamp = time.time()
395+
if insert_index < len(events):
396+
summary_timestamp = events[insert_index].timestamp - 0.000001
396397
# Create summary event
397398
summary_event = Event(invocation_id="summary",
398399
author="system",

0 commit comments

Comments
 (0)