Make dynamic session deletion async, thread-safe, and session-rotating - #715
Merged
Facundo Santiago (santiagxf) merged 7 commits intoJun 18, 2026
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add method to delete sessions after execution
Add explicit session lifecycle controls to Dynamic Sessions tools
Jun 17, 2026
Copilot
AI
changed the title
Add explicit session lifecycle controls to Dynamic Sessions tools
Add session_idle_timeout_seconds to SessionsPythonREPLTool and SessionsBashTool
Jun 17, 2026
…d SessionsBashTool" This reverts commit 035f777.
Copilot
AI
changed the title
Add session_idle_timeout_seconds to SessionsPythonREPLTool and SessionsBashTool
feat(dynamic-sessions): add explicit session close/delete support
Jun 17, 2026
Facundo Santiago (santiagxf)
marked this pull request as ready for review
June 18, 2026 04:06
Copilot
AI
changed the title
feat(dynamic-sessions): add explicit session close/delete support
Add optional per-invocation session teardown for Dynamic Sessions tools
Jun 18, 2026
Copilot
AI
changed the title
Add optional per-invocation session teardown for Dynamic Sessions tools
Make dynamic session deletion async, thread-safe, and session-rotating
Jun 18, 2026
Facundo Santiago (santiagxf)
deleted the
copilot/add-delete-method-for-sessions
branch
June 18, 2026 21:12
Facundo Santiago (santiagxf)
pushed a commit
that referenced
this pull request
Jun 23, 2026
This updates the `langchain-azure-dynamic-sessions` package metadata for the next release and refreshes the README changelog entry for `1.0.3`. The changelog wording now explicitly introduces `delete_session_after_invocation`, explains its cleanup purpose, and clarifies why the concurrency-safety changes were added. - **Release metadata** - Bump `langchain-azure-dynamic-sessions` from `1.0.2` to `1.0.3` in `pyproject.toml` - **Changelog** - Add a new `1.0.3` entry at the top of the README changelog - Summarize the session cleanup improvement around `delete_session_after_invocation` - Capture the runtime dependency/security refreshes included in the release - **Wording refinement** - Rework the `#715` release note so it leads with the new parameter, states that it enables automatic session cleanup after each invocation, and explains that async deletion plus immediate session ID rotation were added to make that behavior safe under concurrent use --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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.
Session lifecycle control needed stronger guarantees when deleting after invocation: deletion should not block execution, must be safe under concurrent access, and must not keep using a deleted session identifier. This update tightens delete semantics for both Python REPL and Bash session tools.
Session deletion semantics
delete_session()now:session_idunder locksession_idimmediatelyConcurrency safety
session_idaccess/mutation.Tool parity and correctness
SessionsPythonREPLToolandSessionsBashTool.session_iddefault toField(default_factory=...)so each instance gets a unique ID (not class-evaluated once).Representative behavior