Skip to content

AGE-1320: Add internal list sessions to SDK#11

Open
chiragjn wants to merge 2 commits into
mainfrom
sr-AGE-1320
Open

AGE-1320: Add internal list sessions to SDK#11
chiragjn wants to merge 2 commits into
mainfrom
sr-AGE-1320

Conversation

@chiragjn

@chiragjn chiragjn commented Jul 17, 2026

Copy link
Copy Markdown
Member

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 / AsyncPrivateAgentSessionClient for creating and fetching draft sessions, listing drafts, and list_owned_sessions (saved sessions and drafts in one paginated stream). Raw list items are wrapped as AgentSession or AgentDraftSession using a type discriminant ("session" vs "session/draft").

AgentDraftSession mirrors saved-session ergonomics (including agent_spec) by sharing turn behavior through new SessionMixin / AsyncSessionMixin. AgentSession now delegates prepare_turn, list_turns, get_turn, cancel, and list_events to the mixin instead of inlining client calls and pager wrapping. PreparedTurn, Turn, and related types accept either session wrapper so turn.session stays 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.

Comment thread src/truefoundry_gateway_sdk/types/owned_session.py Outdated
Comment thread src/truefoundry_gateway_sdk/types/session.py Outdated
@chiragjn
chiragjn marked this pull request as draft July 17, 2026 09:57
@sr07asthana
sr07asthana marked this pull request as ready for review July 17, 2026 15:03

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/truefoundry_gateway_sdk/agents/private/private_agent_session_client.py Outdated
@sr07asthana sr07asthana changed the title [DO NOT MERGE] SDK regeneration AGE-1320: Add internal list sessions to SDK Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants