AGE-1320: Add internal list sessions to SDK#11
Open
chiragjn wants to merge 2 commits into
Open
Conversation
chiragjn
commented
Jul 17, 2026
chiragjn
commented
Jul 17, 2026
chiragjn
marked this pull request as draft
July 17, 2026 09:57
sr07asthana
marked this pull request as ready for review
July 17, 2026 15:03
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac8c531. Configure here.
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.

Note
Medium Risk
Refactors how AgentSession performs turn operations (delegation to SessionMixin) while adding new listing/wrapping paths; regressions could affect turn pagination or session references, though tests cover key behaviors.
Overview
Adds caller-scoped agent session APIs on top of existing private gateway endpoints:
PrivateAgentSessionClient/AsyncPrivateAgentSessionClientfor creating and fetching draft sessions, listing drafts, andlist_owned_sessions(saved sessions and drafts in one paginated stream). Raw list items are wrapped asAgentSessionorAgentDraftSessionusing atypediscriminant ("session"vs"session/draft").AgentDraftSessionmirrors saved-session ergonomics (includingagent_spec) by sharing turn behavior through newSessionMixin/AsyncSessionMixin.AgentSessionnow delegatesprepare_turn,list_turns,get_turn,cancel, andlist_eventsto the mixin instead of inlining client calls and pager wrapping.PreparedTurn,Turn, and related types accept either session wrapper soturn.sessionstays the enriched owner.New symbols are exported from
agents. Custom tests cover owned-session discriminant wrapping, pagination, draft listing, and that turns keep the enriched session reference.Reviewed by Cursor Bugbot for commit c6d02b6. Bugbot is set up for automated code reviews on this repo. Configure here.