Skip to content

Add AgentDraftSession as private class#10

Closed
chiragjn wants to merge 1 commit into
mainfrom
cj-add-agent-draft-session
Closed

Add AgentDraftSession as private class#10
chiragjn wants to merge 1 commit into
mainfrom
cj-add-agent-draft-session

Conversation

@chiragjn

@chiragjn chiragjn commented Jul 14, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Session inheritance and typing changes touch core turn/session APIs; behavior should stay equivalent for existing AgentSession users, but draft sessions share session endpoints and optional agent_name differs from production sessions.

Overview
Introduces private AgentDraftSession / AsyncAgentDraftSession for draft agent sessions with an inline AgentSpec, plus update(agent_spec) that PATCHes the draft session and refreshes local agent_spec and updated_at.

To support that, AgentSession is refactored into BaseAgentSession / AsyncBaseAgentSession (shared identity + turn/event helpers) and thin AgentSession / AsyncAgentSession subclasses that only add required agent_name. Turn, PreparedTurn, and turn pager wrappers now type against the base session classes so draft sessions can run the same turn flow.

BaseAgentSession and AsyncBaseAgentSession are exported from the public agents package; draft session types stay under agents.private via existing private re-exports.

Reviewed by Cursor Bugbot for commit 51cb7de. Bugbot is set up for automated code reviews on this repo. Configure here.

@chiragjn chiragjn closed this 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.

1 participant