fix(gateway): only rewrite transcript when session rotation happened (#44794) - #44867
fix(gateway): only rewrite transcript when session rotation happened (#44794)#44867kyssta-exe wants to merge 1 commit into
Conversation
Bug:
|
tonydwb
left a comment
There was a problem hiding this comment.
Clean fix. Adds guard to only call rewrite_transcript() when session rotation actually happened, preventing unconditional overwrite of original session with compressed content. Good inline comments explaining the bug (#44794) and why the guard is needed. No issues found.
|
Duplicate of #35905 (earliest open, same approach) — guard |
|
Closing rather than merging this one. The current Moving Thanks for chasing the history-loss angle here. |
Fixes #44794. When _session_db is None or session rotation fails, rewrite_transcript() was called unconditionally on the original session, overwriting the full conversation history with only the compressed summary. This fix moves rewrite_transcript() inside the rotation check so it only executes when a new session was actually created.