Skip to content

Accept DraftSession in AgentSession and Fix client types#8

Merged
chiragjn merged 2 commits into
mainfrom
cj-fix-client-types
Jul 13, 2026
Merged

Accept DraftSession in AgentSession and Fix client types#8
chiragjn merged 2 commits into
mainfrom
cj-fix-client-types

Conversation

@chiragjn

@chiragjn chiragjn commented Jul 13, 2026

Copy link
Copy Markdown
Member

Note

Low Risk
Typing and import-structure changes only; runtime behavior should be unchanged aside from stricter static types for agent_name on draft sessions.

Overview
Tightens typing across the high-level agents wrappers by replacing typing.Any clients with TrueFoundryGateway / AsyncTrueFoundryGateway, and refactors imports using from __future__ import annotations plus TYPE_CHECKING blocks to cut circular-import pressure (including removing lazy client imports inside Turn).

AgentSession / AsyncAgentSession now accept Session | DraftSession raw payloads, and agent_name is typed as Optional[str] to match draft sessions where the name may be unset.

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

@chiragjn chiragjn changed the title Fix client types Accept DraftSession in AgentSession and Fix client types Jul 13, 2026
@chiragjn
chiragjn merged commit 647cadf into main Jul 13, 2026
4 checks passed
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