Point-in-time snapshot of slow-changing session identifier and state fields
| 20030 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 20031 | @dataclass |
| 20032 | class SessionMetadataSnapshot: |
| 20033 | """Point-in-time snapshot of slow-changing session identifier and state fields""" |
| 20034 | |
| 20035 | already_in_use: bool |
| 20036 | """True when the session was detected to be in use by another process at construction time. |
| 20037 | Local consumers may surface a confirmation prompt before fully attaching. Always false |
| 20038 | for new sessions. |
| 20039 | """ |
| 20040 | current_mode: MetadataSnapshotCurrentMode |
| 20041 | """The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot')""" |
| 20042 | |
| 20043 | is_remote: bool |
| 20044 | """Whether this is a remote session (i.e., one whose runtime executes elsewhere and is |
| 20045 | steered through this process) |
| 20046 | """ |
| 20047 | modified_time: datetime |
| 20048 | """ISO 8601 timestamp of when the session's persisted state was last modified on disk. For |
| 20049 | new sessions, equals startTime. For resumed sessions, reflects the previous modification |
| 20050 | time at construction. |
| 20051 | """ |
| 20052 | session_id: str |
| 20053 | """The unique identifier of the session""" |
| 20054 | |
| 20055 | start_time: datetime |
| 20056 | """ISO 8601 timestamp of when the session started""" |
| 20057 | |
| 20058 | working_directory: str |
| 20059 | """Absolute path to the session's current working directory""" |
| 20060 | |
| 20061 | client_name: str | None = None |
| 20062 | """Runtime client name associated with the session (telemetry identifier).""" |
| 20063 | |
| 20064 | initial_name: str | None = None |
| 20065 | """User-provided name supplied at session construction (via `--name`), if any. Immutable |
| 20066 | after construction. |
| 20067 | """ |
| 20068 | remote_metadata: MetadataSnapshotRemoteMetadata | None = None |
| 20069 | """Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are |
| 20070 | immutable for the lifetime of the session. |
| 20071 | """ |
| 20072 | selected_model: str | None = None |
| 20073 | """Currently selected model identifier, if any""" |
| 20074 | |
| 20075 | session_limits: SessionLimitsConfig | None = None |
| 20076 | """Current session limits, or null when no limits are active""" |
| 20077 | |
| 20078 | summary: str | None = None |
| 20079 | """Short human-readable summary of the session, if known. Omitted when no summary has been |
| 20080 | generated. |
| 20081 | """ |
| 20082 | workspace: WorkspaceSummary | None = None |
| 20083 | """Public-facing workspace metadata for this session, or null if the session has no |
| 20084 | associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, |
| 20085 | internal flags). |
| 20086 | """ |
| 20087 | workspace_path: str | None = None |
| 20088 | """Absolute path to the session's workspace directory on disk, or null if the session has no |
| 20089 | associated workspace |
no outgoing calls
no test coverage detected
searching dependent graphs…