fix(agent_engines): delete throwaway sessions for session events - #7127
Open
AnupamKumar-1 wants to merge 5 commits into
Open
fix(agent_engines): delete throwaway sessions for session events#7127AnupamKumar-1 wants to merge 5 commits into
AnupamKumar-1 wants to merge 5 commits into
Conversation
…query(session_events=...), guaranteed on all failure paths
Author
|
Hi @matthew29tang, could you please take a look at this PR when convenient for you? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7119.
async_stream_query(session_events=...)creates a managed session to replay caller-supplied events when nosession_idis given. That session's ID was never returned to the caller, so it could not be deleted or have a retention policy applied. It therefore persisted until the default 365-day TTL, including for an emptysession_events=[]call.This marks sessions created for the
session_eventspath as throwaway and deletes them infinally, matching the existing cleanup pattern in the sibling_StreamRunRequestpath. Once the session is created, cleanup is guaranteed even ifappend_event, run config validation, or the runner raises. A failed delete is logged via_warnrather than masking the original exception or blocking_force_flush_otel.Scope: only the
session_eventsbranch is treated as throwaway. A plain call with neithersession_idnorsession_eventsstill creates and keeps a session, preserving current behavior. The broader case is noted in the issue as a possible follow-up and is not addressed here.Tests added:
session_eventscallsession_idstill keeps its sessionsession_idis never deletedappend_eventraisesaclose())