Agent SDK reference - Python changedagent-sdk/python
Nearest release: v2.1.236, published 2 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+10added
Lines−7removed
From line
291
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits62to this page, all time
The whole hunk
from line 291, old and new numbered
/
from line 291
291291
292292#### Return type: `SessionMessage`
293293
294| Property | Type | Description |
295| :------------------- | :----------------------------- | :------------------------ |
296| `type` | `Literal["user", "assistant"]` | Message role |
297| `uuid` | `str` | Unique message identifier |
298| `session_id` | `str` | Session identifier |
299| `message` | `Any` | Raw message content |
300| `parent_tool_use_id` | `None` | Reserved for future use |
294| Property | Type | Description |
295| :------------------- | :----------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
296| `type` | `Literal["user", "assistant"]` | Message role |
297| `uuid` | `str` | Unique message identifier |
298| `session_id` | `str` | Session identifier |
299| `message` | `Any` | Raw message content |
300| `parent_tool_use_id` | `str \| None` | For subagent messages, the id of the spawning `Agent` tool-use block. `None` for main-session messages and older sessions |
301| `parent_agent_id` | `str \| None` | For messages from a [nested subagent](/docs/en/sub-agents#let-subagents-spawn-their-own-subagents), the agent id of the parent subagent. `None` for main-session messages, top-level subagent messages, and older sessions |
301302
302303#### Example
303304
from line 773
772773 user: str | None = None
773774 include_partial_messages: bool = False
774775 include_hook_events: bool = False
776 forward_subagent_text: bool = False
775777 fork_session: bool = False
776778 resume_session_at: str | None = None
777779 resume_drops_turn: str | None = None
from line 826
824826| `user` | `str \| None` | `None` | User identifier |
825827| `include_partial_messages` | `bool` | `False` | Include partial message streaming events. When enabled, [`StreamEvent`](#streamevent) messages are yielded |
826828| `include_hook_events` | `bool` | `False` | Include hook lifecycle events in the message stream as `HookEventMessage` objects |
829| `forward_subagent_text` | `bool` | `False` | Forward subagent text and thinking blocks in the message stream. By default only subagent `tool_use` and `tool_result` blocks are emitted |
827830| `fork_session` | `bool` | `False` | When resuming with `resume`, fork to a new session ID instead of continuing the original session |
828831| `resume_session_at` | `str \| None` | `None` | When resuming, load the conversation only up to and including the message with this UUID. Use with `resume`, and usually `fork_session`, to branch from an earlier point |
829832| `resume_drops_turn` | `str \| None` | `None` | UUID of the user prompt whose turn a `resume_session_at` truncation discards. When set, the CLI refuses the resume if the discarded range holds entries not attributable to that turn. Requires Claude Code v2.1.223 or later; the bundled CLI satisfies this |
No line in this hunk matches that.