Skip to content

models

Class info

Re-exported classes

Class Module Description
AccountLoginCompletedMessage codexed.models.v2_protocol Notification sent from the server to the client.
AccountLoginCompletedNotification codexed.models.v2_protocol
AccountRateLimitsUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
AccountRateLimitsUpdatedNotification codexed.models.v2_protocol Sparse rolling rate-limit update.
AccountSendAddCreditsNudgeEmailRequest codexed.models.v2_protocol Request from the client to the server.
AccountUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
AccountUpdatedNotification codexed.models.v2_protocol
ActiveThreadStatus codexed.models.v2_protocol
AgentJobsToolsConfig codexed.models.tool_config Configuration for CSV-backed agent job tools.
AgentMessageDeltaNotification codexed.models.v2_protocol
AppBranding codexed.models.v2_protocol EXPERIMENTAL - app metadata returned by app-list APIs.
AppInfo codexed.models.v2_protocol EXPERIMENTAL - app metadata returned by app-list APIs.
AppListUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
AppListUpdatedNotification codexed.models.v2_protocol EXPERIMENTAL - notification emitted when the app list changes.
AppMetadata codexed.models.v2_protocol
AppReview codexed.models.v2_protocol
AppScreenshot codexed.models.v2_protocol
ApplyPatchToolConfig codexed.models.tool_config Configuration for the apply_patch tool.
AppsListParams codexed.models.v2_protocol EXPERIMENTAL - list available apps/connectors.
AppsListResponse codexed.models.v2_protocol EXPERIMENTAL - app list response.
ArtifactsToolConfig codexed.models.tool_config Configuration for the artifacts tool.
BaseBranchReviewTarget codexed.models.v2_protocol Review changes between the current branch and the given base branch.
BuiltinToolsConfig codexed.models.tool_config Combined configuration for all Codex builtin tools.
ByteRange codexed.models.v2_protocol
CancelLoginAccountParams codexed.models.v2_protocol
CancelLoginAccountResponse codexed.models.v2_protocol
ClientInfo codexed.models.v2_protocol
CodexBaseModel codexed.models.base Base model for all Codex API models.
CollabAgentState codexed.models.v2_protocol
CollabToolsConfig codexed.models.tool_config Configuration for multi-agent collaboration tools.
CollaborationMode codexed.models.v2_protocol Collaboration mode for a Codex session.
CollaborationModeListParams codexed.models.v2_protocol EXPERIMENTAL - list collaboration mode presets.
CollaborationModeListResponse codexed.models.v2_protocol EXPERIMENTAL - collaboration mode presets response.
CollaborationModeMask codexed.models.v2_protocol EXPERIMENTAL - collaboration mode preset metadata for clients.
CommandExecOutputDeltaMessage codexed.models.v2_protocol Stream base64-encoded stdout/stderr chunks for a running command/exec session.
CommandExecOutputDeltaNotification codexed.models.v2_protocol Base64-encoded output chunk emitted for a streaming command/exec request.
CommandExecParams codexed.models.v2_protocol Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.
CommandExecResizeParams codexed.models.v2_protocol Resize a running PTY-backed command/exec session.
CommandExecResizeResponse codexed.models.v2_protocol Empty success response for command/exec/resize.
CommandExecResponse codexed.models.v2_protocol Final buffered result for command/exec.
CommandExecTerminalSize codexed.models.v2_protocol PTY size in character cells for command/exec PTY sessions.
CommandExecTerminateParams codexed.models.v2_protocol Terminate a running command/exec session.
CommandExecTerminateResponse codexed.models.v2_protocol Empty success response for command/exec/terminate.
CommandExecWriteParams codexed.models.v2_protocol Write stdin bytes to a running command/exec session, close stdin, or both.
CommandExecWriteResponse codexed.models.v2_protocol Empty success response for command/exec/write.
CommandExecutionOutputDeltaNotification codexed.models.v2_protocol
CommandExecutionRequestApprovalParams codexed.models.request_params Parameters for item/commandExecution/requestApproval server request.
CommandExecutionRequestApprovalResponse codexed.models.responses Response for item/commandExecution/requestApproval server request.
CommitReviewTarget codexed.models.v2_protocol Review the changes introduced by a specific commit.
CompactionResponseItem codexed.models.v2_protocol
ConfigBatchWriteParams codexed.models.v2_protocol
ConfigEdit codexed.models.v2_protocol
ConfigLayer codexed.models.v2_protocol
ConfigLayerMetadata codexed.models.v2_protocol
ConfigReadParams codexed.models.v2_protocol
ConfigReadResponse codexed.models.v2_protocol
ConfigRequirements codexed.models.v2_protocol
ConfigRequirementsReadResponse codexed.models.v2_protocol
ConfigValueWriteParams codexed.models.v2_protocol
ConfigWarningMessage codexed.models.v2_protocol Notification sent from the server to the client.
ConfigWarningNotification codexed.models.v2_protocol
ConfigWriteResponse codexed.models.v2_protocol
ContextCompactedNotification codexed.models.v2_protocol Deprecated: Use ContextCompaction item type instead.
CreditsSnapshot codexed.models.v2_protocol
CustomReviewTarget codexed.models.v2_protocol Arbitrary instructions, equivalent to the old free-form prompt.
CustomToolCallOutputResponseItem codexed.models.v2_protocol
CustomToolCallResponseItem codexed.models.v2_protocol
DangerFullAccessSandboxPolicy codexed.models.v2_protocol
DeprecationNoticeMessage codexed.models.v2_protocol Notification sent from the server to the client.
DeprecationNoticeNotification codexed.models.v2_protocol
DynamicToolCallParams codexed.models.request_params Parameters for item/tool/call server request.
DynamicToolCallResponse codexed.models.responses Response for item/tool/call server request.
ErrorMessage codexed.models.v2_protocol NEW NOTIFICATIONS.
ErrorNotification codexed.models.v2_protocol
ExecPolicyAmendment codexed.models.misc Proposed execpolicy amendment (prefix rule).
ExperimentalFeature codexed.models.v2_protocol
ExperimentalFeatureListParams codexed.models.v2_protocol
ExperimentalFeatureListResponse codexed.models.v2_protocol
ExternalAgentConfigDetectParams codexed.models.v2_protocol
ExternalAgentConfigDetectResponse codexed.models.v2_protocol
ExternalAgentConfigImportParams codexed.models.v2_protocol
ExternalAgentConfigMigrationItem codexed.models.v2_protocol
ExternalSandboxSandboxPolicy codexed.models.v2_protocol
FeedbackUploadParams codexed.models.v2_protocol
FeedbackUploadResponse codexed.models.v2_protocol
FileChangeOutputDeltaNotification codexed.models.v2_protocol Deprecated legacy notification for apply_patch textual output.
FileChangeRequestApprovalParams codexed.models.request_params Parameters for item/fileChange/requestApproval server request.
FileChangeRequestApprovalResponse codexed.models.responses Response for item/fileChange/requestApproval server request.
FileUpdateChange codexed.models.v2_protocol
FindInPageWebSearchAction codexed.models.v2_protocol
FsChangedMessage codexed.models.v2_protocol Notification sent from the server to the client.
FsChangedNotification codexed.models.v2_protocol Filesystem watch notification emitted for fs/watch subscribers.
FsCopyParams codexed.models.v2_protocol Copy a file or directory tree on the host filesystem.
FsCopyResponse codexed.models.v2_protocol Successful response for fs/copy.
FsCreateDirectoryParams codexed.models.v2_protocol Create a directory on the host filesystem.
FsCreateDirectoryResponse codexed.models.v2_protocol Successful response for fs/createDirectory.
FsGetMetadataParams codexed.models.v2_protocol Request metadata for an absolute path.
FsGetMetadataResponse codexed.models.v2_protocol Metadata returned by fs/getMetadata.
FsReadDirectoryEntry codexed.models.v2_protocol A directory entry returned by fs/readDirectory.
FsReadDirectoryParams codexed.models.v2_protocol List direct child names for a directory.
FsReadDirectoryResponse codexed.models.v2_protocol Directory entries returned by fs/readDirectory.
FsReadFileParams codexed.models.v2_protocol Read a file from the host filesystem.
FsReadFileResponse codexed.models.v2_protocol Base64-encoded file contents returned by fs/readFile.
FsRemoveParams codexed.models.v2_protocol Remove a file or directory tree from the host filesystem.
FsRemoveResponse codexed.models.v2_protocol Successful response for fs/remove.
FsUnwatchParams codexed.models.v2_protocol Stop filesystem watch notifications for a prior fs/watch.
FsUnwatchResponse codexed.models.v2_protocol Successful response for fs/unwatch.
FsWatchParams codexed.models.v2_protocol Start filesystem watch notifications for an absolute path.
FsWatchResponse codexed.models.v2_protocol Successful response for fs/watch.
FsWriteFileParams codexed.models.v2_protocol Write a file on the host filesystem.
FsWriteFileResponse codexed.models.v2_protocol Successful response for fs/writeFile.
FunctionCallOutputResponseItem codexed.models.v2_protocol
FunctionCallResponseItem codexed.models.v2_protocol
FuzzyFileSearchParams codexed.models.v2_protocol
FuzzyFileSearchResult codexed.models.v2_protocol Superset of [codex_file_search::FileMatch].
FuzzyFileSearchSessionCompletedMessage codexed.models.v2_protocol Notification sent from the server to the client.
FuzzyFileSearchSessionCompletedNotification codexed.models.v2_protocol
FuzzyFileSearchSessionStartParams codexed.models.v2_protocol
FuzzyFileSearchSessionStopParams codexed.models.v2_protocol
FuzzyFileSearchSessionUpdateParams codexed.models.v2_protocol
FuzzyFileSearchSessionUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
FuzzyFileSearchSessionUpdatedNotification codexed.models.v2_protocol
GetAccountParams codexed.models.v2_protocol
GetAccountRateLimitsResponse codexed.models.v2_protocol
GetAccountResponse codexed.models.v2_protocol
GitInfo codexed.models.v2_protocol
Granular codexed.models.v2_protocol
GrepFilesToolConfig codexed.models.tool_config Configuration for the grep_files tool (experimental).
HookCompletedMessage codexed.models.v2_protocol Notification sent from the server to the client.
HookCompletedNotification codexed.models.v2_protocol
HookOutputEntry codexed.models.v2_protocol
HookRunSummary codexed.models.v2_protocol
HookStartedMessage codexed.models.v2_protocol Notification sent from the server to the client.
HookStartedNotification codexed.models.v2_protocol
HttpMcpServer codexed.models.mcp_server MCP server accessible via HTTP/SSE transport.
IdleThreadStatus codexed.models.v2_protocol
ImageGenerationCallResponseItem codexed.models.v2_protocol
ImageGenerationToolConfig codexed.models.tool_config Configuration for the image_generation tool.
InitializeCapabilities codexed.models.v2_protocol Client-declared capabilities negotiated during initialize.
InitializeParams codexed.models.v2_protocol
ItemAgentMessageDeltaNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemCommandExecutionOutputDeltaNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemCommandExecutionTerminalInteractionNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemCompletedData codexed.models.event_data Payload for item/completed notification (V2 protocol).
ItemCompletedEvent codexed.models.events Item completed event.
ItemFileChangeOutputDeltaNotification codexed.models.v2_protocol Deprecated legacy apply_patch output stream notification.
ItemMcpToolCallProgressNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemPlanDeltaNotification codexed.models.v2_protocol EXPERIMENTAL - proposed plan streaming deltas for plan items.
ItemReasoningSummaryPartAddedNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemReasoningSummaryTextDeltaNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemReasoningTextDeltaNotification codexed.models.v2_protocol Notification sent from the server to the client.
ItemStartedData codexed.models.event_data Payload for item/started notification (V2 protocol).
ItemStartedEvent codexed.models.events Item started event.
JsReplToolConfig codexed.models.tool_config Configuration for the js_repl / js_repl_reset tools.
JsonRpcError codexed.models.base JSON-RPC 2.0 error object.
JsonRpcNotification codexed.models.base JSON-RPC 2.0 notification message (no id).
JsonRpcRequest codexed.models.base JSON-RPC 2.0 request message.
JsonRpcResponse codexed.models.base JSON-RPC 2.0 response message.
ListDirToolConfig codexed.models.tool_config Configuration for the list_dir tool (experimental).
ListFilesCommandAction codexed.models.v2_protocol
ListMcpServerStatusParams codexed.models.v2_protocol
ListMcpServerStatusResponse codexed.models.responses Response for mcpServerStatus/list request.
LocalImageUserInput codexed.models.v2_protocol
LocalShellCallResponseItem codexed.models.v2_protocol
MarketplaceAddParams codexed.models.v2_protocol
MarketplaceAddResponse codexed.models.v2_protocol
MarketplaceRemoveParams codexed.models.v2_protocol
MarketplaceRemoveResponse codexed.models.v2_protocol
MarketplaceUpgradeParams codexed.models.v2_protocol
MarketplaceUpgradeResponse codexed.models.v2_protocol
McpElicitationFormParams codexed.models.request_params Form-mode MCP elicitation request.
McpElicitationUrlParams codexed.models.request_params URL-mode MCP elicitation request (browser-based auth).
McpResourceReadParams codexed.models.v2_protocol
McpResourceReadResponse codexed.models.v2_protocol
McpResourceToolsConfig codexed.models.tool_config Configuration for MCP resource browsing tools.
McpServerElicitationResponse codexed.models.responses Response for mcpServer/elicitation/request server request.
McpServerOauthLoginCompletedMessage codexed.models.v2_protocol Notification sent from the server to the client.
McpServerOauthLoginCompletedNotification codexed.models.v2_protocol
McpServerOauthLoginParams codexed.models.v2_protocol
McpServerOauthLoginResponse codexed.models.v2_protocol
McpServerRefreshResponse codexed.models.v2_protocol
McpServerStartupStatusUpdatedNotification codexed.models.v2_protocol Notification sent from the server to the client.
McpServerStatusEntry codexed.models.misc Status of a single MCP server.
McpServerStatusUpdatedNotification codexed.models.v2_protocol
McpServerToolCallParams codexed.models.v2_protocol
McpServerToolCallResponse codexed.models.v2_protocol
McpToolCallError codexed.models.v2_protocol
McpToolCallProgressNotification codexed.models.v2_protocol
McpToolCallResult codexed.models.thread_item MCP tool call result.
MemoryResetResponse codexed.models.v2_protocol
MentionUserInput codexed.models.v2_protocol
MessageResponseItem codexed.models.v2_protocol
Model codexed.models.v2_protocol
ModelAvailabilityNux codexed.models.v2_protocol
ModelListParams codexed.models.v2_protocol
ModelListResponse codexed.models.v2_protocol
ModelReroutedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ModelReroutedNotification codexed.models.v2_protocol
ModelUpgradeInfo codexed.models.v2_protocol
NetworkApprovalContext codexed.models.misc Network approval context for command approvals.
NetworkPolicyAmendment codexed.models.misc Proposed network policy amendment.
NetworkRequirements codexed.models.v2_protocol
NotLoadedThreadStatus codexed.models.v2_protocol
OpenPageWebSearchAction codexed.models.v2_protocol
OtherResponseItem codexed.models.v2_protocol
OtherWebSearchAction codexed.models.v2_protocol
PlanDeltaNotification codexed.models.v2_protocol EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.
PlanToolConfig codexed.models.tool_config Configuration for the update_plan tool.
PluginInstallParams codexed.models.v2_protocol
PluginInstallResponse codexed.models.v2_protocol
PluginListParams codexed.models.v2_protocol
PluginListResponse codexed.models.v2_protocol
PluginReadParams codexed.models.v2_protocol
PluginReadResponse codexed.models.v2_protocol
PluginUninstallParams codexed.models.v2_protocol
RateLimitSnapshot codexed.models.v2_protocol
RateLimitWindow codexed.models.v2_protocol
ReadCommandAction codexed.models.v2_protocol
ReadFileToolConfig codexed.models.tool_config Configuration for the read_file tool (experimental).
ReadOnlySandboxPolicy codexed.models.v2_protocol
RealtimeVoicesList codexed.models.v2_protocol
ReasoningEffortOption codexed.models.v2_protocol
ReasoningResponseItem codexed.models.v2_protocol
ReasoningSummaryPartAddedNotification codexed.models.v2_protocol
ReasoningSummaryTextDeltaNotification codexed.models.v2_protocol
ReasoningTextDeltaNotification codexed.models.v2_protocol
RemoteSkillSummary codexed.models.responses Summary of a remote skill.
RequestPermissionsToolConfig codexed.models.tool_config Configuration for the request_permissions tool.
RequestUserInputToolConfig codexed.models.tool_config Configuration for the request_user_input tool.
ReviewStartParams codexed.models.v2_protocol
ReviewStartResponse codexed.models.responses Response for review/start request.
SearchCommandAction codexed.models.v2_protocol
SearchWebSearchAction codexed.models.v2_protocol
SendAddCreditsNudgeEmailParams codexed.models.v2_protocol
ServerRequestResolvedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ServerRequestResolvedNotification codexed.models.v2_protocol
Settings codexed.models.v2_protocol Settings for a collaboration mode.
ShellToolConfig codexed.models.tool_config Configuration for the shell / exec tool.
SkillDependencies codexed.models.v2_protocol
SkillErrorInfo codexed.models.v2_protocol
SkillInterface codexed.models.v2_protocol
SkillMetadata codexed.models.v2_protocol
SkillRequestApprovalParams codexed.models.request_params Parameters for skill/requestApproval server request.
SkillRequestApprovalResponse codexed.models.misc Response for skill/requestApproval server request.
SkillToolDependency codexed.models.v2_protocol
SkillUserInput codexed.models.v2_protocol
SkillsConfigWriteParams codexed.models.v2_protocol
SkillsConfigWriteResponse codexed.models.v2_protocol
SkillsListEntry codexed.models.v2_protocol
SkillsListParams codexed.models.v2_protocol
SkillsListResponse codexed.models.v2_protocol
SkillsRemoteExportParams codexed.models.request_params Parameters for skills/remote/export request.
SkillsRemoteExportResponse codexed.models.responses Response for skills/remote/export request.
SkillsRemoteListParams codexed.models.request_params Parameters for skills/remote/list request.
SkillsRemoteListResponse codexed.models.responses Response for skills/remote/list request.
StdioMcpServer codexed.models.mcp_server MCP server running as a subprocess via stdio transport.
SystemErrorThreadStatus codexed.models.v2_protocol
TerminalInteractionNotification codexed.models.v2_protocol
TextElement codexed.models.v2_protocol
TextUserInput codexed.models.v2_protocol
Thread codexed.models.misc
ThreadArchiveParams codexed.models.v2_protocol
ThreadArchivedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadArchivedNotification codexed.models.v2_protocol
ThreadCompactStartParams codexed.models.v2_protocol
ThreadCompactedMessage codexed.models.v2_protocol Deprecated: Use ContextCompaction item type instead.
ThreadForkParams codexed.models.v2_protocol There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.
ThreadInjectItemsParams codexed.models.v2_protocol
ThreadItemAgentMessage codexed.models.thread_item Agent message item.
ThreadItemCollabAgentToolCall codexed.models.thread_item Collab agent tool call item.
ThreadItemCommandExecution codexed.models.thread_item Command execution item.
ThreadItemContextCompaction codexed.models.thread_item Context compaction item.
ThreadItemDynamicToolCall codexed.models.thread_item Dynamic tool call item.
ThreadItemEnteredReviewMode codexed.models.thread_item Entered review mode item.
ThreadItemExitedReviewMode codexed.models.thread_item Exited review mode item.
ThreadItemFileChange codexed.models.thread_item File change item.
ThreadItemFunctionCallOutput codexed.models.thread_item Output of a function call.
ThreadItemHookPrompt codexed.models.thread_item Prompt injected by a hook.
ThreadItemImageGeneration codexed.models.thread_item Image generation item.
ThreadItemImageView codexed.models.thread_item Image view item.
ThreadItemMcpToolCall codexed.models.thread_item MCP tool call item.
ThreadItemPlan codexed.models.thread_item Plan item.
ThreadItemReasoning codexed.models.thread_item Reasoning item.
ThreadItemSleep codexed.models.thread_item Sleep item.
ThreadItemSubAgentActivity codexed.models.thread_item Activity of a sub-agent.
ThreadItemUserMessage codexed.models.thread_item User message item.
ThreadItemWebSearch codexed.models.thread_item Web search item.
ThreadListParams codexed.models.v2_protocol
ThreadListResponse codexed.models.responses Response for thread/list request.
ThreadLoadedListParams codexed.models.v2_protocol
ThreadLoadedListResponse codexed.models.v2_protocol
ThreadMemoryModeSetParams codexed.models.v2_protocol
ThreadNameUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadNameUpdatedNotification codexed.models.v2_protocol
ThreadReadParams codexed.models.v2_protocol
ThreadReadResponse codexed.models.responses Response for thread/read request.
ThreadRealtimeAppendAudioParams codexed.models.v2_protocol EXPERIMENTAL - append audio input to thread realtime.
ThreadRealtimeAppendAudioResponse codexed.models.v2_protocol EXPERIMENTAL - response for appending realtime audio input.
ThreadRealtimeAppendTextParams codexed.models.v2_protocol EXPERIMENTAL - append text input to thread realtime.
ThreadRealtimeAppendTextResponse codexed.models.v2_protocol EXPERIMENTAL - response for appending realtime text input.
ThreadRealtimeAudioChunk codexed.models.v2_protocol EXPERIMENTAL - thread realtime audio chunk.
ThreadRealtimeClosedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeClosedNotification codexed.models.v2_protocol EXPERIMENTAL - emitted when thread realtime transport closes.
ThreadRealtimeErrorMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeErrorNotification codexed.models.v2_protocol EXPERIMENTAL - emitted when thread realtime encounters an error.
ThreadRealtimeItemAddedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeItemAddedNotification codexed.models.v2_protocol EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.
ThreadRealtimeListVoicesParams codexed.models.v2_protocol EXPERIMENTAL - list voices supported by thread realtime.
ThreadRealtimeListVoicesResponse codexed.models.v2_protocol EXPERIMENTAL - response for listing supported realtime voices.
ThreadRealtimeOutputAudioDeltaMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeOutputAudioDeltaNotification codexed.models.v2_protocol EXPERIMENTAL - streamed output audio emitted by thread realtime.
ThreadRealtimeStartParams codexed.models.v2_protocol EXPERIMENTAL - start a thread-scoped realtime session.
ThreadRealtimeStartResponse codexed.models.v2_protocol EXPERIMENTAL - response for starting thread realtime.
ThreadRealtimeStartedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeStartedNotification codexed.models.v2_protocol EXPERIMENTAL - emitted when thread realtime startup is accepted.
ThreadRealtimeStopParams codexed.models.v2_protocol EXPERIMENTAL - stop thread realtime.
ThreadRealtimeStopResponse codexed.models.v2_protocol EXPERIMENTAL - response for stopping thread realtime.
ThreadRealtimeTranscriptDeltaMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadRealtimeTranscriptDoneMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadResponse codexed.models.responses Response for thread/start, thread/resume, and thread/fork.
ThreadResumeParams codexed.models.v2_protocol There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.
ThreadRevertParams codexed.models.v2_protocol Replace a paginated thread's durable history with the prefix before one turn.
ThreadRevertResponse codexed.models.responses Response for thread/revert request.
ThreadSetNameParams codexed.models.v2_protocol
ThreadShellCommandParams codexed.models.v2_protocol
ThreadShellCommandResponse codexed.models.v2_protocol
ThreadStartParams codexed.models.v2_protocol
ThreadStartedData codexed.models.event_data Payload for thread/started notification (V2 protocol).
ThreadStartedEvent codexed.models.events Thread started event.
ThreadStatusChangedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadStatusChangedNotification codexed.models.v2_protocol
ThreadTokenUsage codexed.models.v2_protocol
ThreadTokenUsageUpdatedEvent codexed.models.events Thread token usage updated event.
ThreadTokenUsageUpdatedNotification codexed.models.v2_protocol
ThreadTurnsListParams codexed.models.v2_protocol
ThreadTurnsListResponse codexed.models.v2_protocol
ThreadUnarchiveParams codexed.models.v2_protocol
ThreadUnarchiveResponse codexed.models.responses Response for thread/unarchive request.
ThreadUnarchivedMessage codexed.models.v2_protocol Notification sent from the server to the client.
ThreadUnsubscribeParams codexed.models.v2_protocol
ThreadUnsubscribeResponse codexed.models.v2_protocol
TokenUsageBreakdown codexed.models.v2_protocol
ToolRequestUserInputAnswer codexed.models.misc A user's answer to a request_user_input question.
ToolRequestUserInputOption codexed.models.misc A selectable option for a user input question.
ToolRequestUserInputParams codexed.models.request_params Parameters for item/tool/requestUserInput server request.
ToolRequestUserInputQuestion codexed.models.misc A question in a tool request for user input.
ToolRequestUserInputResponse codexed.models.responses Response for item/tool/requestUserInput server request.
ToolSearchToolConfig codexed.models.tool_config Configuration for the tool_search tool (requires apps).
ToolSuggestToolConfig codexed.models.tool_config Configuration for the tool_suggest tool (requires discoverable tools).
Turn codexed.models.misc Turn data structure.
TurnCompletedData codexed.models.event_data Payload for turn/completed notification (V2 protocol).
TurnCompletedEvent codexed.models.events Turn completed event.
TurnData codexed.models.misc Turn data in responses.
TurnDiffUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
TurnDiffUpdatedNotification codexed.models.v2_protocol Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.
TurnEnvironmentParams codexed.models.v2_protocol
TurnError codexed.models.v2_protocol
TurnInterruptParams codexed.models.v2_protocol
TurnPlanStep codexed.models.v2_protocol
TurnPlanUpdatedMessage codexed.models.v2_protocol Notification sent from the server to the client.
TurnPlanUpdatedNotification codexed.models.v2_protocol
TurnStartParams codexed.models.v2_protocol
TurnStartResponse codexed.models.responses Response for turn/start request.
TurnStartedData codexed.models.event_data Payload for turn/started notification (V2 protocol).
TurnStartedEvent codexed.models.events Turn started event.
TurnSteerParams codexed.models.v2_protocol
TurnSteerResponse codexed.models.v2_protocol
UncommittedChangesReviewTarget codexed.models.v2_protocol Review the working tree: staged, unstaged, and untracked files.
UnknownCommandAction codexed.models.v2_protocol
ViewImageToolConfig codexed.models.tool_config Configuration for the view_image tool.
WarningNotification codexed.models.v2_protocol
WebSearchCallResponseItem codexed.models.v2_protocol
WebSearchLocation codexed.models.v2_protocol
WebSearchToolConfig codexed.models.tool_config Configuration for the web_search tool.
WindowsWorldWritableWarningMessage codexed.models.v2_protocol Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.
WindowsWorldWritableWarningNotification codexed.models.v2_protocol
WorkspaceWriteSandboxPolicy codexed.models.v2_protocol

🛈 DocStrings

Codex adapter models.

McpServerElicitationRequestParams module-attribute

McpServerElicitationRequestParams = Annotated[
    McpElicitationFormParams | McpElicitationUrlParams, Discriminator("mode")
]

Parameters for mcpServer/elicitation/request, discriminated by mode.

ApprovalsReviewer

ApprovalsReviewer = Literal['user', 'auto_review', 'guardian_subagent']

Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to user. auto_review uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value guardian_subagent is accepted for compatibility.

AuthMode

AuthMode = Literal[
    "apikey",
    "chatgpt",
    "chatgptAuthTokens",
    "headers",
    "agentIdentity",
    "personalAccessToken",
    "bedrockApiKey",
    "bedrockAccessKeys",
]

Authentication mode for OpenAI-backed providers.

CommandExecOutputStream

CommandExecOutputStream = Literal['stdout', 'stderr']

Stream label for command/exec/outputDelta notifications.

InputModality

InputModality = Literal['text', 'image', 'audio']

Canonical user-input modality tags advertised by a model.

MessagePhase

MessagePhase = Literal['commentary', 'partial_answer', 'final_answer']

Classifies assistant text as commentary, a partial answer, or a terminal answer.

Providers do not emit this consistently, so callers must treat None as "phase unknown" and keep compatibility behavior for legacy models.

ModeKind

ModeKind = Literal['plan', 'default']

Initial collaboration mode to use when the TUI starts.

Personality

Personality = Literal['none', 'friendly', 'pragmatic']

Deprecated: friendly and pragmatic no longer select a style.

ReasoningEffort

ReasoningEffort = Annotated[str, Field(..., min_length=1)]

A non-empty reasoning effort value advertised by the model.

ReasoningSummary

ReasoningSummary = Literal['auto', 'concise', 'detailed', 'none']

A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries

ThreadRealtimeStartTransport

EXPERIMENTAL - transport used by thread realtime.

ToolApprovalMode

ToolApprovalMode = Literal['auto', 'prompt', 'writes', 'approve']

When Codex asks before calling a server's tools (default_tools_approval_mode).

  • auto: Codex's default; asks unless the tool is annotated read-only, or non-destructive and closed-world. Under approval policy never it rejects them.
  • prompt: always asks.
  • writes: asks unless the tool is annotated read-only.
  • approve: never asks.

AccountLoginCompletedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class AccountLoginCompletedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["account/login/completed"] = "account/login/completed"
    params: AccountLoginCompletedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

AccountRateLimitsUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class AccountRateLimitsUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["account/rateLimits/updated"] = "account/rateLimits/updated"
    params: AccountRateLimitsUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

AccountRateLimitsUpdatedNotification

Bases: CodexBaseModel

Sparse rolling rate-limit update.

Clients should merge available values into the most recent account/rateLimits/read response or refetch that snapshot. Nullable account metadata may be unavailable in a rolling update and does not clear a previously observed value.

Source code in src/codexed/models/v2_protocol.py
class AccountRateLimitsUpdatedNotification(CodexBaseModel):
    """Sparse rolling rate-limit update.

    Clients should merge available values into the most recent `account/rateLimits/read` response or refetch that snapshot. Nullable account metadata may be unavailable in a rolling update and does not clear a previously observed value.
    """

    rate_limits: RateLimitSnapshot

AccountSendAddCreditsNudgeEmailRequest

Bases: CodexBaseModel

Request from the client to the server.

Source code in src/codexed/models/v2_protocol.py
class AccountSendAddCreditsNudgeEmailRequest(CodexBaseModel):
    """Request from the client to the server."""

    id: RequestId
    method: Literal["account/sendAddCreditsNudgeEmail"] = "account/sendAddCreditsNudgeEmail"
    params: SendAddCreditsNudgeEmailParams

AccountUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class AccountUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["account/updated"] = "account/updated"
    params: AccountUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

AccountUpdatedNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class AccountUpdatedNotification(CodexBaseModel):
    auth_mode: AuthMode | None = None
    plan_type: PlanType | None = None
    reason: AccountUpdateReason | None = None
    """
    Set when initial routing discovery completes for the same authenticated owner.
    """

reason class-attribute instance-attribute

reason: AccountUpdateReason | None = None

Set when initial routing discovery completes for the same authenticated owner.

AgentJobsToolsConfig

Bases: _ToolConfigBase

Configuration for CSV-backed agent job tools.

Controls spawn_agents_on_csv and report_agent_job_result.

Source code in src/codexed/models/tool_config.py
class AgentJobsToolsConfig(_ToolConfigBase):
    """Configuration for CSV-backed agent job tools.

    Controls ``spawn_agents_on_csv`` and ``report_agent_job_result``.
    """

    type: Literal["agent_jobs"] = "agent_jobs"

AppBranding

Bases: CodexBaseModel

EXPERIMENTAL - app metadata returned by app-list APIs.

Source code in src/codexed/models/v2_protocol.py
class AppBranding(CodexBaseModel):
    """EXPERIMENTAL - app metadata returned by app-list APIs."""

    category: str | None = None
    developer: str | None = None
    is_discoverable_app: bool
    privacy_policy: str | None = None
    terms_of_service: str | None = None
    website: str | None = None

AppInfo

Bases: CodexBaseModel

EXPERIMENTAL - app metadata returned by app-list APIs.

Source code in src/codexed/models/v2_protocol.py
class AppInfo(CodexBaseModel):
    """EXPERIMENTAL - app metadata returned by app-list APIs."""

    app_metadata: AppMetadata | None = None
    branding: AppBranding | None = None
    description: str | None = None
    distribution_channel: str | None = None
    icon_assets: dict[str, Any] | None = None
    icon_dark_assets: dict[str, Any] | None = None
    id: str
    install_url: str | None = None
    is_accessible: bool | None = False
    is_enabled: bool | None = True
    """
    Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```
    """
    labels: dict[str, Any] | None = None
    logo_url: str | None = None
    logo_url_dark: str | None = None
    name: str
    plugin_display_names: list[str] | None = []

is_enabled class-attribute instance-attribute

is_enabled: bool | None = True

Whether this app is enabled in config.toml. Example: toml [apps.bad_app] enabled = false

AppListUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class AppListUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["app/list/updated"] = "app/list/updated"
    params: AppListUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

AppListUpdatedNotification

Bases: CodexBaseModel

EXPERIMENTAL - notification emitted when the app list changes.

Source code in src/codexed/models/v2_protocol.py
class AppListUpdatedNotification(CodexBaseModel):
    """EXPERIMENTAL - notification emitted when the app list changes."""

    data: list[AppInfo]

ApplyPatchToolConfig

Bases: _ToolConfigBase

Configuration for the apply_patch tool.

Source code in src/codexed/models/tool_config.py
class ApplyPatchToolConfig(_ToolConfigBase):
    """Configuration for the apply_patch tool."""

    type: Literal["apply_patch"] = "apply_patch"

    variant: Literal["freeform", "function"] | None = None
    """Patch format variant."""

variant class-attribute instance-attribute

variant: Literal['freeform', 'function'] | None = None

Patch format variant.

AppsListParams

Bases: CodexBaseModel

EXPERIMENTAL - list available apps/connectors.

Source code in src/codexed/models/v2_protocol.py
class AppsListParams(CodexBaseModel):
    """EXPERIMENTAL - list available apps/connectors."""

    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    force_refetch: bool | None = None
    """
    When true, bypass app caches and fetch the latest data from sources.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to a reasonable server-side value.
    """
    thread_id: str | None = None
    """
    Optional thread id used to evaluate app feature gating from that thread's config.
    """

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

force_refetch class-attribute instance-attribute

force_refetch: bool | None = None

When true, bypass app caches and fetch the latest data from sources.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to a reasonable server-side value.

thread_id class-attribute instance-attribute

thread_id: str | None = None

Optional thread id used to evaluate app feature gating from that thread's config.

AppsListResponse

Bases: CodexBaseModel

EXPERIMENTAL - app list response.

Source code in src/codexed/models/v2_protocol.py
class AppsListResponse(CodexBaseModel):
    """EXPERIMENTAL - app list response."""

    data: list[AppInfo]
    next_cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.
    """

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.

ArtifactsToolConfig

Bases: _ToolConfigBase

Configuration for the artifacts tool.

Source code in src/codexed/models/tool_config.py
class ArtifactsToolConfig(_ToolConfigBase):
    """Configuration for the artifacts tool."""

    type: Literal["artifacts"] = "artifacts"

BaseBranchReviewTarget

Bases: CodexBaseModel

Review changes between the current branch and the given base branch.

Source code in src/codexed/models/v2_protocol.py
class BaseBranchReviewTarget(CodexBaseModel):
    """Review changes between the current branch and the given base branch."""

    branch: str
    type: Literal["baseBranch"] = "baseBranch"

BuiltinToolsConfig

Bases: BaseModel

Combined configuration for all Codex builtin tools.

Provides named fields as a convenience over list[ToolConfig]. Call :meth:to_config_dict to obtain the config dict for ThreadStartParams, or :meth:to_tool_list to get a list[ToolConfig].

Example::

tools = BuiltinToolsConfig(
    web_search=WebSearchToolConfig(mode="live", context_size="high"),
    js_repl=JsReplToolConfig(),
)
params = ThreadStartParams(config=tools.to_config_dict())
Source code in src/codexed/models/tool_config.py
class BuiltinToolsConfig(BaseModel):
    """Combined configuration for all Codex builtin tools.

    Provides named fields as a convenience over ``list[ToolConfig]``.
    Call :meth:`to_config_dict` to obtain the ``config`` dict for
    ``ThreadStartParams``, or :meth:`to_tool_list` to get a
    ``list[ToolConfig]``.

    Example::

        tools = BuiltinToolsConfig(
            web_search=WebSearchToolConfig(mode="live", context_size="high"),
            js_repl=JsReplToolConfig(),
        )
        params = ThreadStartParams(config=tools.to_config_dict())
    """

    model_config = ConfigDict(populate_by_name=True)

    shell: ShellToolConfig | None = None
    apply_patch: ApplyPatchToolConfig | None = None
    web_search: WebSearchToolConfig | None = None
    image_generation: ImageGenerationToolConfig | None = None
    view_image: ViewImageToolConfig | None = None
    plan: PlanToolConfig | None = None
    js_repl: JsReplToolConfig | None = None
    collab: CollabToolsConfig | None = None
    agent_jobs: AgentJobsToolsConfig | None = None
    request_user_input: RequestUserInputToolConfig | None = None
    request_permissions: RequestPermissionsToolConfig | None = None
    artifacts: ArtifactsToolConfig | None = None
    grep_files: GrepFilesToolConfig | None = None
    read_file: ReadFileToolConfig | None = None
    list_dir: ListDirToolConfig | None = None
    tool_search: ToolSearchToolConfig | None = None
    tool_suggest: ToolSuggestToolConfig | None = None
    mcp_resources: McpResourceToolsConfig | None = None

    def to_tool_list(self) -> list[ToolConfig]:
        """Return only explicitly set tool configs as a list."""
        return [
            v
            for v in (
                self.shell,
                self.apply_patch,
                self.web_search,
                self.image_generation,
                self.view_image,
                self.plan,
                self.js_repl,
                self.collab,
                self.agent_jobs,
                self.request_user_input,
                self.request_permissions,
                self.artifacts,
                self.grep_files,
                self.read_file,
                self.list_dir,
                self.tool_search,
                self.tool_suggest,
                self.mcp_resources,
            )
            if v is not None
        ]

    def to_config_dict(self) -> dict[str, Any]:
        """Serialize into a flat config dict for ``ThreadStartParams.config``.

        Only explicitly set tools are included. An empty ``BuiltinToolsConfig``
        produces an empty dict (server defaults preserved).
        """
        tool_list = self.to_tool_list()
        if not tool_list:
            return {}
        return tools_to_config_dict(tool_list)

to_config_dict

to_config_dict() -> dict[str, Any]

Serialize into a flat config dict for ThreadStartParams.config.

Only explicitly set tools are included. An empty BuiltinToolsConfig produces an empty dict (server defaults preserved).

Source code in src/codexed/models/tool_config.py
def to_config_dict(self) -> dict[str, Any]:
    """Serialize into a flat config dict for ``ThreadStartParams.config``.

    Only explicitly set tools are included. An empty ``BuiltinToolsConfig``
    produces an empty dict (server defaults preserved).
    """
    tool_list = self.to_tool_list()
    if not tool_list:
        return {}
    return tools_to_config_dict(tool_list)

to_tool_list

to_tool_list() -> list[ToolConfig]

Return only explicitly set tool configs as a list.

Source code in src/codexed/models/tool_config.py
def to_tool_list(self) -> list[ToolConfig]:
    """Return only explicitly set tool configs as a list."""
    return [
        v
        for v in (
            self.shell,
            self.apply_patch,
            self.web_search,
            self.image_generation,
            self.view_image,
            self.plan,
            self.js_repl,
            self.collab,
            self.agent_jobs,
            self.request_user_input,
            self.request_permissions,
            self.artifacts,
            self.grep_files,
            self.read_file,
            self.list_dir,
            self.tool_search,
            self.tool_suggest,
            self.mcp_resources,
        )
        if v is not None
    ]

CodexBaseModel

Bases: BaseModel

Base model for all Codex API models.

Provides: - Strict validation in tests (CODEXED_STRICT_MODELS=1: forbids extra fields to catch schema changes) - Lenient validation in production (ignores extra fields for forward compat) - Snake_case Python fields with camelCase JSON aliases - Both field names and aliases accepted for parsing (populate_by_name=True)

Source code in src/codexed/models/base.py
class CodexBaseModel(BaseModel):
    """Base model for all Codex API models.

    Provides:
    - Strict validation in tests (``CODEXED_STRICT_MODELS=1``: forbids extra fields to catch
      schema changes)
    - Lenient validation in production (ignores extra fields for forward compat)
    - Snake_case Python fields with camelCase JSON aliases
    - Both field names and aliases accepted for parsing (populate_by_name=True)
    """

    model_config = ConfigDict(
        extra="forbid" if IS_DEV else "ignore",
        populate_by_name=True,
        alias_generator=to_camel,
        defer_build=True,
    )

CollabToolsConfig

Bases: _ToolConfigBase

Configuration for multi-agent collaboration tools.

Controls spawn_agent, send_input, resume_agent, wait_agent, and close_agent.

Source code in src/codexed/models/tool_config.py
class CollabToolsConfig(_ToolConfigBase):
    """Configuration for multi-agent collaboration tools.

    Controls ``spawn_agent``, ``send_input``, ``resume_agent``,
    ``wait_agent``, and ``close_agent``.
    """

    type: Literal["collab"] = "collab"

CollaborationMode

Bases: CodexBaseModel

Collaboration mode for a Codex session.

Source code in src/codexed/models/v2_protocol.py
class CollaborationMode(CodexBaseModel):
    """Collaboration mode for a Codex session."""

    mode: ModeKind
    settings: Settings

CollaborationModeListParams

Bases: CodexBaseModel

EXPERIMENTAL - list collaboration mode presets.

Source code in src/codexed/models/v2_protocol.py
class CollaborationModeListParams(CodexBaseModel):
    """EXPERIMENTAL - list collaboration mode presets."""

CollaborationModeListResponse

Bases: CodexBaseModel

EXPERIMENTAL - collaboration mode presets response.

Source code in src/codexed/models/v2_protocol.py
class CollaborationModeListResponse(CodexBaseModel):
    """EXPERIMENTAL - collaboration mode presets response."""

    data: list[CollaborationModeMask]

CollaborationModeMask

Bases: CodexBaseModel

EXPERIMENTAL - collaboration mode preset metadata for clients.

Source code in src/codexed/models/v2_protocol.py
class CollaborationModeMask(CodexBaseModel):
    """EXPERIMENTAL - collaboration mode preset metadata for clients."""

    mode: ModeKind | None = None
    model: str | None = None
    name: str
    reasoning_effort: ReasoningEffort | None = None

CommandExecOutputDeltaMessage

Bases: CodexBaseModel

Stream base64-encoded stdout/stderr chunks for a running command/exec session.

Source code in src/codexed/models/v2_protocol.py
class CommandExecOutputDeltaMessage(CodexBaseModel):
    """Stream base64-encoded stdout/stderr chunks for a running `command/exec` session."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["command/exec/outputDelta"] = "command/exec/outputDelta"
    params: CommandExecOutputDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

CommandExecOutputDeltaNotification

Bases: CodexBaseModel

Base64-encoded output chunk emitted for a streaming command/exec request.

These notifications are connection-scoped. If the originating connection closes, the server terminates the process.

Source code in src/codexed/models/v2_protocol.py
class CommandExecOutputDeltaNotification(CodexBaseModel):
    """Base64-encoded output chunk emitted for a streaming `command/exec` request.

    These notifications are connection-scoped. If the originating connection closes, the server terminates the process.
    """

    cap_reached: bool
    """
    `true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.
    """
    delta_base64: str
    """
    Base64-encoded output bytes.
    """
    process_id: str
    """
    Client-supplied, connection-scoped `processId` from the original `command/exec` request.
    """
    stream: CommandExecOutputStream
    """
    Output stream for this chunk.
    """

cap_reached instance-attribute

cap_reached: bool

true on the final streamed chunk for a stream when outputBytesCap truncated later output on that stream.

delta_base64 instance-attribute

delta_base64: str

Base64-encoded output bytes.

process_id instance-attribute

process_id: str

Client-supplied, connection-scoped processId from the original command/exec request.

stream instance-attribute

Output stream for this chunk.

CommandExecParams

Bases: CodexBaseModel

Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.

The final command/exec response is deferred until the process exits and is sent only after all command/exec/outputDelta notifications for that connection have been emitted.

Source code in src/codexed/models/v2_protocol.py
class CommandExecParams(CodexBaseModel):
    """Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.

    The final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.
    """

    command: list[str]
    """
    Command argv vector. Empty arrays are rejected.
    """
    cwd: str | None = None
    """
    Optional working directory. Defaults to the server cwd.
    """
    disable_output_cap: bool | None = None
    """
    Disable stdout/stderr capture truncation for this request.

    Cannot be combined with `outputBytesCap`.
    """
    disable_timeout: bool | None = None
    """
    Disable the timeout entirely for this request.

    Cannot be combined with `timeoutMs`.
    """
    env: dict[str, Any] | None = None
    """
    Optional environment overrides merged into the server-computed environment.

    Matching names override inherited values. Set a key to `null` to unset an inherited variable.
    """
    output_bytes_cap: int | None = Field(None, ge=0)
    """
    Optional per-stream stdout/stderr capture cap in bytes.

    When omitted, the server default applies. Cannot be combined with `disableOutputCap`.
    """
    permission_profile: str | None = None
    """
    Optional active permissions profile id for this command.

    Defaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`.
    """
    process_id: str | None = None
    """
    Optional client-supplied, connection-scoped process id.

    Required for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.
    """
    sandbox_policy: SandboxPolicy | None = None
    """
    Optional sandbox policy for this command.

    Uses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.
    """
    size: CommandExecTerminalSize | None = None
    """
    Optional initial PTY size in character cells. Only valid when `tty` is true.
    """
    stream_stdin: bool | None = None
    """
    Allow follow-up `command/exec/write` requests to write stdin bytes.

    Requires a client-supplied `processId`.
    """
    stream_stdout_stderr: bool | None = None
    """
    Stream stdout/stderr via `command/exec/outputDelta` notifications.

    Streamed bytes are not duplicated into the final response and require a client-supplied `processId`.
    """
    timeout_ms: int | None = None
    """
    Optional timeout in milliseconds.

    When omitted, the server default applies. Cannot be combined with `disableTimeout`.
    """
    tty: bool | None = None
    """
    Enable PTY mode.

    This implies `streamStdin` and `streamStdoutStderr`.
    """

command instance-attribute

command: list[str]

Command argv vector. Empty arrays are rejected.

cwd class-attribute instance-attribute

cwd: str | None = None

Optional working directory. Defaults to the server cwd.

disable_output_cap class-attribute instance-attribute

disable_output_cap: bool | None = None

Disable stdout/stderr capture truncation for this request.

Cannot be combined with outputBytesCap.

disable_timeout class-attribute instance-attribute

disable_timeout: bool | None = None

Disable the timeout entirely for this request.

Cannot be combined with timeoutMs.

env class-attribute instance-attribute

env: dict[str, Any] | None = None

Optional environment overrides merged into the server-computed environment.

Matching names override inherited values. Set a key to null to unset an inherited variable.

output_bytes_cap class-attribute instance-attribute

output_bytes_cap: int | None = Field(None, ge=0)

Optional per-stream stdout/stderr capture cap in bytes.

When omitted, the server default applies. Cannot be combined with disableOutputCap.

permission_profile class-attribute instance-attribute

permission_profile: str | None = None

Optional active permissions profile id for this command.

Defaults to the user's configured permissions when omitted. Cannot be combined with sandboxPolicy.

process_id class-attribute instance-attribute

process_id: str | None = None

Optional client-supplied, connection-scoped process id.

Required for tty, streamStdin, streamStdoutStderr, and follow-up command/exec/write, command/exec/resize, and command/exec/terminate calls. When omitted, buffered execution gets an internal id that is not exposed to the client.

sandbox_policy class-attribute instance-attribute

sandbox_policy: SandboxPolicy | None = None

Optional sandbox policy for this command.

Uses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with permissionProfile.

size class-attribute instance-attribute

size: CommandExecTerminalSize | None = None

Optional initial PTY size in character cells. Only valid when tty is true.

stream_stdin class-attribute instance-attribute

stream_stdin: bool | None = None

Allow follow-up command/exec/write requests to write stdin bytes.

Requires a client-supplied processId.

stream_stdout_stderr class-attribute instance-attribute

stream_stdout_stderr: bool | None = None

Stream stdout/stderr via command/exec/outputDelta notifications.

Streamed bytes are not duplicated into the final response and require a client-supplied processId.

timeout_ms class-attribute instance-attribute

timeout_ms: int | None = None

Optional timeout in milliseconds.

When omitted, the server default applies. Cannot be combined with disableTimeout.

tty class-attribute instance-attribute

tty: bool | None = None

Enable PTY mode.

This implies streamStdin and streamStdoutStderr.

CommandExecResizeParams

Bases: CodexBaseModel

Resize a running PTY-backed command/exec session.

Source code in src/codexed/models/v2_protocol.py
class CommandExecResizeParams(CodexBaseModel):
    """Resize a running PTY-backed `command/exec` session."""

    process_id: str
    """
    Client-supplied, connection-scoped `processId` from the original `command/exec` request.
    """
    size: CommandExecTerminalSize
    """
    New PTY size in character cells.
    """

process_id instance-attribute

process_id: str

Client-supplied, connection-scoped processId from the original command/exec request.

size instance-attribute

New PTY size in character cells.

CommandExecResizeResponse

Bases: CodexBaseModel

Empty success response for command/exec/resize.

Source code in src/codexed/models/v2_protocol.py
class CommandExecResizeResponse(CodexBaseModel):
    """Empty success response for `command/exec/resize`."""

CommandExecResponse

Bases: CodexBaseModel

Final buffered result for command/exec.

Source code in src/codexed/models/v2_protocol.py
class CommandExecResponse(CodexBaseModel):
    """Final buffered result for `command/exec`."""

    exit_code: int
    """
    Process exit code.
    """
    stderr: str
    """
    Buffered stderr capture.

    Empty when stderr was streamed via `command/exec/outputDelta`.
    """
    stdout: str
    """
    Buffered stdout capture.

    Empty when stdout was streamed via `command/exec/outputDelta`.
    """

exit_code instance-attribute

exit_code: int

Process exit code.

stderr instance-attribute

stderr: str

Buffered stderr capture.

Empty when stderr was streamed via command/exec/outputDelta.

stdout instance-attribute

stdout: str

Buffered stdout capture.

Empty when stdout was streamed via command/exec/outputDelta.

CommandExecTerminalSize

Bases: CodexBaseModel

PTY size in character cells for command/exec PTY sessions.

Source code in src/codexed/models/v2_protocol.py
class CommandExecTerminalSize(CodexBaseModel):
    """PTY size in character cells for `command/exec` PTY sessions."""

    cols: int = Field(..., ge=0)
    """
    Terminal width in character cells.
    """
    rows: int = Field(..., ge=0)
    """
    Terminal height in character cells.
    """

cols class-attribute instance-attribute

cols: int = Field(..., ge=0)

Terminal width in character cells.

rows class-attribute instance-attribute

rows: int = Field(..., ge=0)

Terminal height in character cells.

CommandExecTerminateParams

Bases: CodexBaseModel

Terminate a running command/exec session.

Source code in src/codexed/models/v2_protocol.py
class CommandExecTerminateParams(CodexBaseModel):
    """Terminate a running `command/exec` session."""

    process_id: str
    """
    Client-supplied, connection-scoped `processId` from the original `command/exec` request.
    """

process_id instance-attribute

process_id: str

Client-supplied, connection-scoped processId from the original command/exec request.

CommandExecTerminateResponse

Bases: CodexBaseModel

Empty success response for command/exec/terminate.

Source code in src/codexed/models/v2_protocol.py
class CommandExecTerminateResponse(CodexBaseModel):
    """Empty success response for `command/exec/terminate`."""

CommandExecWriteParams

Bases: CodexBaseModel

Write stdin bytes to a running command/exec session, close stdin, or both.

Source code in src/codexed/models/v2_protocol.py
class CommandExecWriteParams(CodexBaseModel):
    """Write stdin bytes to a running `command/exec` session, close stdin, or both."""

    close_stdin: bool | None = None
    """
    Close stdin after writing `deltaBase64`, if present.
    """
    delta_base64: str | None = None
    """
    Optional base64-encoded stdin bytes to write.
    """
    process_id: str
    """
    Client-supplied, connection-scoped `processId` from the original `command/exec` request.
    """

close_stdin class-attribute instance-attribute

close_stdin: bool | None = None

Close stdin after writing deltaBase64, if present.

delta_base64 class-attribute instance-attribute

delta_base64: str | None = None

Optional base64-encoded stdin bytes to write.

process_id instance-attribute

process_id: str

Client-supplied, connection-scoped processId from the original command/exec request.

CommandExecWriteResponse

Bases: CodexBaseModel

Empty success response for command/exec/write.

Source code in src/codexed/models/v2_protocol.py
class CommandExecWriteResponse(CodexBaseModel):
    """Empty success response for `command/exec/write`."""

CommandExecutionRequestApprovalParams

Bases: CodexBaseModel

Parameters for item/commandExecution/requestApproval server request.

Source code in src/codexed/models/request_params.py
class CommandExecutionRequestApprovalParams(CodexBaseModel):
    """Parameters for item/commandExecution/requestApproval server request."""

    thread_id: str
    turn_id: str
    item_id: str
    approval_id: str | None = None
    reason: str | None = None
    network_approval_context: NetworkApprovalContext | None = None
    command: str | None = None
    cwd: str | None = None
    command_actions: list[CommandAction] | None = None
    additional_permissions: dict[str, Any] | None = None
    proposed_execpolicy_amendment: ExecPolicyAmendment | None = None
    proposed_network_policy_amendments: list[NetworkPolicyAmendment] | None = None
    available_decisions: list[ApprovalDecision] | None = None

CommandExecutionRequestApprovalResponse

Bases: CodexBaseModel

Response for item/commandExecution/requestApproval server request.

Source code in src/codexed/models/responses.py
class CommandExecutionRequestApprovalResponse(CodexBaseModel):
    """Response for item/commandExecution/requestApproval server request."""

    decision: ApprovalDecision

CommitReviewTarget

Bases: CodexBaseModel

Review the changes introduced by a specific commit.

Source code in src/codexed/models/v2_protocol.py
class CommitReviewTarget(CodexBaseModel):
    """Review the changes introduced by a specific commit."""

    sha: str
    title: str | None = None
    """
    Optional human-readable label (e.g., commit subject) for UIs.
    """
    type: Literal["commit"] = "commit"

title class-attribute instance-attribute

title: str | None = None

Optional human-readable label (e.g., commit subject) for UIs.

ConfigBatchWriteParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigBatchWriteParams(CodexBaseModel):
    edits: list[ConfigEdit]
    expected_version: str | None = None
    file_path: str | None = None
    """
    Path to the config file to write; defaults to the user's `config.toml` when omitted.
    """
    reload_user_config: bool | None = None
    """
    When true, hot-reload updated runtime settings into loaded threads after writing. Session-static model, reasoning-effort, Plan-mode reasoning-effort, and service-tier defaults are not reloaded. The deprecated personality setting is also not reloaded.
    """

file_path class-attribute instance-attribute

file_path: str | None = None

Path to the config file to write; defaults to the user's config.toml when omitted.

reload_user_config class-attribute instance-attribute

reload_user_config: bool | None = None

When true, hot-reload updated runtime settings into loaded threads after writing. Session-static model, reasoning-effort, Plan-mode reasoning-effort, and service-tier defaults are not reloaded. The deprecated personality setting is also not reloaded.

ConfigReadParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigReadParams(CodexBaseModel):
    cwd: str | None = None
    """
    Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).
    """
    include_layers: bool | None = None

cwd class-attribute instance-attribute

cwd: str | None = None

Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between cwd and the project/repo root).

ConfigRequirements

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigRequirements(CodexBaseModel):
    additional_developer_instructions: str | None = None
    allow_appshots: bool | None = None
    allow_browser_and_computer_use: bool | None = None
    allow_login_shell: bool | None = None
    allow_managed_hooks_only: bool | None = None
    allow_remote_control: bool | None = None
    allowed_approval_policies: list[AskForApproval] | None = None
    allowed_approvals_reviewers: list[ApprovalsReviewer] | None = None
    allowed_login_methods: list[ForcedLoginMethod] | None = None
    """
    Effective login methods after managed, forced-login, and workspace restrictions. An empty list permits no login method. Older servers may omit this field.
    """
    allowed_permission_profiles: dict[str, Any] | None = None
    allowed_sandbox_modes: list[SandboxMode] | None = None
    allowed_web_search_modes: list[WebSearchMode] | None = None
    allowed_windows_sandbox_implementations: list[WindowsSandboxImplementation] | None = None
    application: ApplicationRequirements | None = None
    auto_review: AutoReviewRequirements | None = None
    browser_use: BrowserUseRequirements | None = None
    chatgpt_base_url: str | None = None
    check_for_update_on_startup: bool | None = None
    cli_auth_credentials_store: CliAuthCredentialsStoreMode | None = None
    computer_use: ComputerUseRequirements | None = None
    default_permissions: str | None = None
    enforce_residency: ResidencyRequirement | None = None
    feature_requirements: dict[str, Any] | None = None
    feedback: FeedbackRequirements | None = None
    hooks: ManagedHooksRequirements | None = None
    in_app_browser: InAppBrowserRequirements | None = None
    log_dir: str | None = None
    model_catalog_json: str | None = None
    model_provider: str | None = None
    """
    Exact provider selection required by managed policy.
    """
    model_providers: dict[str, Any] | None = None
    """
    Complete required provider definitions, using config.toml field names.
    """
    models: ModelsRequirements | None = None
    network: NetworkRequirements | None = None
    otel: OtelRequirements | None = None
    sqlite_home: str | None = None

allowed_login_methods class-attribute instance-attribute

allowed_login_methods: list[ForcedLoginMethod] | None = None

Effective login methods after managed, forced-login, and workspace restrictions. An empty list permits no login method. Older servers may omit this field.

model_provider class-attribute instance-attribute

model_provider: str | None = None

Exact provider selection required by managed policy.

model_providers class-attribute instance-attribute

model_providers: dict[str, Any] | None = None

Complete required provider definitions, using config.toml field names.

ConfigRequirementsReadResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigRequirementsReadResponse(CodexBaseModel):
    requirements: ConfigRequirements | None = None
    """
    Null if no requirements are configured (e.g. no requirements.toml/MDM entries).
    """
    supports_independent_speed_modes: bool | None = None
    """
    Whether Fast and Ultra Fast requirements are enforced independently. Older servers omit this field and use Fast mode as a shared speed gate.
    """

requirements class-attribute instance-attribute

requirements: ConfigRequirements | None = None

Null if no requirements are configured (e.g. no requirements.toml/MDM entries).

supports_independent_speed_modes class-attribute instance-attribute

supports_independent_speed_modes: bool | None = None

Whether Fast and Ultra Fast requirements are enforced independently. Older servers omit this field and use Fast mode as a shared speed gate.

ConfigValueWriteParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigValueWriteParams(CodexBaseModel):
    expected_version: str | None = None
    file_path: str | None = None
    """
    Path to the config file to write; defaults to the user's `config.toml` when omitted.
    """
    key_path: str
    merge_strategy: MergeStrategy
    value: Any

file_path class-attribute instance-attribute

file_path: str | None = None

Path to the config file to write; defaults to the user's config.toml when omitted.

ConfigWarningMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ConfigWarningMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["configWarning"] = "configWarning"
    params: ConfigWarningNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ConfigWarningNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigWarningNotification(CodexBaseModel):
    details: str | None = None
    """
    Optional extra guidance or error details.
    """
    path: str | None = None
    """
    Optional path to the config file that triggered the warning.
    """
    range: TextRange | None = None
    """
    Optional range for the error location inside the config file.
    """
    summary: str
    """
    Concise summary of the warning.
    """

details class-attribute instance-attribute

details: str | None = None

Optional extra guidance or error details.

path class-attribute instance-attribute

path: str | None = None

Optional path to the config file that triggered the warning.

range class-attribute instance-attribute

range: TextRange | None = None

Optional range for the error location inside the config file.

summary instance-attribute

summary: str

Concise summary of the warning.

ConfigWriteResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ConfigWriteResponse(CodexBaseModel):
    file_path: AbsolutePathBuf
    """
    Canonical path to the config file that was written.
    """
    overridden_metadata: OverriddenMetadata | None = None
    status: WriteStatus
    version: str

file_path instance-attribute

file_path: AbsolutePathBuf

Canonical path to the config file that was written.

ContextCompactedNotification

Bases: CodexBaseModel

Deprecated: Use ContextCompaction item type instead.

Source code in src/codexed/models/v2_protocol.py
class ContextCompactedNotification(CodexBaseModel):
    """Deprecated: Use `ContextCompaction` item type instead."""

    thread_id: str
    turn_id: str

CustomReviewTarget

Bases: CodexBaseModel

Arbitrary instructions, equivalent to the old free-form prompt.

Source code in src/codexed/models/v2_protocol.py
class CustomReviewTarget(CodexBaseModel):
    """Arbitrary instructions, equivalent to the old free-form prompt."""

    instructions: str
    type: Literal["custom"] = "custom"

DeprecationNoticeMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class DeprecationNoticeMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["deprecationNotice"] = "deprecationNotice"
    params: DeprecationNoticeNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

DeprecationNoticeNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class DeprecationNoticeNotification(CodexBaseModel):
    details: str | None = None
    """
    Optional extra guidance, such as migration steps or rationale.
    """
    summary: str
    """
    Concise summary of what is deprecated.
    """

details class-attribute instance-attribute

details: str | None = None

Optional extra guidance, such as migration steps or rationale.

summary instance-attribute

summary: str

Concise summary of what is deprecated.

DynamicToolCallParams

Bases: CodexBaseModel

Parameters for item/tool/call server request.

Source code in src/codexed/models/request_params.py
class DynamicToolCallParams(CodexBaseModel):
    """Parameters for item/tool/call server request."""

    thread_id: str
    turn_id: str
    call_id: str
    tool: str
    arguments: Any

DynamicToolCallResponse

Bases: CodexBaseModel

Response for item/tool/call server request.

Source code in src/codexed/models/responses.py
class DynamicToolCallResponse(CodexBaseModel):
    """Response for item/tool/call server request."""

    content_items: list[DynamicToolCallOutputContentItem]
    success: bool

ErrorMessage

Bases: CodexBaseModel

NEW NOTIFICATIONS.

Source code in src/codexed/models/v2_protocol.py
class ErrorMessage(CodexBaseModel):
    """NEW NOTIFICATIONS."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["error"] = "error"
    params: ErrorNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ExecPolicyAmendment

Bases: CodexBaseModel

Proposed execpolicy amendment (prefix rule).

Source code in src/codexed/models/misc.py
class ExecPolicyAmendment(CodexBaseModel):
    """Proposed execpolicy amendment (prefix rule)."""

    command: list[str]

ExperimentalFeature

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExperimentalFeature(CodexBaseModel):
    announcement: str | None = None
    """
    Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.
    """
    default_enabled: bool
    """
    Whether this feature is enabled by default.
    """
    description: str | None = None
    """
    Short summary describing what the feature does. Null when this feature is not in beta.
    """
    display_name: str | None = None
    """
    User-facing display name shown in the experimental features UI. Null when this feature is not in beta.
    """
    enabled: bool
    """
    Whether this feature is currently enabled in the loaded config.
    """
    name: str
    """
    Stable key used in config.toml and CLI flag toggles.
    """
    stage: ExperimentalFeatureStage
    """
    Lifecycle stage of this feature flag.
    """

announcement class-attribute instance-attribute

announcement: str | None = None

Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.

default_enabled instance-attribute

default_enabled: bool

Whether this feature is enabled by default.

description class-attribute instance-attribute

description: str | None = None

Short summary describing what the feature does. Null when this feature is not in beta.

display_name class-attribute instance-attribute

display_name: str | None = None

User-facing display name shown in the experimental features UI. Null when this feature is not in beta.

enabled instance-attribute

enabled: bool

Whether this feature is currently enabled in the loaded config.

name instance-attribute

name: str

Stable key used in config.toml and CLI flag toggles.

stage instance-attribute

stage: ExperimentalFeatureStage

Lifecycle stage of this feature flag.

ExperimentalFeatureListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExperimentalFeatureListParams(CodexBaseModel):
    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to a reasonable server-side value.
    """
    thread_id: str | None = None
    """
    Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.
    """

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to a reasonable server-side value.

thread_id class-attribute instance-attribute

thread_id: str | None = None

Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.

ExperimentalFeatureListResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExperimentalFeatureListResponse(CodexBaseModel):
    data: list[ExperimentalFeature]
    next_cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.
    """

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.

ExternalAgentConfigDetectParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExternalAgentConfigDetectParams(CodexBaseModel):
    cwds: list[str] | None = None
    """
    Zero or more working directories to include for repo-scoped detection.
    """
    include_home: bool | None = None
    """
    If true, include detection under the user's home directory.
    """
    max_session_age_days: int | None = Field(None, ge=0)
    """
    Maximum age in days for detected sessions. Missing values use the default limit.
    """
    max_sessions: int | None = Field(None, ge=0)
    """
    Maximum number of sessions to detect. Missing values use the default limit.
    """
    migration_source: str | None = None
    """
    Optional migration-source selector. Missing or unrecognized values use the default source.
    """
    source: str | None = None
    """
    Deprecated field retained for compatibility. This field is ignored; use `migrationSource` to select the migration source.
    """

cwds class-attribute instance-attribute

cwds: list[str] | None = None

Zero or more working directories to include for repo-scoped detection.

include_home class-attribute instance-attribute

include_home: bool | None = None

If true, include detection under the user's home directory.

max_session_age_days class-attribute instance-attribute

max_session_age_days: int | None = Field(None, ge=0)

Maximum age in days for detected sessions. Missing values use the default limit.

max_sessions class-attribute instance-attribute

max_sessions: int | None = Field(None, ge=0)

Maximum number of sessions to detect. Missing values use the default limit.

migration_source class-attribute instance-attribute

migration_source: str | None = None

Optional migration-source selector. Missing or unrecognized values use the default source.

source class-attribute instance-attribute

source: str | None = None

Deprecated field retained for compatibility. This field is ignored; use migrationSource to select the migration source.

ExternalAgentConfigImportParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExternalAgentConfigImportParams(CodexBaseModel):
    migration_items: list[ExternalAgentConfigMigrationItem]
    migration_source: str | None = None
    """
    Migration-source selector used to produce the migration items. Pass the same value to detection and import; missing or unrecognized values use the default source.
    """
    provider_id: str | None = None
    """
    Opaque provider identifier supplied by the caller for analytics attribution and import history display. This does not select the migration source.
    """
    source: str | None = None
    """
    Optional identifier for the product that initiated the import.
    """

migration_source class-attribute instance-attribute

migration_source: str | None = None

Migration-source selector used to produce the migration items. Pass the same value to detection and import; missing or unrecognized values use the default source.

provider_id class-attribute instance-attribute

provider_id: str | None = None

Opaque provider identifier supplied by the caller for analytics attribution and import history display. This does not select the migration source.

source class-attribute instance-attribute

source: str | None = None

Optional identifier for the product that initiated the import.

ExternalAgentConfigMigrationItem

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ExternalAgentConfigMigrationItem(CodexBaseModel):
    cwd: str | None = None
    """
    Null or empty means home-scoped migration; non-empty means repo-scoped migration.
    """
    description: str
    details: MigrationDetails | None = None
    item_type: ExternalAgentConfigMigrationItemType

cwd class-attribute instance-attribute

cwd: str | None = None

Null or empty means home-scoped migration; non-empty means repo-scoped migration.

FeedbackUploadResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class FeedbackUploadResponse(CodexBaseModel):
    prompt_hash: str | None = None
    """
    Whitespace-normalized SHA-256 of the session base instructions, matching the uploaded `prompt_hash` tag. Does not include later developer messages. Null when the reported rollout has no prompt metadata.
    """
    thread_id: str

prompt_hash class-attribute instance-attribute

prompt_hash: str | None = None

Whitespace-normalized SHA-256 of the session base instructions, matching the uploaded prompt_hash tag. Does not include later developer messages. Null when the reported rollout has no prompt metadata.

FileChangeOutputDeltaNotification

Bases: CodexBaseModel

Deprecated legacy notification for apply_patch textual output.

The server no longer emits this notification.

Source code in src/codexed/models/v2_protocol.py
class FileChangeOutputDeltaNotification(CodexBaseModel):
    """Deprecated legacy notification for `apply_patch` textual output.

    The server no longer emits this notification.
    """

    delta: str
    item_id: str
    thread_id: str
    turn_id: str

FileChangeRequestApprovalParams

Bases: CodexBaseModel

Parameters for item/fileChange/requestApproval server request.

Source code in src/codexed/models/request_params.py
class FileChangeRequestApprovalParams(CodexBaseModel):
    """Parameters for item/fileChange/requestApproval server request."""

    thread_id: str
    turn_id: str
    item_id: str
    reason: str | None = None
    grant_root: str | None = None

FileChangeRequestApprovalResponse

Bases: CodexBaseModel

Response for item/fileChange/requestApproval server request.

Source code in src/codexed/models/responses.py
class FileChangeRequestApprovalResponse(CodexBaseModel):
    """Response for item/fileChange/requestApproval server request."""

    decision: ApprovalDecision

FsChangedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class FsChangedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["fs/changed"] = "fs/changed"
    params: FsChangedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

FsChangedNotification

Bases: CodexBaseModel

Filesystem watch notification emitted for fs/watch subscribers.

Source code in src/codexed/models/v2_protocol.py
class FsChangedNotification(CodexBaseModel):
    """Filesystem watch notification emitted for `fs/watch` subscribers."""

    changed_paths: list[AbsolutePathBuf]
    """
    File or directory paths associated with this event.
    """
    watch_id: str
    """
    Watch identifier previously provided to `fs/watch`.
    """

changed_paths instance-attribute

changed_paths: list[AbsolutePathBuf]

File or directory paths associated with this event.

watch_id instance-attribute

watch_id: str

Watch identifier previously provided to fs/watch.

FsCopyParams

Bases: CodexBaseModel

Copy a file or directory tree on the host filesystem.

Source code in src/codexed/models/v2_protocol.py
class FsCopyParams(CodexBaseModel):
    """Copy a file or directory tree on the host filesystem."""

    destination_path: AbsolutePathBuf
    """
    Absolute destination path.
    """
    recursive: bool | None = None
    """
    Required for directory copies; ignored for file copies.
    """
    source_path: AbsolutePathBuf
    """
    Absolute source path.
    """

destination_path instance-attribute

destination_path: AbsolutePathBuf

Absolute destination path.

recursive class-attribute instance-attribute

recursive: bool | None = None

Required for directory copies; ignored for file copies.

source_path instance-attribute

source_path: AbsolutePathBuf

Absolute source path.

FsCopyResponse

Bases: CodexBaseModel

Successful response for fs/copy.

Source code in src/codexed/models/v2_protocol.py
class FsCopyResponse(CodexBaseModel):
    """Successful response for `fs/copy`."""

FsCreateDirectoryParams

Bases: CodexBaseModel

Create a directory on the host filesystem.

Source code in src/codexed/models/v2_protocol.py
class FsCreateDirectoryParams(CodexBaseModel):
    """Create a directory on the host filesystem."""

    path: AbsolutePathBuf
    """
    Absolute directory path to create.
    """
    recursive: bool | None = None
    """
    Whether parent directories should also be created. Defaults to `true`.
    """

path instance-attribute

Absolute directory path to create.

recursive class-attribute instance-attribute

recursive: bool | None = None

Whether parent directories should also be created. Defaults to true.

FsCreateDirectoryResponse

Bases: CodexBaseModel

Successful response for fs/createDirectory.

Source code in src/codexed/models/v2_protocol.py
class FsCreateDirectoryResponse(CodexBaseModel):
    """Successful response for `fs/createDirectory`."""

FsGetMetadataParams

Bases: CodexBaseModel

Request metadata for an absolute path.

Source code in src/codexed/models/v2_protocol.py
class FsGetMetadataParams(CodexBaseModel):
    """Request metadata for an absolute path."""

    path: AbsolutePathBuf
    """
    Absolute path to inspect.
    """

path instance-attribute

Absolute path to inspect.

FsGetMetadataResponse

Bases: CodexBaseModel

Metadata returned by fs/getMetadata.

Source code in src/codexed/models/v2_protocol.py
class FsGetMetadataResponse(CodexBaseModel):
    """Metadata returned by `fs/getMetadata`."""

    created_at_ms: int
    """
    File creation time in Unix milliseconds when available, otherwise `0`.
    """
    is_directory: bool
    """
    Whether the path resolves to a directory.
    """
    is_file: bool
    """
    Whether the path resolves to a regular file.
    """
    is_symlink: bool
    """
    Whether the path itself is a symbolic link.
    """
    modified_at_ms: int
    """
    File modification time in Unix milliseconds when available, otherwise `0`.
    """

created_at_ms instance-attribute

created_at_ms: int

File creation time in Unix milliseconds when available, otherwise 0.

is_directory instance-attribute

is_directory: bool

Whether the path resolves to a directory.

is_file instance-attribute

is_file: bool

Whether the path resolves to a regular file.

is_symlink: bool

Whether the path itself is a symbolic link.

modified_at_ms instance-attribute

modified_at_ms: int

File modification time in Unix milliseconds when available, otherwise 0.

FsReadDirectoryEntry

Bases: CodexBaseModel

A directory entry returned by fs/readDirectory.

Source code in src/codexed/models/v2_protocol.py
class FsReadDirectoryEntry(CodexBaseModel):
    """A directory entry returned by `fs/readDirectory`."""

    file_name: str
    """
    Direct child entry name only, not an absolute or relative path.
    """
    is_directory: bool
    """
    Whether this entry resolves to a directory.
    """
    is_file: bool
    """
    Whether this entry resolves to a regular file.
    """

file_name instance-attribute

file_name: str

Direct child entry name only, not an absolute or relative path.

is_directory instance-attribute

is_directory: bool

Whether this entry resolves to a directory.

is_file instance-attribute

is_file: bool

Whether this entry resolves to a regular file.

FsReadDirectoryParams

Bases: CodexBaseModel

List direct child names for a directory.

Source code in src/codexed/models/v2_protocol.py
class FsReadDirectoryParams(CodexBaseModel):
    """List direct child names for a directory."""

    path: AbsolutePathBuf
    """
    Absolute directory path to read.
    """

path instance-attribute

Absolute directory path to read.

FsReadDirectoryResponse

Bases: CodexBaseModel

Directory entries returned by fs/readDirectory.

Source code in src/codexed/models/v2_protocol.py
class FsReadDirectoryResponse(CodexBaseModel):
    """Directory entries returned by `fs/readDirectory`."""

    entries: list[FsReadDirectoryEntry]
    """
    Direct child entries in the requested directory.
    """

entries instance-attribute

entries: list[FsReadDirectoryEntry]

Direct child entries in the requested directory.

FsReadFileParams

Bases: CodexBaseModel

Read a file from the host filesystem.

Source code in src/codexed/models/v2_protocol.py
class FsReadFileParams(CodexBaseModel):
    """Read a file from the host filesystem."""

    path: AbsolutePathBuf
    """
    Absolute path to read.
    """

path instance-attribute

Absolute path to read.

FsReadFileResponse

Bases: CodexBaseModel

Base64-encoded file contents returned by fs/readFile.

Source code in src/codexed/models/v2_protocol.py
class FsReadFileResponse(CodexBaseModel):
    """Base64-encoded file contents returned by `fs/readFile`."""

    data_base64: str
    """
    File contents encoded as base64.
    """

data_base64 instance-attribute

data_base64: str

File contents encoded as base64.

FsRemoveParams

Bases: CodexBaseModel

Remove a file or directory tree from the host filesystem.

Source code in src/codexed/models/v2_protocol.py
class FsRemoveParams(CodexBaseModel):
    """Remove a file or directory tree from the host filesystem."""

    force: bool | None = None
    """
    Whether missing paths should be ignored. Defaults to `true`.
    """
    path: AbsolutePathBuf
    """
    Absolute path to remove.
    """
    recursive: bool | None = None
    """
    Whether directory removal should recurse. Defaults to `true`.
    """

force class-attribute instance-attribute

force: bool | None = None

Whether missing paths should be ignored. Defaults to true.

path instance-attribute

Absolute path to remove.

recursive class-attribute instance-attribute

recursive: bool | None = None

Whether directory removal should recurse. Defaults to true.

FsRemoveResponse

Bases: CodexBaseModel

Successful response for fs/remove.

Source code in src/codexed/models/v2_protocol.py
class FsRemoveResponse(CodexBaseModel):
    """Successful response for `fs/remove`."""

FsUnwatchParams

Bases: CodexBaseModel

Stop filesystem watch notifications for a prior fs/watch.

Source code in src/codexed/models/v2_protocol.py
class FsUnwatchParams(CodexBaseModel):
    """Stop filesystem watch notifications for a prior `fs/watch`."""

    watch_id: str
    """
    Watch identifier previously provided to `fs/watch`.
    """

watch_id instance-attribute

watch_id: str

Watch identifier previously provided to fs/watch.

FsUnwatchResponse

Bases: CodexBaseModel

Successful response for fs/unwatch.

Source code in src/codexed/models/v2_protocol.py
class FsUnwatchResponse(CodexBaseModel):
    """Successful response for `fs/unwatch`."""

FsWatchParams

Bases: CodexBaseModel

Start filesystem watch notifications for an absolute path.

Source code in src/codexed/models/v2_protocol.py
class FsWatchParams(CodexBaseModel):
    """Start filesystem watch notifications for an absolute path."""

    path: AbsolutePathBuf
    """
    Absolute file or directory path to watch.
    """
    watch_id: str
    """
    Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.
    """

path instance-attribute

Absolute file or directory path to watch.

watch_id instance-attribute

watch_id: str

Connection-scoped watch identifier used for fs/unwatch and fs/changed.

FsWatchResponse

Bases: CodexBaseModel

Successful response for fs/watch.

Source code in src/codexed/models/v2_protocol.py
class FsWatchResponse(CodexBaseModel):
    """Successful response for `fs/watch`."""

    path: AbsolutePathBuf
    """
    Canonicalized path associated with the watch.
    """

path instance-attribute

Canonicalized path associated with the watch.

FsWriteFileParams

Bases: CodexBaseModel

Write a file on the host filesystem.

Source code in src/codexed/models/v2_protocol.py
class FsWriteFileParams(CodexBaseModel):
    """Write a file on the host filesystem."""

    data_base64: str
    """
    File contents encoded as base64.
    """
    path: AbsolutePathBuf
    """
    Absolute path to write.
    """

data_base64 instance-attribute

data_base64: str

File contents encoded as base64.

path instance-attribute

Absolute path to write.

FsWriteFileResponse

Bases: CodexBaseModel

Successful response for fs/writeFile.

Source code in src/codexed/models/v2_protocol.py
class FsWriteFileResponse(CodexBaseModel):
    """Successful response for `fs/writeFile`."""

FuzzyFileSearchResult

Bases: CodexBaseModel

Superset of [codex_file_search::FileMatch].

Source code in src/codexed/models/v2_protocol.py
class FuzzyFileSearchResult(CodexBaseModel):
    """Superset of [`codex_file_search::FileMatch`]."""

    file_name: str
    indices: list[Indice] | None = None
    match_type: FuzzyFileSearchMatchType
    path: str
    root: str
    score: int = Field(..., ge=0)

FuzzyFileSearchSessionCompletedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class FuzzyFileSearchSessionCompletedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["fuzzyFileSearch/sessionCompleted"] = "fuzzyFileSearch/sessionCompleted"
    params: FuzzyFileSearchSessionCompletedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

FuzzyFileSearchSessionUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class FuzzyFileSearchSessionUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["fuzzyFileSearch/sessionUpdated"] = "fuzzyFileSearch/sessionUpdated"
    params: FuzzyFileSearchSessionUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

GetAccountParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class GetAccountParams(CodexBaseModel):
    refresh_token: bool | None = None
    """
    When `true`, requests a proactive token refresh before returning.

    In managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.
    """

refresh_token class-attribute instance-attribute

refresh_token: bool | None = None

When true, requests a proactive token refresh before returning.

In managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call account/login/start with chatgptAuthTokens.

GetAccountRateLimitsResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class GetAccountRateLimitsResponse(CodexBaseModel):
    account_id: str | None = None
    """
    Account associated with this usage snapshot, when supplied by the backend.
    """
    ordinary_usage_allowed: bool | None = None
    """
    Backend permission for ordinary included usage, validated against the active account. Null means unavailable; clients must not infer recovery from percentages or reset times.
    """
    rate_limit_reset_credits: RateLimitResetCreditsSummary | None = None
    rate_limit_upsell: Any | None = None
    """
    Optional backend-owned banner from the same usage read. Its nested keys retain the backend's snake_case contract; an absent banner leaves the client's existing UI unchanged.
    """
    rate_limits: RateLimitSnapshot
    """
    Backward-compatible single-bucket view; mirrors the historical payload.
    """
    rate_limits_by_limit_id: dict[str, Any] | None = None
    """
    Multi-bucket view keyed by metered `limit_id` (for example, `codex`).
    """

account_id class-attribute instance-attribute

account_id: str | None = None

Account associated with this usage snapshot, when supplied by the backend.

ordinary_usage_allowed class-attribute instance-attribute

ordinary_usage_allowed: bool | None = None

Backend permission for ordinary included usage, validated against the active account. Null means unavailable; clients must not infer recovery from percentages or reset times.

rate_limit_upsell class-attribute instance-attribute

rate_limit_upsell: Any | None = None

Optional backend-owned banner from the same usage read. Its nested keys retain the backend's snake_case contract; an absent banner leaves the client's existing UI unchanged.

rate_limits instance-attribute

rate_limits: RateLimitSnapshot

Backward-compatible single-bucket view; mirrors the historical payload.

rate_limits_by_limit_id class-attribute instance-attribute

rate_limits_by_limit_id: dict[str, Any] | None = None

Multi-bucket view keyed by metered limit_id (for example, codex).

GetAccountResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class GetAccountResponse(CodexBaseModel):
    account: Account | None = None
    requires_openai_auth: bool
    user_id: str | None = None
    """
    ChatGPT user ID belonging to this account response, when available.
    """
    workspace_routing: WorkspaceRouting | None = None

user_id class-attribute instance-attribute

user_id: str | None = None

ChatGPT user ID belonging to this account response, when available.

GrepFilesToolConfig

Bases: _ToolConfigBase

Configuration for the grep_files tool (experimental).

Source code in src/codexed/models/tool_config.py
class GrepFilesToolConfig(_ToolConfigBase):
    """Configuration for the grep_files tool (experimental)."""

    type: Literal["grep_files"] = "grep_files"

HookCompletedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class HookCompletedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["hook/completed"] = "hook/completed"
    params: HookCompletedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

HookStartedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class HookStartedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["hook/started"] = "hook/started"
    params: HookStartedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

HttpMcpServer

Bases: BaseModel

MCP server accessible via HTTP/SSE transport.

Source code in src/codexed/models/mcp_server.py
class HttpMcpServer(BaseModel):
    """MCP server accessible via HTTP/SSE transport."""

    url: str
    bearer_token_env_var: str | None = None
    http_headers: dict[str, str] | None = None
    enabled: bool = True
    default_tools_approval_mode: ToolApprovalMode | None = None
    """When Codex asks before calling this server's tools (Codex's default: ``auto``)."""

    def to_config_toml(self, name: str) -> str:
        parts = [f'url = "{self.url}"']
        if self.bearer_token_env_var:
            parts.append(f'bearer_token_env_var = "{self.bearer_token_env_var}"')
        if self.http_headers:
            # headers as inline table
            headers_items = ", ".join(f'{k} = "{v}"' for k, v in self.http_headers.items())
            parts.append(f"http_headers = {{{headers_items}}}")
        if not self.enabled:
            parts.append("enabled = false")
        if self.default_tools_approval_mode:
            parts.append(f'default_tools_approval_mode = "{self.default_tools_approval_mode}"')
        return f"mcp_servers.{name}={{{', '.join(parts)}}}"

default_tools_approval_mode class-attribute instance-attribute

default_tools_approval_mode: ToolApprovalMode | None = None

When Codex asks before calling this server's tools (Codex's default: auto).

ImageGenerationToolConfig

Bases: _ToolConfigBase

Configuration for the image_generation tool.

Source code in src/codexed/models/tool_config.py
class ImageGenerationToolConfig(_ToolConfigBase):
    """Configuration for the image_generation tool."""

    type: Literal["image_generation"] = "image_generation"

InitializeCapabilities

Bases: CodexBaseModel

Client-declared capabilities negotiated during initialize.

Source code in src/codexed/models/v2_protocol.py
class InitializeCapabilities(CodexBaseModel):
    """Client-declared capabilities negotiated during initialize."""

    experimental_api: bool | None = False
    """
    Opt into receiving experimental API methods and fields.
    """
    explicit_gateway_oauth: bool | None = None
    """
    Use explicit gateway OAuth login instead of automatic browser authorization. Applies to this app-server's gateway runtime; later connections cannot undo it.
    """
    extensions: dict[str, Any] | None = None
    """
    MCP extension settings declared by the app-server client.
    """
    mcp_server_openai_form_elicitation: bool | None = None
    """
    Legacy opt-in for the `openai/form` MCP extension.

    New clients should declare `openai/form` in [`Self::extensions`].
    """
    opt_out_notification_methods: list[str] | None = None
    """
    Exact notification method names that should be suppressed for this connection (for example `thread/started`).
    """
    request_attestation: bool | None = False
    """
    Opt into `attestation/generate` requests for upstream `x-oai-attestation`.
    """
    required_human_approval: bool | None = None
    """
    Present `humanCommand` approvals to a person and return only a one-time decision. Requires `experimentalApi`. Pending requests can be replayed to compatible clients.
    """

experimental_api class-attribute instance-attribute

experimental_api: bool | None = False

Opt into receiving experimental API methods and fields.

explicit_gateway_oauth class-attribute instance-attribute

explicit_gateway_oauth: bool | None = None

Use explicit gateway OAuth login instead of automatic browser authorization. Applies to this app-server's gateway runtime; later connections cannot undo it.

extensions class-attribute instance-attribute

extensions: dict[str, Any] | None = None

MCP extension settings declared by the app-server client.

mcp_server_openai_form_elicitation class-attribute instance-attribute

mcp_server_openai_form_elicitation: bool | None = None

Legacy opt-in for the openai/form MCP extension.

New clients should declare openai/form in [Self::extensions].

opt_out_notification_methods class-attribute instance-attribute

opt_out_notification_methods: list[str] | None = None

Exact notification method names that should be suppressed for this connection (for example thread/started).

request_attestation class-attribute instance-attribute

request_attestation: bool | None = False

Opt into attestation/generate requests for upstream x-oai-attestation.

required_human_approval class-attribute instance-attribute

required_human_approval: bool | None = None

Present humanCommand approvals to a person and return only a one-time decision. Requires experimentalApi. Pending requests can be replayed to compatible clients.

ItemAgentMessageDeltaNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemAgentMessageDeltaNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/agentMessage/delta"] = "item/agentMessage/delta"
    params: AgentMessageDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemCommandExecutionOutputDeltaNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemCommandExecutionOutputDeltaNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/commandExecution/outputDelta"] = "item/commandExecution/outputDelta"
    params: CommandExecutionOutputDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemCommandExecutionTerminalInteractionNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemCommandExecutionTerminalInteractionNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/commandExecution/terminalInteraction"] = "item/commandExecution/terminalInteraction"
    params: TerminalInteractionNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemCompletedData

Bases: CodexBaseModel

Payload for item/completed notification (V2 protocol).

Source code in src/codexed/models/event_data.py
class ItemCompletedData(CodexBaseModel):
    """Payload for item/completed notification (V2 protocol)."""

    thread_id: str
    turn_id: str
    item: ThreadItem
    completed_at_ms: int
    """Unix timestamp (in milliseconds) when this item lifecycle completed."""
    content_token_count: int | None = Field(default=None, ge=0)
    """Token count of the item's content, if known."""

completed_at_ms instance-attribute

completed_at_ms: int

Unix timestamp (in milliseconds) when this item lifecycle completed.

content_token_count class-attribute instance-attribute

content_token_count: int | None = Field(default=None, ge=0)

Token count of the item's content, if known.

ItemCompletedEvent

Bases: CodexBaseModel

Item completed event.

Source code in src/codexed/models/events.py
class ItemCompletedEvent(CodexBaseModel):
    """Item completed event."""

    method: Literal["item/completed"] = "item/completed"
    params: ItemCompletedData

ItemFileChangeOutputDeltaNotification

Bases: CodexBaseModel

Deprecated legacy apply_patch output stream notification.

Source code in src/codexed/models/v2_protocol.py
class ItemFileChangeOutputDeltaNotification(CodexBaseModel):
    """Deprecated legacy apply_patch output stream notification."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/fileChange/outputDelta"] = "item/fileChange/outputDelta"
    params: FileChangeOutputDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemMcpToolCallProgressNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemMcpToolCallProgressNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/mcpToolCall/progress"] = "item/mcpToolCall/progress"
    params: McpToolCallProgressNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemPlanDeltaNotification

Bases: CodexBaseModel

EXPERIMENTAL - proposed plan streaming deltas for plan items.

Source code in src/codexed/models/v2_protocol.py
class ItemPlanDeltaNotification(CodexBaseModel):
    """EXPERIMENTAL - proposed plan streaming deltas for plan items."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/plan/delta"] = "item/plan/delta"
    params: PlanDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemReasoningSummaryPartAddedNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemReasoningSummaryPartAddedNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/reasoning/summaryPartAdded"] = "item/reasoning/summaryPartAdded"
    params: ReasoningSummaryPartAddedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemReasoningSummaryTextDeltaNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemReasoningSummaryTextDeltaNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/reasoning/summaryTextDelta"] = "item/reasoning/summaryTextDelta"
    params: ReasoningSummaryTextDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemReasoningTextDeltaNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ItemReasoningTextDeltaNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["item/reasoning/textDelta"] = "item/reasoning/textDelta"
    params: ReasoningTextDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ItemStartedData

Bases: CodexBaseModel

Payload for item/started notification (V2 protocol).

Source code in src/codexed/models/event_data.py
class ItemStartedData(CodexBaseModel):
    """Payload for item/started notification (V2 protocol)."""

    thread_id: str
    turn_id: str
    item: ThreadItem
    started_at_ms: int
    """Unix timestamp (in milliseconds) when this item lifecycle started."""

started_at_ms instance-attribute

started_at_ms: int

Unix timestamp (in milliseconds) when this item lifecycle started.

ItemStartedEvent

Bases: CodexBaseModel

Item started event.

Source code in src/codexed/models/events.py
class ItemStartedEvent(CodexBaseModel):
    """Item started event."""

    method: Literal["item/started"] = "item/started"
    params: ItemStartedData

JsReplToolConfig

Bases: _ToolConfigBase

Configuration for the js_repl / js_repl_reset tools.

Source code in src/codexed/models/tool_config.py
class JsReplToolConfig(_ToolConfigBase):
    """Configuration for the js_repl / js_repl_reset tools."""

    type: Literal["js_repl"] = "js_repl"

JsonRpcError

Bases: CodexBaseModel

JSON-RPC 2.0 error object.

Source code in src/codexed/models/base.py
class JsonRpcError(CodexBaseModel):
    """JSON-RPC 2.0 error object."""

    code: int
    message: str
    data: Any = None

JsonRpcNotification

Bases: CodexBaseModel

JSON-RPC 2.0 notification message (no id).

Source code in src/codexed/models/base.py
class JsonRpcNotification(CodexBaseModel):
    """JSON-RPC 2.0 notification message (no id)."""

    jsonrpc: Literal["2.0"] = "2.0"
    method: str
    params: dict[str, Any] | None = None  # Event-specific params

JsonRpcRequest

Bases: CodexBaseModel

JSON-RPC 2.0 request message.

Source code in src/codexed/models/base.py
class JsonRpcRequest(CodexBaseModel):
    """JSON-RPC 2.0 request message."""

    jsonrpc: Literal["2.0"] = "2.0"
    id: int
    method: str
    params: dict[str, Any] = Field(default_factory=dict)  # Method-specific params

JsonRpcResponse

Bases: CodexBaseModel

JSON-RPC 2.0 response message.

Source code in src/codexed/models/base.py
class JsonRpcResponse(CodexBaseModel):
    """JSON-RPC 2.0 response message."""

    jsonrpc: Literal["2.0"] = "2.0"
    id: int
    result: Any = None
    error: JsonRpcError | None = None

ListDirToolConfig

Bases: _ToolConfigBase

Configuration for the list_dir tool (experimental).

Source code in src/codexed/models/tool_config.py
class ListDirToolConfig(_ToolConfigBase):
    """Configuration for the list_dir tool (experimental)."""

    type: Literal["list_dir"] = "list_dir"

ListMcpServerStatusParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ListMcpServerStatusParams(CodexBaseModel):
    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    detail: McpServerStatusDetail | None = None
    """
    Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.
    """
    environment_id: str | None = None
    """
    Select this environment's registration. Requires `serverName` and `threadId`. When omitted, a named request uses the same server as older clients.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to a server-defined value.
    """
    server_name: str | None = None
    """
    Limit discovery to one server. With a thread ID, reuse that thread's MCP connection.
    """
    thread_id: str | None = None

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

detail class-attribute instance-attribute

detail: McpServerStatusDetail | None = None

Controls how much MCP inventory data to fetch for each server. Defaults to Full when omitted.

environment_id class-attribute instance-attribute

environment_id: str | None = None

Select this environment's registration. Requires serverName and threadId. When omitted, a named request uses the same server as older clients.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to a server-defined value.

server_name class-attribute instance-attribute

server_name: str | None = None

Limit discovery to one server. With a thread ID, reuse that thread's MCP connection.

ListMcpServerStatusResponse

Bases: CodexBaseModel

Response for mcpServerStatus/list request.

Source code in src/codexed/models/responses.py
class ListMcpServerStatusResponse(CodexBaseModel):
    """Response for mcpServerStatus/list request."""

    data: list[McpServerStatusEntry]
    next_cursor: str | None = None

LocalShellCallResponseItem

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class LocalShellCallResponseItem(CodexBaseModel):
    action: LocalShellAction
    call_id: str | None = None
    """
    Set when using the Responses API.
    """
    encrypted_content: str | None = None
    id: str | None = None
    """
    Legacy id field retained for compatibility with older payloads.
    """
    internal_chat_message_metadata_passthrough: InternalChatMessageMetadataPassthrough | None = None
    status: LocalShellStatus
    type: Literal["local_shell_call"] = "local_shell_call"

call_id class-attribute instance-attribute

call_id: str | None = None

Set when using the Responses API.

id class-attribute instance-attribute

id: str | None = None

Legacy id field retained for compatibility with older payloads.

McpElicitationFormParams

Bases: _McpElicitationBase

Form-mode MCP elicitation request.

Source code in src/codexed/models/request_params.py
class McpElicitationFormParams(_McpElicitationBase):
    """Form-mode MCP elicitation request."""

    mode: Literal["form"] = "form"
    requested_schema: dict[str, Any]

    def to_mcp(self) -> ElicitRequestFormParams:
        from mcp.types import ElicitRequestFormParams

        return ElicitRequestFormParams(
            message=self.message,
            requested_schema=self.requested_schema,
            meta=_to_mcp_meta(self.meta),
        )

    @classmethod
    def from_mcp(
        cls,
        params: ElicitRequestFormParams,
        thread_id: str,
        server_name: str,
        turn_id: str | None = None,
    ) -> McpElicitationFormParams:
        """Create from MCP ElicitRequestFormParams."""
        return cls(
            message=params.message,
            requested_schema=dict(params.requested_schema),
            meta=_from_mcp_meta(params.meta),
            thread_id=thread_id,
            server_name=server_name,
            turn_id=turn_id,
        )

from_mcp classmethod

from_mcp(
    params: ElicitRequestFormParams, thread_id: str, server_name: str, turn_id: str | None = None
) -> McpElicitationFormParams

Create from MCP ElicitRequestFormParams.

Source code in src/codexed/models/request_params.py
@classmethod
def from_mcp(
    cls,
    params: ElicitRequestFormParams,
    thread_id: str,
    server_name: str,
    turn_id: str | None = None,
) -> McpElicitationFormParams:
    """Create from MCP ElicitRequestFormParams."""
    return cls(
        message=params.message,
        requested_schema=dict(params.requested_schema),
        meta=_from_mcp_meta(params.meta),
        thread_id=thread_id,
        server_name=server_name,
        turn_id=turn_id,
    )

McpElicitationUrlParams

Bases: _McpElicitationBase

URL-mode MCP elicitation request (browser-based auth).

Source code in src/codexed/models/request_params.py
class McpElicitationUrlParams(_McpElicitationBase):
    """URL-mode MCP elicitation request (browser-based auth)."""

    mode: Literal["url"] = "url"
    url: str
    elicitation_id: str

    def to_mcp(self) -> ElicitRequestURLParams:
        from mcp.types import ElicitRequestURLParams

        return ElicitRequestURLParams(
            message=self.message,
            url=self.url,
            elicitation_id=self.elicitation_id,
            meta=_to_mcp_meta(self.meta),
        )

    @classmethod
    def from_mcp(
        cls,
        params: ElicitRequestURLParams,
        thread_id: str,
        server_name: str,
        turn_id: str | None = None,
    ) -> McpElicitationUrlParams:
        """Create from MCP ElicitRequestURLParams.

        Raises:
            ValueError: If the MCP request carries no elicitation ID, which the
                app-server protocol requires to correlate the response
        """
        if params.elicitation_id is None:
            msg = "URL elicitation request without elicitation_id cannot be forwarded"
            raise ValueError(msg)
        return cls(
            message=params.message,
            url=params.url,
            elicitation_id=params.elicitation_id,
            meta=_from_mcp_meta(params.meta),
            thread_id=thread_id,
            server_name=server_name,
            turn_id=turn_id,
        )

from_mcp classmethod

from_mcp(
    params: ElicitRequestURLParams, thread_id: str, server_name: str, turn_id: str | None = None
) -> McpElicitationUrlParams

Create from MCP ElicitRequestURLParams.

Raises:

Type Description
ValueError

If the MCP request carries no elicitation ID, which the app-server protocol requires to correlate the response

Source code in src/codexed/models/request_params.py
@classmethod
def from_mcp(
    cls,
    params: ElicitRequestURLParams,
    thread_id: str,
    server_name: str,
    turn_id: str | None = None,
) -> McpElicitationUrlParams:
    """Create from MCP ElicitRequestURLParams.

    Raises:
        ValueError: If the MCP request carries no elicitation ID, which the
            app-server protocol requires to correlate the response
    """
    if params.elicitation_id is None:
        msg = "URL elicitation request without elicitation_id cannot be forwarded"
        raise ValueError(msg)
    return cls(
        message=params.message,
        url=params.url,
        elicitation_id=params.elicitation_id,
        meta=_from_mcp_meta(params.meta),
        thread_id=thread_id,
        server_name=server_name,
        turn_id=turn_id,
    )

McpResourceReadParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpResourceReadParams(CodexBaseModel):
    field_meta: dict[str, Any] | None = None
    """
    Additional MCP request metadata. Account and turn routing keys are reserved.
    """
    connector_id: str | None = None
    environment_id: str | None = None
    """
    Exact registration scope; omission preserves legacy name-only selection.
    """
    origin_call_id: str | None = None
    """
    Originating MCP tool call used to select the resource's app.
    """
    server: str
    target: McpResourceReadTarget | None = None
    """
    Explicit hosted app/account. Omit to retain legacy resource discovery.
    """
    thread_id: str | None = None
    uri: str

environment_id class-attribute instance-attribute

environment_id: str | None = None

Exact registration scope; omission preserves legacy name-only selection.

field_meta class-attribute instance-attribute

field_meta: dict[str, Any] | None = None

Additional MCP request metadata. Account and turn routing keys are reserved.

origin_call_id class-attribute instance-attribute

origin_call_id: str | None = None

Originating MCP tool call used to select the resource's app.

target class-attribute instance-attribute

target: McpResourceReadTarget | None = None

Explicit hosted app/account. Omit to retain legacy resource discovery.

McpResourceReadResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpResourceReadResponse(CodexBaseModel):
    contents: list[ResourceContent]
    origin_call_id: str | None = None
    """
    Originating call when the server applied app-specific resource scoping.
    """

origin_call_id class-attribute instance-attribute

origin_call_id: str | None = None

Originating call when the server applied app-specific resource scoping.

McpResourceToolsConfig

Bases: _ToolConfigBase

Configuration for MCP resource browsing tools.

Controls list_mcp_resources, list_mcp_resource_templates, and read_mcp_resource.

Source code in src/codexed/models/tool_config.py
class McpResourceToolsConfig(_ToolConfigBase):
    """Configuration for MCP resource browsing tools.

    Controls ``list_mcp_resources``, ``list_mcp_resource_templates``,
    and ``read_mcp_resource``.
    """

    type: Literal["mcp_resources"] = "mcp_resources"

McpServerElicitationResponse

Bases: CodexBaseModel

Response for mcpServer/elicitation/request server request.

Source code in src/codexed/models/responses.py
class McpServerElicitationResponse(CodexBaseModel):
    """Response for mcpServer/elicitation/request server request."""

    action: ElicitationAction
    content: Any | None = None
    meta: Any | None = None
    """Optional metadata to include in the response.

    For MCP tool approval responses, this can contain:

    - ``persist`` (str): ``"session"`` to remember the approval for
      the current session, or ``"always"`` to remember permanently.
      Must be one of the options listed in the request's ``meta.persist``.
    """

    def to_mcp(self) -> ElicitResult:
        from mcp.types import ElicitResult

        return ElicitResult(action=self.action, content=self.content, meta=self.meta)

    @classmethod
    def from_mcp(cls, result: ElicitResult) -> McpServerElicitationResponse:
        """Create from MCP ElicitResult."""
        return cls(action=result.action, content=result.content, meta=result.meta)

meta class-attribute instance-attribute

meta: Any | None = None

Optional metadata to include in the response.

For MCP tool approval responses, this can contain:

  • persist (str): "session" to remember the approval for the current session, or "always" to remember permanently. Must be one of the options listed in the request's meta.persist.

from_mcp classmethod

from_mcp(result: ElicitResult) -> McpServerElicitationResponse

Create from MCP ElicitResult.

Source code in src/codexed/models/responses.py
@classmethod
def from_mcp(cls, result: ElicitResult) -> McpServerElicitationResponse:
    """Create from MCP ElicitResult."""
    return cls(action=result.action, content=result.content, meta=result.meta)

McpServerOauthLoginCompletedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class McpServerOauthLoginCompletedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["mcpServer/oauthLogin/completed"] = "mcpServer/oauthLogin/completed"
    params: McpServerOauthLoginCompletedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

McpServerOauthLoginCompletedNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpServerOauthLoginCompletedNotification(CodexBaseModel):
    error: str | None = None
    login_id: str | None = None
    """
    Identifies the explicit login attempt. Older servers omit this field.
    """
    name: str
    success: bool
    thread_id: str | None = None

login_id class-attribute instance-attribute

login_id: str | None = None

Identifies the explicit login attempt. Older servers omit this field.

McpServerOauthLoginParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpServerOauthLoginParams(CodexBaseModel):
    client_registration: McpServerOauthClientRegistration | None = None
    """
    Registration strategy for this login only; omission selects automatic discovery.
    """
    environment_id: str | None = None
    """
    Exact registration scope; omission preserves legacy name-only selection.
    """
    name: str
    scopes: list[str] | None = None
    thread_id: str | None = None
    timeout_secs: int | None = None

client_registration class-attribute instance-attribute

client_registration: McpServerOauthClientRegistration | None = None

Registration strategy for this login only; omission selects automatic discovery.

environment_id class-attribute instance-attribute

environment_id: str | None = None

Exact registration scope; omission preserves legacy name-only selection.

McpServerOauthLoginResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpServerOauthLoginResponse(CodexBaseModel):
    authorization_url: str
    login_id: str | None = None
    """
    Identifies this login attempt across the response and completion notification. Older servers omit this field; current servers always return it.
    """

login_id class-attribute instance-attribute

login_id: str | None = None

Identifies this login attempt across the response and completion notification. Older servers omit this field; current servers always return it.

McpServerStartupStatusUpdatedNotification

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class McpServerStartupStatusUpdatedNotification(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["mcpServer/startupStatus/updated"] = "mcpServer/startupStatus/updated"
    params: McpServerStatusUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

McpServerStatusEntry

Bases: CodexBaseModel

Status of a single MCP server.

Source code in src/codexed/models/misc.py
class McpServerStatusEntry(CodexBaseModel):
    """Status of a single MCP server."""

    name: str
    tools: dict[str, Tool] = Field(default_factory=dict)
    resources: list[Resource] = Field(default_factory=list)
    resource_templates: list[ResourceTemplate] = Field(default_factory=list)
    auth_status: McpAuthStatus = "unsupported"

McpServerStatusUpdatedNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpServerStatusUpdatedNotification(CodexBaseModel):
    environment_id: str | None = None
    """
    Registration scope, not necessarily the server's execution environment.
    """
    error: str | None = None
    failure_reason: McpServerStartupFailureReason | None = None
    name: str
    status: McpServerStartupState
    thread_id: str | None = None

environment_id class-attribute instance-attribute

environment_id: str | None = None

Registration scope, not necessarily the server's execution environment.

McpServerToolCallParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class McpServerToolCallParams(CodexBaseModel):
    field_meta: Any | None = None
    arguments: Any | None = None
    environment_id: str | None = None
    """
    Exact registration scope; omission preserves legacy name-only selection.
    """
    server: str
    thread_id: str
    tool: str

environment_id class-attribute instance-attribute

environment_id: str | None = None

Exact registration scope; omission preserves legacy name-only selection.

McpToolCallResult

Bases: CodexBaseModel

MCP tool call result.

Source code in src/codexed/models/thread_item.py
class McpToolCallResult(CodexBaseModel):
    """MCP tool call result."""

    content: list[ContentBlock]
    structured_content: Any = None
    meta: dict[str, Any] | None = Field(default=None, alias="_meta")
    """MCP `_meta` field of the tool result."""

meta class-attribute instance-attribute

meta: dict[str, Any] | None = Field(default=None, alias='_meta')

MCP _meta field of the tool result.

Model

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class Model(CodexBaseModel):
    additional_speed_tiers: list[str] | None = []
    """
    Deprecated: use `serviceTiers` instead.
    """
    availability_nux: ModelAvailabilityNux | None = None
    available_access_programs: ModelAccessPrograms | None = None
    """
    Null when the catalog does not provide access-program metadata.
    """
    default_reasoning_effort: ReasoningEffort
    default_service_tier: str | None = None
    """
    Catalog default service tier id for this model, when one is configured.
    """
    description: str
    display_name: str
    hidden: bool
    id: str
    input_modalities: list[InputModality] | None = ["text", "image"]
    is_default: bool
    model: str
    model_specialty: str | None = None
    multi_agent_version: MultiAgentVersion | None = None
    """
    Multi-agent runtime declared by this model, when available.
    """
    service_tiers: list[ModelServiceTier] | None = Field([], validate_default=True)
    supported_reasoning_efforts: list[ReasoningEffortOption]
    supports_personality: bool | None = False
    """
    @deprecated Always false; models no longer support personality selection.
    """
    upgrade: str | None = None
    upgrade_info: ModelUpgradeInfo | None = None

additional_speed_tiers class-attribute instance-attribute

additional_speed_tiers: list[str] | None = []

Deprecated: use serviceTiers instead.

available_access_programs class-attribute instance-attribute

available_access_programs: ModelAccessPrograms | None = None

Null when the catalog does not provide access-program metadata.

default_service_tier class-attribute instance-attribute

default_service_tier: str | None = None

Catalog default service tier id for this model, when one is configured.

multi_agent_version class-attribute instance-attribute

multi_agent_version: MultiAgentVersion | None = None

Multi-agent runtime declared by this model, when available.

supports_personality class-attribute instance-attribute

supports_personality: bool | None = False

@deprecated Always false; models no longer support personality selection.

ModelListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ModelListParams(CodexBaseModel):
    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    include_hidden: bool | None = None
    """
    When true, include models that are hidden from the default picker list.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to a reasonable server-side value.
    """
    model_provider: str | None = None
    """
    List models for this configured provider instead of the app-server default.
    """

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

include_hidden class-attribute instance-attribute

include_hidden: bool | None = None

When true, include models that are hidden from the default picker list.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to a reasonable server-side value.

model_provider class-attribute instance-attribute

model_provider: str | None = None

List models for this configured provider instead of the app-server default.

ModelListResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ModelListResponse(CodexBaseModel):
    data: list[Model]
    next_cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.
    """

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.

ModelReroutedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ModelReroutedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["model/rerouted"] = "model/rerouted"
    params: ModelReroutedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ModelUpgradeInfo

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ModelUpgradeInfo(CodexBaseModel):
    migration_markdown: str | None = None
    model: str
    model_link: str | None = None
    retirement_at: int | None = None
    """
    Informational Unix timestamp for this upgrade's scheduled retirement, if known.
    """
    upgrade_copy: str | None = None

retirement_at class-attribute instance-attribute

retirement_at: int | None = None

Informational Unix timestamp for this upgrade's scheduled retirement, if known.

NetworkApprovalContext

Bases: CodexBaseModel

Network approval context for command approvals.

Source code in src/codexed/models/misc.py
class NetworkApprovalContext(CodexBaseModel):
    """Network approval context for command approvals."""

    host: str
    protocol: NetworkApprovalProtocol

NetworkPolicyAmendment

Bases: CodexBaseModel

Proposed network policy amendment.

Source code in src/codexed/models/misc.py
class NetworkPolicyAmendment(CodexBaseModel):
    """Proposed network policy amendment."""

    host: str
    action: NetworkDomainPermission

NetworkRequirements

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class NetworkRequirements(CodexBaseModel):
    allow_local_binding: bool | None = None
    allow_unix_sockets: list[str] | None = None
    """
    Legacy compatibility view derived from `unix_sockets`.
    """
    allow_upstream_proxy: bool | None = None
    allowed_domains: list[str] | None = None
    """
    Legacy compatibility view derived from `domains`.
    """
    dangerously_allow_all_unix_sockets: bool | None = None
    dangerously_allow_non_loopback_proxy: bool | None = None
    denied_domains: list[str] | None = None
    """
    Legacy compatibility view derived from `domains`.
    """
    domains: dict[str, Any] | None = None
    """
    Canonical managed network permission map.
    """
    enabled: bool | None = None
    http_port: int | None = Field(None, ge=0)
    managed_allowed_domains_only: bool | None = None
    """
    When true, only managed allowlist entries are respected while managed network enforcement is active.
    """
    review_domains: list[str] | None = None
    """
    Host patterns routed to network approval before ordinary allow rules.
    """
    socks_port: int | None = Field(None, ge=0)
    unix_sockets: dict[str, Any] | None = None
    """
    Canonical managed unix socket permission map.
    """

allow_unix_sockets class-attribute instance-attribute

allow_unix_sockets: list[str] | None = None

Legacy compatibility view derived from unix_sockets.

allowed_domains class-attribute instance-attribute

allowed_domains: list[str] | None = None

Legacy compatibility view derived from domains.

denied_domains class-attribute instance-attribute

denied_domains: list[str] | None = None

Legacy compatibility view derived from domains.

domains class-attribute instance-attribute

domains: dict[str, Any] | None = None

Canonical managed network permission map.

managed_allowed_domains_only class-attribute instance-attribute

managed_allowed_domains_only: bool | None = None

When true, only managed allowlist entries are respected while managed network enforcement is active.

review_domains class-attribute instance-attribute

review_domains: list[str] | None = None

Host patterns routed to network approval before ordinary allow rules.

unix_sockets class-attribute instance-attribute

unix_sockets: dict[str, Any] | None = None

Canonical managed unix socket permission map.

PlanDeltaNotification

Bases: CodexBaseModel

EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.

Source code in src/codexed/models/v2_protocol.py
class PlanDeltaNotification(CodexBaseModel):
    """EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content."""

    delta: str
    item_id: str
    thread_id: str
    turn_id: str

PlanToolConfig

Bases: _ToolConfigBase

Configuration for the update_plan tool.

Source code in src/codexed/models/tool_config.py
class PlanToolConfig(_ToolConfigBase):
    """Configuration for the update_plan tool."""

    type: Literal["plan"] = "plan"

PluginInstallParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class PluginInstallParams(CodexBaseModel):
    install_attempt_id: str | None = None
    """
    Client-generated identifier used to correlate one installation attempt.
    """
    marketplace_path: AbsolutePathBuf | None = None
    plugin_name: str
    remote_marketplace_name: str | None = None

install_attempt_id class-attribute instance-attribute

install_attempt_id: str | None = None

Client-generated identifier used to correlate one installation attempt.

PluginListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class PluginListParams(CodexBaseModel):
    cwds: list[AbsolutePathBuf] | None = None
    """
    Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.
    """
    force_refetch: bool | None = None
    """
    Whether the client requests a fresh remote plugin catalog fetch.
    """
    marketplace_kinds: list[PluginListMarketplaceKind] | None = None
    """
    Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.
    """

cwds class-attribute instance-attribute

cwds: list[AbsolutePathBuf] | None = None

Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.

force_refetch class-attribute instance-attribute

force_refetch: bool | None = None

Whether the client requests a fresh remote plugin catalog fetch.

marketplace_kinds class-attribute instance-attribute

marketplace_kinds: list[PluginListMarketplaceKind] | None = None

Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.

RateLimitSnapshot

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class RateLimitSnapshot(CodexBaseModel):
    credits: CreditsSnapshot | None = None
    individual_limit: SpendControlLimitSnapshot | None = None
    limit_id: str | None = None
    limit_name: str | None = None
    normal_model_slug: str | None = None
    """
    Normal model whose display name and reasoning options describe this quota alias.
    """
    plan_type: PlanType | None = None
    primary: RateLimitWindow | None = None
    rate_limit_reached_type: RateLimitReachedType | None = None
    secondary: RateLimitWindow | None = None
    spend_control_reached: bool | None = None
    """
    Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.
    """

normal_model_slug class-attribute instance-attribute

normal_model_slug: str | None = None

Normal model whose display name and reasoning options describe this quota alias.

spend_control_reached class-attribute instance-attribute

spend_control_reached: bool | None = None

Backend-reported spend-control state. None is unavailable, not a sparse-update recovery.

ReadFileToolConfig

Bases: _ToolConfigBase

Configuration for the read_file tool (experimental).

Source code in src/codexed/models/tool_config.py
class ReadFileToolConfig(_ToolConfigBase):
    """Configuration for the read_file tool (experimental)."""

    type: Literal["read_file"] = "read_file"

RemoteSkillSummary

Bases: CodexBaseModel

Summary of a remote skill.

Source code in src/codexed/models/responses.py
class RemoteSkillSummary(CodexBaseModel):
    """Summary of a remote skill."""

    id: str
    name: str
    description: str

RequestPermissionsToolConfig

Bases: _ToolConfigBase

Configuration for the request_permissions tool.

Source code in src/codexed/models/tool_config.py
class RequestPermissionsToolConfig(_ToolConfigBase):
    """Configuration for the request_permissions tool."""

    type: Literal["request_permissions"] = "request_permissions"

RequestUserInputToolConfig

Bases: _ToolConfigBase

Configuration for the request_user_input tool.

Source code in src/codexed/models/tool_config.py
class RequestUserInputToolConfig(_ToolConfigBase):
    """Configuration for the request_user_input tool."""

    type: Literal["request_user_input"] = "request_user_input"

ReviewStartParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ReviewStartParams(CodexBaseModel):
    delivery: ReviewDelivery | None = None
    """
    Reviews run inline on the supplied thread. Omit this field or pass `inline`. To review on a separate thread, start a thread first and use its id.
    """
    target: ReviewTarget
    thread_id: str

delivery class-attribute instance-attribute

delivery: ReviewDelivery | None = None

Reviews run inline on the supplied thread. Omit this field or pass inline. To review on a separate thread, start a thread first and use its id.

ReviewStartResponse

Bases: CodexBaseModel

Response for review/start request.

Source code in src/codexed/models/responses.py
class ReviewStartResponse(CodexBaseModel):
    """Response for review/start request."""

    turn: TurnData
    review_thread_id: str

ServerRequestResolvedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ServerRequestResolvedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["serverRequest/resolved"] = "serverRequest/resolved"
    params: ServerRequestResolvedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

Settings

Bases: CodexBaseModel

Settings for a collaboration mode.

Source code in src/codexed/models/v2_protocol.py
class Settings(CodexBaseModel):
    """Settings for a collaboration mode."""

    developer_instructions: str | None = None
    model: str
    reasoning_effort: ReasoningEffort | None = None

ShellToolConfig

Bases: _ToolConfigBase

Configuration for the shell / exec tool.

Source code in src/codexed/models/tool_config.py
class ShellToolConfig(_ToolConfigBase):
    """Configuration for the shell / exec tool."""

    type: Literal["shell"] = "shell"

    allow_login_shell: bool | None = None
    """Whether the model may request a login shell."""

allow_login_shell class-attribute instance-attribute

allow_login_shell: bool | None = None

Whether the model may request a login shell.

SkillInterface

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class SkillInterface(CodexBaseModel):
    brand_color: str | None = None
    default_prompt: str | None = None
    display_name: str | None = None
    icon_large: AbsolutePathBuf | None = None
    icon_large_url: str | None = None
    """
    Remote large icon URL from the plugin catalog.
    """
    icon_small: AbsolutePathBuf | None = None
    icon_small_url: str | None = None
    """
    Remote small icon URL from the plugin catalog.
    """
    short_description: str | None = None

icon_large_url class-attribute instance-attribute

icon_large_url: str | None = None

Remote large icon URL from the plugin catalog.

icon_small_url class-attribute instance-attribute

icon_small_url: str | None = None

Remote small icon URL from the plugin catalog.

SkillMetadata

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class SkillMetadata(CodexBaseModel):
    dependencies: SkillDependencies | None = None
    description: str
    enabled: bool
    interface: SkillInterface | None = None
    name: str
    path: LegacyAppPathString
    plugin_id: str | None = None
    """
    Owning plugin ID, matching `PluginSummary.id`, when known.
    """
    scope: SkillScope
    short_description: str | None = None
    """
    Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.
    """

plugin_id class-attribute instance-attribute

plugin_id: str | None = None

Owning plugin ID, matching PluginSummary.id, when known.

short_description class-attribute instance-attribute

short_description: str | None = None

Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.

SkillRequestApprovalParams

Bases: CodexBaseModel

Parameters for skill/requestApproval server request.

Source code in src/codexed/models/request_params.py
class SkillRequestApprovalParams(CodexBaseModel):
    """Parameters for skill/requestApproval server request."""

    item_id: str
    skill_name: str

SkillRequestApprovalResponse

Bases: CodexBaseModel

Response for skill/requestApproval server request.

Source code in src/codexed/models/misc.py
class SkillRequestApprovalResponse(CodexBaseModel):
    """Response for skill/requestApproval server request."""

    decision: SkillApprovalDecision

SkillsConfigWriteParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class SkillsConfigWriteParams(CodexBaseModel):
    enabled: bool
    name: str | None = None
    """
    Name-based selector.
    """
    path: AbsolutePathBuf | None = None
    """
    Path-based selector.
    """

name class-attribute instance-attribute

name: str | None = None

Name-based selector.

path class-attribute instance-attribute

path: AbsolutePathBuf | None = None

Path-based selector.

SkillsListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class SkillsListParams(CodexBaseModel):
    cwds: list[str] | None = None
    """
    When empty, defaults to the current session working directory.
    """
    force_reload: bool | None = None
    """
    When true, bypass the skills cache and re-scan skills from disk.
    """

cwds class-attribute instance-attribute

cwds: list[str] | None = None

When empty, defaults to the current session working directory.

force_reload class-attribute instance-attribute

force_reload: bool | None = None

When true, bypass the skills cache and re-scan skills from disk.

SkillsRemoteExportParams

Bases: CodexBaseModel

Parameters for skills/remote/export request.

Source code in src/codexed/models/request_params.py
class SkillsRemoteExportParams(CodexBaseModel):
    """Parameters for skills/remote/export request."""

    hazelnut_id: str

SkillsRemoteExportResponse

Bases: CodexBaseModel

Response for skills/remote/export request.

Source code in src/codexed/models/responses.py
class SkillsRemoteExportResponse(CodexBaseModel):
    """Response for skills/remote/export request."""

    id: str
    path: str

SkillsRemoteListParams

Bases: CodexBaseModel

Parameters for skills/remote/list request.

Source code in src/codexed/models/request_params.py
class SkillsRemoteListParams(CodexBaseModel):
    """Parameters for skills/remote/list request."""

    hazelnut_scope: HazelnutScope = "example"
    product_surface: ProductSurface = "codex"
    enabled: bool = False

SkillsRemoteListResponse

Bases: CodexBaseModel

Response for skills/remote/list request.

Source code in src/codexed/models/responses.py
class SkillsRemoteListResponse(CodexBaseModel):
    """Response for skills/remote/list request."""

    data: list[RemoteSkillSummary]

StdioMcpServer

Bases: BaseModel

MCP server running as a subprocess via stdio transport.

Source code in src/codexed/models/mcp_server.py
class StdioMcpServer(BaseModel):
    """MCP server running as a subprocess via stdio transport."""

    command: str
    args: list[str] = []
    env: dict[str, str] | None = None
    enabled: bool = True
    default_tools_approval_mode: ToolApprovalMode | None = None
    """When Codex asks before calling this server's tools (Codex's default: ``auto``)."""

    def to_config_toml(self, name: str) -> str:
        parts = [f'command = "{self.command}"']
        if self.args:
            args_str = ", ".join(f'"{arg}"' for arg in self.args)
            parts.append(f"args = [{args_str}]")
        if self.env:
            # env as inline table
            env_items = ", ".join(f'{k} = "{v}"' for k, v in self.env.items())
            parts.append(f"env = {{{env_items}}}")
        if not self.enabled:
            parts.append("enabled = false")
        if self.default_tools_approval_mode:
            parts.append(f'default_tools_approval_mode = "{self.default_tools_approval_mode}"')
        return f"mcp_servers.{name}={{{', '.join(parts)}}}"

default_tools_approval_mode class-attribute instance-attribute

default_tools_approval_mode: ToolApprovalMode | None = None

When Codex asks before calling this server's tools (Codex's default: auto).

TextElement

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TextElement(CodexBaseModel):
    byte_range: ByteRange
    """
    Byte range in the parent `text` buffer that this element occupies.
    """
    placeholder: str | None = None
    """
    Optional human-readable placeholder for the element, displayed in the UI.
    """

byte_range instance-attribute

byte_range: ByteRange

Byte range in the parent text buffer that this element occupies.

placeholder class-attribute instance-attribute

placeholder: str | None = None

Optional human-readable placeholder for the element, displayed in the UI.

TextUserInput

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TextUserInput(CodexBaseModel):
    text: str
    text_elements: list[TextElement] | None = Field([], validate_default=True)
    """
    UI-defined spans within `text` used to render or persist special elements.
    """
    type: Literal["text"] = "text"

text_elements class-attribute instance-attribute

text_elements: list[TextElement] | None = Field([], validate_default=True)

UI-defined spans within text used to render or persist special elements.

Thread

Bases: CodexBaseModel

Source code in src/codexed/models/misc.py
class Thread(CodexBaseModel):
    agent_nickname: str | None = None
    """
    Optional random unique nickname assigned to an AgentControl-spawned sub-agent.
    """
    agent_role: str | None = None
    """
    Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.
    """
    cli_version: str
    """
    Version of the CLI that created the thread.
    """
    created_at: int
    """
    Unix timestamp (in seconds) when the thread was created.
    """
    cwd: AbsolutePathBuf
    """
    Working directory captured for the thread.
    """
    ephemeral: bool
    """
    Whether the thread is ephemeral and should not be materialized on disk.
    """
    forked_from_id: str | None = None
    """
    Source thread id when this thread was created by forking another thread.
    """
    git_info: GitInfo | None = None
    """
    Optional Git metadata captured when the thread was created.
    """
    id: str
    model_provider: str
    """
    Model provider used for this thread (for example, 'openai').
    """
    name: str | None = None
    """
    Optional user-facing thread title.
    """
    path: str | None = None
    """
    [UNSTABLE] Path to the thread on disk.
    """
    preview: str
    """
    Usually the first user message in the thread, if available.
    """
    source: SessionSource
    """
    Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).
    """
    status: ThreadStatus
    """
    Current runtime status for the thread.
    """
    turns: list[Turn]
    """
    Only populated on `thread/resume`, `thread/fork`, and `thread/read`
    (when `includeTurns` is true) responses.
    For all other responses and notifications returning a Thread,
    the turns field will be an empty list.
    """
    updated_at: int
    """
    Unix timestamp (in seconds) when the thread was last updated.
    """
    attached_to_thread_id: str | None = None
    can_accept_direct_input: bool | None = None
    daybreak_enabled: bool | None = None
    environments: list[ThreadEnvironment] | None = None
    extra: ThreadExtra | None = None
    history_mode: ThreadHistoryMode | None = None
    model: str | None = None
    originator: str | None = None
    parent_thread_id: str | None = None
    project_id: str | None = None
    reasoning_effort: ReasoningEffort | None = None
    recency_at: int | None = None
    """Unix timestamp (in seconds) used to order threads by recency."""
    section: ThreadSection | None = None
    section_entered_at: int | None = None
    session_id: str | None = None
    thread_source: str | None = None

agent_nickname class-attribute instance-attribute

agent_nickname: str | None = None

Optional random unique nickname assigned to an AgentControl-spawned sub-agent.

agent_role class-attribute instance-attribute

agent_role: str | None = None

Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.

cli_version instance-attribute

cli_version: str

Version of the CLI that created the thread.

created_at instance-attribute

created_at: int

Unix timestamp (in seconds) when the thread was created.

cwd instance-attribute

Working directory captured for the thread.

ephemeral instance-attribute

ephemeral: bool

Whether the thread is ephemeral and should not be materialized on disk.

forked_from_id class-attribute instance-attribute

forked_from_id: str | None = None

Source thread id when this thread was created by forking another thread.

git_info class-attribute instance-attribute

git_info: GitInfo | None = None

Optional Git metadata captured when the thread was created.

model_provider instance-attribute

model_provider: str

Model provider used for this thread (for example, 'openai').

name class-attribute instance-attribute

name: str | None = None

Optional user-facing thread title.

path class-attribute instance-attribute

path: str | None = None

[UNSTABLE] Path to the thread on disk.

preview instance-attribute

preview: str

Usually the first user message in the thread, if available.

recency_at class-attribute instance-attribute

recency_at: int | None = None

Unix timestamp (in seconds) used to order threads by recency.

source instance-attribute

source: SessionSource

Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).

status instance-attribute

status: ThreadStatus

Current runtime status for the thread.

turns instance-attribute

turns: list[Turn]

Only populated on thread/resume, thread/fork, and thread/read (when includeTurns is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.

updated_at instance-attribute

updated_at: int

Unix timestamp (in seconds) when the thread was last updated.

ThreadArchivedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadArchivedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/archived"] = "thread/archived"
    params: ThreadArchivedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadCompactedMessage

Bases: CodexBaseModel

Deprecated: Use ContextCompaction item type instead.

Source code in src/codexed/models/v2_protocol.py
class ThreadCompactedMessage(CodexBaseModel):
    """Deprecated: Use `ContextCompaction` item type instead."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/compacted"] = "thread/compacted"
    params: ContextCompactedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadForkParams

Bases: CodexBaseModel

There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.

If using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.

Prefer using thread_id whenever possible.

Source code in src/codexed/models/v2_protocol.py
class ThreadForkParams(CodexBaseModel):
    """There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.

    If using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.

    Prefer using thread_id whenever possible.
    """

    approval_policy: AskForApproval | None = None
    approvals_reviewer: ApprovalsReviewer | None = None
    """
    Override where approval requests are routed for review on this thread and subsequent turns.
    """
    attach_to_source: bool | None = None
    """
    Persist the fork as an attached thread of its resolved source, hidden from ordinary lists. The source cannot be deleted while attached threads exist. Requires a paginated source and local storage; incompatible with ephemeral and deferGoalContinuation. Omitted or false creates an ordinary fork.
    """
    base_instructions: str | None = None
    before_turn_id: str | None = None
    """
    Optional turn id to fork before, excluding that turn and all later turns. Cannot be combined with `last_turn_id`.
    """
    config: dict[str, Any] | None = None
    cwd: str | None = None
    defer_goal_continuation: bool | None = None
    """
    When true, carry the source thread's current goal into the fork without starting its initial automatic continuation. The next explicit turn owns the goal lifecycle, and normal automatic continuation resumes after it.
    """
    developer_instructions: str | None = None
    ephemeral: bool | None = None
    exclude_turns: bool | None = None
    """
    When true, return only thread metadata and live fork state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after forking. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.
    """
    experimental_disable_prediction_mcp: bool | None = None
    """
    Disable MCP servers in prediction mode when the inherited window uses incremental tools on Responses Lite. Requires `experimentalPredictionMode: true`.
    """
    experimental_prediction_mode: bool | None = None
    """
    Start from the loaded parent's effective config, tools, environments, and persisted history to maximize prompt-cache reuse. Requires a loaded, persisted parent and `ephemeral: true`. Enables `features.reasoning_effort_override` on the fork. Only `config.thread_unload_delay_secs` may override the inherited config. Cannot be combined with `path`, `lastTurnId`, or `beforeTurnId`.
    """
    last_turn_id: str | None = None
    """
    Optional last turn id to fork through, inclusive.

    When specified, turns after `last_turn_id` are omitted from the fork. The referenced turn cannot be in progress.
    """
    model: str | None = None
    """
    Configuration overrides for the forked thread, if any.
    """
    model_provider: str | None = None
    path: str | None = None
    """
    [UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.
    """
    permissions: str | None = None
    """
    Named profile id for the forked thread. Cannot be combined with `sandbox`.
    """
    runtime_workspace_roots: list[AbsolutePathBuf] | None = None
    """
    Replace the thread's runtime workspace roots. Paths must be absolute.
    """
    sandbox: SandboxMode | None = None
    service_tier: str | None = None
    thread_id: str
    thread_source: ThreadSource | None = None
    """
    Optional client-supplied analytics source classification for this forked thread.
    """

approvals_reviewer class-attribute instance-attribute

approvals_reviewer: ApprovalsReviewer | None = None

Override where approval requests are routed for review on this thread and subsequent turns.

attach_to_source class-attribute instance-attribute

attach_to_source: bool | None = None

Persist the fork as an attached thread of its resolved source, hidden from ordinary lists. The source cannot be deleted while attached threads exist. Requires a paginated source and local storage; incompatible with ephemeral and deferGoalContinuation. Omitted or false creates an ordinary fork.

before_turn_id class-attribute instance-attribute

before_turn_id: str | None = None

Optional turn id to fork before, excluding that turn and all later turns. Cannot be combined with last_turn_id.

defer_goal_continuation class-attribute instance-attribute

defer_goal_continuation: bool | None = None

When true, carry the source thread's current goal into the fork without starting its initial automatic continuation. The next explicit turn owns the goal lifecycle, and normal automatic continuation resumes after it.

exclude_turns class-attribute instance-attribute

exclude_turns: bool | None = None

When true, return only thread metadata and live fork state without populating thread.turns. This is useful when the client plans to call thread/turns/list immediately after forking. Full-history hydration is deprecated for paginated threads; use this with thread/turns/list and thread/items/list instead.

experimental_disable_prediction_mcp class-attribute instance-attribute

experimental_disable_prediction_mcp: bool | None = None

Disable MCP servers in prediction mode when the inherited window uses incremental tools on Responses Lite. Requires experimentalPredictionMode: true.

experimental_prediction_mode class-attribute instance-attribute

experimental_prediction_mode: bool | None = None

Start from the loaded parent's effective config, tools, environments, and persisted history to maximize prompt-cache reuse. Requires a loaded, persisted parent and ephemeral: true. Enables features.reasoning_effort_override on the fork. Only config.thread_unload_delay_secs may override the inherited config. Cannot be combined with path, lastTurnId, or beforeTurnId.

last_turn_id class-attribute instance-attribute

last_turn_id: str | None = None

Optional last turn id to fork through, inclusive.

When specified, turns after last_turn_id are omitted from the fork. The referenced turn cannot be in progress.

model class-attribute instance-attribute

model: str | None = None

Configuration overrides for the forked thread, if any.

path class-attribute instance-attribute

path: str | None = None

[UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.

permissions class-attribute instance-attribute

permissions: str | None = None

Named profile id for the forked thread. Cannot be combined with sandbox.

runtime_workspace_roots class-attribute instance-attribute

runtime_workspace_roots: list[AbsolutePathBuf] | None = None

Replace the thread's runtime workspace roots. Paths must be absolute.

thread_source class-attribute instance-attribute

thread_source: ThreadSource | None = None

Optional client-supplied analytics source classification for this forked thread.

ThreadInjectItemsParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadInjectItemsParams(CodexBaseModel):
    items: list[Any]
    """
    Raw Responses API items to append to the thread's model-visible history.
    """
    thread_id: str

items instance-attribute

items: list[Any]

Raw Responses API items to append to the thread's model-visible history.

ThreadItemAgentMessage

Bases: BaseThreadItem

Agent message item.

Source code in src/codexed/models/thread_item.py
class ThreadItemAgentMessage(BaseThreadItem):
    """Agent message item."""

    type: Literal["agentMessage"] = "agentMessage"
    text: str
    phase: MessagePhase | None = None
    delivery: AgentMessageDelivery | None = None
    memory_citation: MemoryCitation | None = None
    moderation: AgentMessageModeration | None = None
    questions: list[AsyncUserInputQuestion] | None = None

ThreadItemCollabAgentToolCall

Bases: BaseThreadItem

Collab agent tool call item.

Source code in src/codexed/models/thread_item.py
class ThreadItemCollabAgentToolCall(BaseThreadItem):
    """Collab agent tool call item."""

    type: Literal["collabAgentToolCall"] = "collabAgentToolCall"
    tool: CollabAgentTool
    status: CollabAgentToolCallStatus
    sender_thread_id: str
    receiver_thread_ids: list[str] = Field(default_factory=list)
    prompt: str | None = None
    agents_states: dict[str, CollabAgentState] = Field(default_factory=dict)

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        args: dict[str, Any] = {"tool": self.tool}
        if self.prompt is not None:
            args["prompt"] = self.prompt
        if self.receiver_thread_ids:
            args["receiver_thread_ids"] = self.receiver_thread_ids
        return args

    @property
    def item_summary(self) -> str:
        """Human-readable summary of this collab agent tool call."""
        first_state = next(iter(self.agents_states.values()), None)
        status = first_state.status if first_state else "unknown"
        receiver_ids = ", ".join(self.receiver_thread_ids)
        return f"[Collab Agent: {self.tool}] {receiver_ids} ({status})"

    model: str | None = None
    reasoning_effort: ReasoningEffort | None = None

item_summary property

item_summary: str

Human-readable summary of this collab agent tool call.

ThreadItemCommandExecution

Bases: BaseThreadItem

Command execution item.

Source code in src/codexed/models/thread_item.py
class ThreadItemCommandExecution(BaseThreadItem):
    """Command execution item."""

    type: Literal["commandExecution"] = "commandExecution"
    command: str
    cwd: str
    process_id: str | None = None
    status: CommandExecutionStatus
    source: CommandExecutionSource = "agent"
    command_actions: list[CommandAction] = Field(default_factory=list)
    aggregated_output: str | None = None
    exit_code: int | None = None
    duration_ms: int | None = None

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        return {"command": self.command, "cwd": self.cwd}

    @property
    def item_summary(self) -> str:
        """Human-readable summary of this command execution."""
        msg = f"[Executed: {self.command}]"
        if output := self.aggregated_output:
            msg += f"\n{output[:200]}"
        return msg

    plugin_id: str | None = None
    script_path: str | None = None

item_summary property

item_summary: str

Human-readable summary of this command execution.

ThreadItemContextCompaction

Bases: BaseThreadItem

Context compaction item.

Source code in src/codexed/models/thread_item.py
class ThreadItemContextCompaction(BaseThreadItem):
    """Context compaction item."""

    type: Literal["contextCompaction"] = "contextCompaction"

ThreadItemDynamicToolCall

Bases: BaseThreadItem

Dynamic tool call item.

Source code in src/codexed/models/thread_item.py
class ThreadItemDynamicToolCall(BaseThreadItem):
    """Dynamic tool call item."""

    type: Literal["dynamicToolCall"] = "dynamicToolCall"
    tool: str
    arguments: dict[str, Any] | None = None
    status: DynamicToolCallStatus
    content_items: list[DynamicToolCallOutputContentItem] | None = None
    success: bool | None = None
    duration_ms: int | None = None

    @property
    def inferred_arguments(self) -> dict[str, Any] | None:
        return self.arguments

    namespace: str | None = None

ThreadItemEnteredReviewMode

Bases: BaseThreadItem

Entered review mode item.

Source code in src/codexed/models/thread_item.py
class ThreadItemEnteredReviewMode(BaseThreadItem):
    """Entered review mode item."""

    type: Literal["enteredReviewMode"] = "enteredReviewMode"
    review: str

    @property
    def item_summary(self) -> str:
        """Human-readable summary of entering review mode."""
        return f"[Entered Review Mode: {self.review}]"

item_summary property

item_summary: str

Human-readable summary of entering review mode.

ThreadItemExitedReviewMode

Bases: BaseThreadItem

Exited review mode item.

Source code in src/codexed/models/thread_item.py
class ThreadItemExitedReviewMode(BaseThreadItem):
    """Exited review mode item."""

    type: Literal["exitedReviewMode"] = "exitedReviewMode"
    review: str

    @property
    def item_summary(self) -> str:
        """Human-readable summary of exiting review mode."""
        return f"[Exited Review Mode: {self.review}]"

item_summary property

item_summary: str

Human-readable summary of exiting review mode.

ThreadItemFileChange

Bases: BaseThreadItem

File change item.

Source code in src/codexed/models/thread_item.py
class ThreadItemFileChange(BaseThreadItem):
    """File change item."""

    type: Literal["fileChange"] = "fileChange"
    changes: list[FileUpdateChange]
    status: PatchApplyStatus

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        return {"changes": [c.model_dump() for c in self.changes]}

    @property
    def item_summary(self) -> str:
        """Human-readable summary of file changes."""
        paths = [c.path for c in self.changes]
        if len(paths) > 3:  # noqa: PLR2004
            return f"[Files: {', '.join(paths[:3])} +{len(paths) - 3} more]"
        return f"[Files: {', '.join(paths)}]"

item_summary property

item_summary: str

Human-readable summary of file changes.

ThreadItemFunctionCallOutput

Bases: BaseThreadItem

Output of a function call.

Source code in src/codexed/models/thread_item.py
class ThreadItemFunctionCallOutput(BaseThreadItem):
    """Output of a function call."""

    type: Literal["functionCallOutput"] = "functionCallOutput"
    name: str
    namespace: str | None = None
    output: FunctionCallOutputBody

ThreadItemHookPrompt

Bases: BaseThreadItem

Prompt injected by a hook.

Source code in src/codexed/models/thread_item.py
class ThreadItemHookPrompt(BaseThreadItem):
    """Prompt injected by a hook."""

    type: Literal["hookPrompt"] = "hookPrompt"
    fragments: list[HookPromptFragment]

ThreadItemImageGeneration

Bases: BaseThreadItem

Image generation item.

Source code in src/codexed/models/thread_item.py
class ThreadItemImageGeneration(BaseThreadItem):
    """Image generation item."""

    type: Literal["imageGeneration"] = "imageGeneration"
    status: str
    result: str
    failure: ImageGenerationFailure | None = None
    generation_id: str | None = None
    input_images: list[ImageGenerationInputImage] | None = None
    revised_prompt: str | None = None
    saved_path: str | None = None
    transparent_background: bool | None = None

ThreadItemImageView

Bases: BaseThreadItem

Image view item.

Source code in src/codexed/models/thread_item.py
class ThreadItemImageView(BaseThreadItem):
    """Image view item."""

    type: Literal["imageView"] = "imageView"
    path: str

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        return {"path": self.path}

    @property
    def item_summary(self) -> str:
        """Human-readable summary of this image view."""
        return f"[Viewed Image: {self.path}]"

item_summary property

item_summary: str

Human-readable summary of this image view.

ThreadItemMcpToolCall

Bases: BaseThreadItem

MCP tool call item.

Source code in src/codexed/models/thread_item.py
class ThreadItemMcpToolCall(BaseThreadItem):
    """MCP tool call item."""

    type: Literal["mcpToolCall"] = "mcpToolCall"
    server: str
    tool: str
    status: McpToolCallStatus
    arguments: dict[str, Any] | None = None
    result: McpToolCallResult | None = None
    error: McpToolCallError | None = None
    duration_ms: int | None = None

    @property
    def inferred_arguments(self) -> dict[str, Any] | None:
        return self.arguments

    @property
    def item_summary(self) -> str:
        """Human-readable summary of this MCP tool call."""
        result_text = ""
        if self.result and self.result.content:
            texts = [str(b.model_dump().get("text", "")) for b in self.result.content]
            result_text = " ".join(texts)
        return f"[Tool: {self.tool}] {result_text[:100]}"

    app_context: McpToolCallAppContext | None = None
    mcp_app_resource_uri: str | None = None
    mcp_app_ui: McpAppUi | None = None
    plugin_id: str | None = None
    read_only_hint: bool | None = None

item_summary property

item_summary: str

Human-readable summary of this MCP tool call.

ThreadItemPlan

Bases: BaseThreadItem

Plan item.

Source code in src/codexed/models/thread_item.py
class ThreadItemPlan(BaseThreadItem):
    """Plan item."""

    type: Literal["plan"] = "plan"
    text: str

ThreadItemReasoning

Bases: BaseThreadItem

Reasoning item.

Source code in src/codexed/models/thread_item.py
class ThreadItemReasoning(BaseThreadItem):
    """Reasoning item."""

    type: Literal["reasoning"] = "reasoning"
    summary: list[str] = Field(default_factory=list)
    content: list[str] = Field(default_factory=list)

ThreadItemSleep

Bases: BaseThreadItem

Sleep item.

Source code in src/codexed/models/thread_item.py
class ThreadItemSleep(BaseThreadItem):
    """Sleep item."""

    type: Literal["sleep"] = "sleep"
    duration_ms: int = Field(ge=0)

ThreadItemSubAgentActivity

Bases: BaseThreadItem

Activity of a sub-agent.

Source code in src/codexed/models/thread_item.py
class ThreadItemSubAgentActivity(BaseThreadItem):
    """Activity of a sub-agent."""

    type: Literal["subAgentActivity"] = "subAgentActivity"
    agent_path: str
    agent_thread_id: str
    kind: SubAgentActivityKind
    model: str | None = None
    reasoning_effort: ReasoningEffort | None = None

ThreadItemUserMessage

Bases: BaseThreadItem

User message item.

Source code in src/codexed/models/thread_item.py
class ThreadItemUserMessage(BaseThreadItem):
    """User message item."""

    type: Literal["userMessage"] = "userMessage"
    content: list[UserInput]
    client_id: str | None = None

ThreadItemWebSearch

Bases: BaseThreadItem

Web search item.

Source code in src/codexed/models/thread_item.py
class ThreadItemWebSearch(BaseThreadItem):
    """Web search item."""

    type: Literal["webSearch"] = "webSearch"
    query: str
    action: WebSearchAction | None = None

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        return {"query": self.query}

    @property
    def item_summary(self) -> str:
        """Human-readable summary of this web search."""
        return f"[Web Search: {self.query}]"

    results: list[Any] | None = None

item_summary property

item_summary: str

Human-readable summary of this web search.

ThreadListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadListParams(CodexBaseModel):
    ancestor_thread_id: str | None = None
    """
    Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with `parentThreadId`.
    """
    archived: bool | None = None
    """
    Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.
    """
    attached_to_thread_id: str | None = None
    """
    Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings.
    """
    current_account_only: bool | None = None
    """
    Show local history visible to the current ChatGPT account. Defaults to false.
    """
    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    cwd: ThreadListCwdFilter | None = None
    """
    Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.
    """
    excluded_thread_ids: list[str] | None = None
    """
    Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions.
    """
    include_attached_threads: bool | None = None
    """
    Include persistent threads attached to a parent when searching by title.
    """
    included_thread_ids: list[str] | None = None
    """
    Restrict results to up to 100 thread IDs before pagination. Omit or send null for unrestricted results. An empty list matches nothing. Exclusions still apply. Repeat the same IDs on each page. The local store uses indexed metadata for this filter.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to a reasonable server-side value.
    """
    model_providers: list[str] | None = None
    """
    Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.
    """
    originators: list[str] | None = None
    """
    Optional originator allowlist, matching any supplied value exactly. Supported by hosted backends only; the local app-server rejects a nonempty list. Omitted or empty lists leave originators unrestricted.
    """
    parent_thread_id: str | None = None
    """
    Optional direct parent thread filter. Mutually exclusive with `ancestorThreadId`.
    """
    project_id: str | None = None
    """
    Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project.
    """
    search_term: str | None = None
    """
    Optional substring filter for the extracted thread title.
    """
    section_id: str | None = None
    """
    Omit to include every section, set to `null` for unsectioned threads, or provide a section ID to return only threads in that section.
    """
    sort_direction: SortDirection | None = None
    """
    Optional sort direction; defaults to descending (newest first).
    """
    sort_key: ThreadSortKey | None = None
    """
    Optional sort key; defaults to created_at.
    """
    source_kinds: list[ThreadSourceKind] | None = None
    """
    Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.
    """
    use_state_db_only: bool | None = None
    """
    If true, the local store returns indexed metadata without scanning JSONL rollouts for repairs. Requests with `includedThreadIds` always use indexed metadata.
    """

ancestor_thread_id class-attribute instance-attribute

ancestor_thread_id: str | None = None

Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with parentThreadId.

archived class-attribute instance-attribute

archived: bool | None = None

Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.

attached_to_thread_id class-attribute instance-attribute

attached_to_thread_id: str | None = None

Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings.

current_account_only class-attribute instance-attribute

current_account_only: bool | None = None

Show local history visible to the current ChatGPT account. Defaults to false.

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

cwd class-attribute instance-attribute

cwd: ThreadListCwdFilter | None = None

Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.

excluded_thread_ids class-attribute instance-attribute

excluded_thread_ids: list[str] | None = None

Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions.

include_attached_threads class-attribute instance-attribute

include_attached_threads: bool | None = None

Include persistent threads attached to a parent when searching by title.

included_thread_ids class-attribute instance-attribute

included_thread_ids: list[str] | None = None

Restrict results to up to 100 thread IDs before pagination. Omit or send null for unrestricted results. An empty list matches nothing. Exclusions still apply. Repeat the same IDs on each page. The local store uses indexed metadata for this filter.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to a reasonable server-side value.

model_providers class-attribute instance-attribute

model_providers: list[str] | None = None

Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.

originators class-attribute instance-attribute

originators: list[str] | None = None

Optional originator allowlist, matching any supplied value exactly. Supported by hosted backends only; the local app-server rejects a nonempty list. Omitted or empty lists leave originators unrestricted.

parent_thread_id class-attribute instance-attribute

parent_thread_id: str | None = None

Optional direct parent thread filter. Mutually exclusive with ancestorThreadId.

project_id class-attribute instance-attribute

project_id: str | None = None

Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project.

search_term class-attribute instance-attribute

search_term: str | None = None

Optional substring filter for the extracted thread title.

section_id class-attribute instance-attribute

section_id: str | None = None

Omit to include every section, set to null for unsectioned threads, or provide a section ID to return only threads in that section.

sort_direction class-attribute instance-attribute

sort_direction: SortDirection | None = None

Optional sort direction; defaults to descending (newest first).

sort_key class-attribute instance-attribute

sort_key: ThreadSortKey | None = None

Optional sort key; defaults to created_at.

source_kinds class-attribute instance-attribute

source_kinds: list[ThreadSourceKind] | None = None

Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.

use_state_db_only class-attribute instance-attribute

use_state_db_only: bool | None = None

If true, the local store returns indexed metadata without scanning JSONL rollouts for repairs. Requests with includedThreadIds always use indexed metadata.

ThreadListResponse

Bases: CodexBaseModel

Response for thread/list request.

Source code in src/codexed/models/responses.py
class ThreadListResponse(CodexBaseModel):
    """Response for thread/list request."""

    data: list[Thread]
    next_cursor: str | None = None
    backwards_cursor: str | None = None
    read_states: dict[str, ThreadReadState] | None = None
    """Read state per thread ID."""

read_states class-attribute instance-attribute

read_states: dict[str, ThreadReadState] | None = None

Read state per thread ID.

ThreadLoadedListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadLoadedListParams(CodexBaseModel):
    cursor: str | None = None
    """
    Opaque pagination cursor returned by a previous call.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional page size; defaults to no limit.
    """

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque pagination cursor returned by a previous call.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional page size; defaults to no limit.

ThreadLoadedListResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadLoadedListResponse(CodexBaseModel):
    data: list[str]
    """
    Thread ids for sessions currently loaded in memory.
    """
    next_cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.
    """

data instance-attribute

data: list[str]

Thread ids for sessions currently loaded in memory.

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.

ThreadNameUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadNameUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/name/updated"] = "thread/name/updated"
    params: ThreadNameUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadReadParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadReadParams(CodexBaseModel):
    include_turns: bool | None = None
    """
    When true, include turns and their items from rollout history. Full-history hydration is deprecated for paginated threads; prefer a metadata-only read and page with `thread/turns/list` and `thread/items/list`.
    """
    thread_id: str

include_turns class-attribute instance-attribute

include_turns: bool | None = None

When true, include turns and their items from rollout history. Full-history hydration is deprecated for paginated threads; prefer a metadata-only read and page with thread/turns/list and thread/items/list.

ThreadReadResponse

Bases: CodexBaseModel

Response for thread/read request.

Source code in src/codexed/models/responses.py
class ThreadReadResponse(CodexBaseModel):
    """Response for thread/read request."""

    thread: Thread
    read_state: ThreadReadState | None = None

ThreadRealtimeAppendAudioParams

Bases: CodexBaseModel

EXPERIMENTAL - append audio input to thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeAppendAudioParams(CodexBaseModel):
    """EXPERIMENTAL - append audio input to thread realtime."""

    audio: ThreadRealtimeAudioChunk
    thread_id: str

ThreadRealtimeAppendAudioResponse

Bases: CodexBaseModel

EXPERIMENTAL - response for appending realtime audio input.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeAppendAudioResponse(CodexBaseModel):
    """EXPERIMENTAL - response for appending realtime audio input."""

ThreadRealtimeAppendTextParams

Bases: CodexBaseModel

EXPERIMENTAL - append text input to thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeAppendTextParams(CodexBaseModel):
    """EXPERIMENTAL - append text input to thread realtime."""

    role: ConversationTextRole | None = "user"
    text: str
    thread_id: str

ThreadRealtimeAppendTextResponse

Bases: CodexBaseModel

EXPERIMENTAL - response for appending realtime text input.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeAppendTextResponse(CodexBaseModel):
    """EXPERIMENTAL - response for appending realtime text input."""

ThreadRealtimeAudioChunk

Bases: CodexBaseModel

EXPERIMENTAL - thread realtime audio chunk.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeAudioChunk(CodexBaseModel):
    """EXPERIMENTAL - thread realtime audio chunk."""

    data: str
    item_id: str | None = None
    num_channels: int = Field(..., ge=0)
    sample_rate: int = Field(..., ge=0)
    samples_per_channel: int | None = Field(None, ge=0)

ThreadRealtimeClosedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeClosedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/closed"] = "thread/realtime/closed"
    params: ThreadRealtimeClosedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeClosedNotification

Bases: CodexBaseModel

EXPERIMENTAL - emitted when thread realtime transport closes.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeClosedNotification(CodexBaseModel):
    """EXPERIMENTAL - emitted when thread realtime transport closes."""

    reason: str | None = None
    thread_id: str

ThreadRealtimeErrorMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeErrorMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/error"] = "thread/realtime/error"
    params: ThreadRealtimeErrorNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeErrorNotification

Bases: CodexBaseModel

EXPERIMENTAL - emitted when thread realtime encounters an error.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeErrorNotification(CodexBaseModel):
    """EXPERIMENTAL - emitted when thread realtime encounters an error."""

    message: str
    thread_id: str

ThreadRealtimeItemAddedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeItemAddedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/itemAdded"] = "thread/realtime/itemAdded"
    params: ThreadRealtimeItemAddedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeItemAddedNotification

Bases: CodexBaseModel

EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeItemAddedNotification(CodexBaseModel):
    """EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend."""

    item: Any
    thread_id: str

ThreadRealtimeListVoicesParams

Bases: CodexBaseModel

EXPERIMENTAL - list voices supported by thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeListVoicesParams(CodexBaseModel):
    """EXPERIMENTAL - list voices supported by thread realtime."""

ThreadRealtimeListVoicesResponse

Bases: CodexBaseModel

EXPERIMENTAL - response for listing supported realtime voices.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeListVoicesResponse(CodexBaseModel):
    """EXPERIMENTAL - response for listing supported realtime voices."""

    voices: RealtimeVoicesList

ThreadRealtimeOutputAudioDeltaMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeOutputAudioDeltaMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/outputAudio/delta"] = "thread/realtime/outputAudio/delta"
    params: ThreadRealtimeOutputAudioDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeOutputAudioDeltaNotification

Bases: CodexBaseModel

EXPERIMENTAL - streamed output audio emitted by thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeOutputAudioDeltaNotification(CodexBaseModel):
    """EXPERIMENTAL - streamed output audio emitted by thread realtime."""

    audio: ThreadRealtimeAudioChunk
    thread_id: str

ThreadRealtimeStartParams

Bases: CodexBaseModel

EXPERIMENTAL - start a thread-scoped realtime session.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStartParams(CodexBaseModel):
    """EXPERIMENTAL - start a thread-scoped realtime session."""

    backend_reasoning_status: bool | None = None
    """
    Relays public reasoning summaries as quiet context for realtime V3 delegations. Defaults to false.
    """
    client_managed_handoffs: bool | None = None
    """
    Leaves Codex response handoffs to the client's explicit append calls instead of forwarding them automatically. Defaults to false.
    """
    codex_response_handoff_channel_prefixes: dict[str, Any] | None = None
    """
    Overrides BEM channel prefixes by `analysis`, `commentary`, or `final`. Omitted channels retain their default uppercase bracketed prefixes.
    """
    codex_response_handoff_mode: CodexResponseHandoffMode | None = None
    """
    Selects how automatic Codex responses are routed in Frameless Bidi sessions. Omitted values default to `thinking`. Realtime V1 and V2 ignore this setting.
    """
    codex_response_item_prefix: str | None = None
    """
    Optional prefix added to automatic Codex response items when `codexResponsesAsItems` is true.
    """
    codex_responses_as_items: bool | None = None
    """
    Sends automatic Codex responses as realtime conversation items instead of handoff appends.
    """
    delegation_ack_filler: bool | None = None
    """
    Controls whether a realtime V3 delegation produces an acknowledgement filler. Omitted values preserve the Realtime API's default behavior.
    """
    flush_transcript_tail_on_session_end: bool | None = None
    """
    Routes any transcript tail remaining at session end through Codex. Defaults to false. TODO: Remove this rollout knob once transcript-tail flushing is always enabled.
    """
    include_startup_context: bool | None = None
    """
    Set to false to start without Codex's startup context. Omitted or null includes it.
    """
    initial_items: list[ThreadRealtimeInitialItem] | None = None
    """
    Adds complete role-bearing text items to the initial Frameless Bidi session history. This is only supported by realtime V3 and is sent during session startup. Requests are limited to 128 items and 8,192 estimated text tokens in total.
    """
    model: str | None = None
    """
    Overrides the configured realtime model for this session only.
    """
    output_modality: RealtimeOutputModality
    """
    Selects text or audio output for the realtime session. Transport and voice stay independent so clients can choose how they connect separately from what the model emits.
    """
    prompt: str | None = None
    realtime_end_instructions: str | None = None
    """
    Developer instructions given to the backing Codex model when this realtime session ends.
    """
    realtime_session_id: str | None = None
    realtime_start_instructions: str | None = None
    """
    Developer instructions given to the backing Codex model when this realtime session starts.
    """
    thread_id: str
    transport: ThreadRealtimeStartTransport | None = None
    version: RealtimeConversationVersion | None = None
    """
    Overrides the configured realtime protocol version for this session only.
    """
    voice: RealtimeVoice | None = None
    voice_session_id: str | None = None
    """
    Client-generated identifier for the product voice session. This is distinct from `realtimeSessionId`.
    """

backend_reasoning_status class-attribute instance-attribute

backend_reasoning_status: bool | None = None

Relays public reasoning summaries as quiet context for realtime V3 delegations. Defaults to false.

client_managed_handoffs class-attribute instance-attribute

client_managed_handoffs: bool | None = None

Leaves Codex response handoffs to the client's explicit append calls instead of forwarding them automatically. Defaults to false.

codex_response_handoff_channel_prefixes class-attribute instance-attribute

codex_response_handoff_channel_prefixes: dict[str, Any] | None = None

Overrides BEM channel prefixes by analysis, commentary, or final. Omitted channels retain their default uppercase bracketed prefixes.

codex_response_handoff_mode class-attribute instance-attribute

codex_response_handoff_mode: CodexResponseHandoffMode | None = None

Selects how automatic Codex responses are routed in Frameless Bidi sessions. Omitted values default to thinking. Realtime V1 and V2 ignore this setting.

codex_response_item_prefix class-attribute instance-attribute

codex_response_item_prefix: str | None = None

Optional prefix added to automatic Codex response items when codexResponsesAsItems is true.

codex_responses_as_items class-attribute instance-attribute

codex_responses_as_items: bool | None = None

Sends automatic Codex responses as realtime conversation items instead of handoff appends.

delegation_ack_filler class-attribute instance-attribute

delegation_ack_filler: bool | None = None

Controls whether a realtime V3 delegation produces an acknowledgement filler. Omitted values preserve the Realtime API's default behavior.

flush_transcript_tail_on_session_end class-attribute instance-attribute

flush_transcript_tail_on_session_end: bool | None = None

Routes any transcript tail remaining at session end through Codex. Defaults to false. TODO: Remove this rollout knob once transcript-tail flushing is always enabled.

include_startup_context class-attribute instance-attribute

include_startup_context: bool | None = None

Set to false to start without Codex's startup context. Omitted or null includes it.

initial_items class-attribute instance-attribute

initial_items: list[ThreadRealtimeInitialItem] | None = None

Adds complete role-bearing text items to the initial Frameless Bidi session history. This is only supported by realtime V3 and is sent during session startup. Requests are limited to 128 items and 8,192 estimated text tokens in total.

model class-attribute instance-attribute

model: str | None = None

Overrides the configured realtime model for this session only.

output_modality instance-attribute

output_modality: RealtimeOutputModality

Selects text or audio output for the realtime session. Transport and voice stay independent so clients can choose how they connect separately from what the model emits.

realtime_end_instructions class-attribute instance-attribute

realtime_end_instructions: str | None = None

Developer instructions given to the backing Codex model when this realtime session ends.

realtime_start_instructions class-attribute instance-attribute

realtime_start_instructions: str | None = None

Developer instructions given to the backing Codex model when this realtime session starts.

version class-attribute instance-attribute

version: RealtimeConversationVersion | None = None

Overrides the configured realtime protocol version for this session only.

voice_session_id class-attribute instance-attribute

voice_session_id: str | None = None

Client-generated identifier for the product voice session. This is distinct from realtimeSessionId.

ThreadRealtimeStartResponse

Bases: CodexBaseModel

EXPERIMENTAL - response for starting thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStartResponse(CodexBaseModel):
    """EXPERIMENTAL - response for starting thread realtime."""

ThreadRealtimeStartedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStartedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/started"] = "thread/realtime/started"
    params: ThreadRealtimeStartedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeStartedNotification

Bases: CodexBaseModel

EXPERIMENTAL - emitted when thread realtime startup is accepted.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStartedNotification(CodexBaseModel):
    """EXPERIMENTAL - emitted when thread realtime startup is accepted."""

    realtime_session_id: str | None = None
    thread_id: str
    version: RealtimeConversationVersion

ThreadRealtimeStopParams

Bases: CodexBaseModel

EXPERIMENTAL - stop thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStopParams(CodexBaseModel):
    """EXPERIMENTAL - stop thread realtime."""

    thread_id: str

ThreadRealtimeStopResponse

Bases: CodexBaseModel

EXPERIMENTAL - response for stopping thread realtime.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeStopResponse(CodexBaseModel):
    """EXPERIMENTAL - response for stopping thread realtime."""

ThreadRealtimeTranscriptDeltaMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeTranscriptDeltaMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/transcript/delta"] = "thread/realtime/transcript/delta"
    params: ThreadRealtimeTranscriptDeltaNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadRealtimeTranscriptDoneMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadRealtimeTranscriptDoneMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/realtime/transcript/done"] = "thread/realtime/transcript/done"
    params: ThreadRealtimeTranscriptDoneNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadResponse

Bases: CodexBaseModel

Response for thread/start, thread/resume, and thread/fork.

Source code in src/codexed/models/responses.py
class ThreadResponse(CodexBaseModel):
    """Response for thread/start, thread/resume, and thread/fork."""

    thread: Thread
    model: str
    model_provider: str
    cwd: str
    approval_policy: AskForApproval
    sandbox: SandboxPolicy
    reasoning_effort: ReasoningEffort | None = None
    service_tier: str | None = None
    active_permission_profile: ActivePermissionProfile | None = None
    approvals_reviewer: ApprovalsReviewer | None = None
    collaboration_mode: CollaborationMode | None = None
    """Only returned by thread/resume."""
    disabled_plugin_ids: list[str] | None = None
    initial_turns_page: TurnsPage | None = None
    """Only returned by thread/resume."""
    instruction_sources: list[str] | None = None
    items_backwards_cursor: str | None = None
    """Only returned by thread/resume."""
    multi_agent_mode: MultiAgentMode | None = None
    runtime_workspace_roots: list[str] | None = None
    turns_backwards_cursor: str | None = None
    """Only returned by thread/resume."""

collaboration_mode class-attribute instance-attribute

collaboration_mode: CollaborationMode | None = None

Only returned by thread/resume.

initial_turns_page class-attribute instance-attribute

initial_turns_page: TurnsPage | None = None

Only returned by thread/resume.

items_backwards_cursor class-attribute instance-attribute

items_backwards_cursor: str | None = None

Only returned by thread/resume.

turns_backwards_cursor class-attribute instance-attribute

turns_backwards_cursor: str | None = None

Only returned by thread/resume.

ThreadResumeParams

Bases: CodexBaseModel

There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.

For non-running threads, the precedence is: history > non-empty path > thread_id. If using history or a non-empty path for a non-running thread, the thread_id param will be ignored.

If thread_id identifies a running thread, app-server rejoins that thread and treats a non-empty path as a consistency check against the active rollout path. Empty string path values are treated as absent.

Prefer using thread_id whenever possible.

Source code in src/codexed/models/v2_protocol.py
class ThreadResumeParams(CodexBaseModel):
    """There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.

    For non-running threads, the precedence is: history > non-empty path > thread_id. If using history or a non-empty path for a non-running thread, the thread_id param will be ignored.

    If thread_id identifies a running thread, app-server rejoins that thread and treats a non-empty path as a consistency check against the active rollout path. Empty string path values are treated as absent.

    Prefer using thread_id whenever possible.
    """

    approval_policy: AskForApproval | None = None
    approvals_reviewer: ApprovalsReviewer | None = None
    """
    Override where approval requests are routed for review on this thread and subsequent turns.
    """
    base_instructions: str | None = None
    config: dict[str, Any] | None = None
    cwd: str | None = None
    developer_instructions: str | None = None
    exclude_turns: bool | None = None
    """
    When true, return only thread metadata and live-resume state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after resuming. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.
    """
    history: list[ResponseItem] | None = None
    """
    [UNSTABLE] FOR CODEX CLOUD - DO NOT USE. If specified, the thread will be resumed with the provided history instead of loaded from disk.
    """
    initial_turns_page: ThreadResumeInitialTurnsPageParams | None = None
    """
    When present, include a `thread/turns/list` page in the resume response so clients can bootstrap recent turns without a second request.
    """
    model: str | None = None
    """
    Configuration overrides for the resumed thread, if any.
    """
    model_provider: str | None = None
    path: str | None = None
    """
    [UNSTABLE] Specify the rollout path to resume from. If specified for a non-running thread, the thread_id param will be ignored. If thread_id identifies a running thread, the path must match the active rollout path.
    """
    permissions: str | None = None
    """
    Named profile id for the resumed thread. Cannot be combined with `sandbox`.
    """
    personality: Personality | None = None
    """
    @deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.
    """
    runtime_workspace_roots: list[AbsolutePathBuf] | None = None
    """
    Replace the thread's runtime workspace roots. Paths must be absolute.
    """
    sandbox: SandboxMode | None = None
    service_tier: str | None = None
    thread_id: str

approvals_reviewer class-attribute instance-attribute

approvals_reviewer: ApprovalsReviewer | None = None

Override where approval requests are routed for review on this thread and subsequent turns.

exclude_turns class-attribute instance-attribute

exclude_turns: bool | None = None

When true, return only thread metadata and live-resume state without populating thread.turns. This is useful when the client plans to call thread/turns/list immediately after resuming. Full-history hydration is deprecated for paginated threads; use this with thread/turns/list and thread/items/list instead.

history class-attribute instance-attribute

history: list[ResponseItem] | None = None

[UNSTABLE] FOR CODEX CLOUD - DO NOT USE. If specified, the thread will be resumed with the provided history instead of loaded from disk.

initial_turns_page class-attribute instance-attribute

initial_turns_page: ThreadResumeInitialTurnsPageParams | None = None

When present, include a thread/turns/list page in the resume response so clients can bootstrap recent turns without a second request.

model class-attribute instance-attribute

model: str | None = None

Configuration overrides for the resumed thread, if any.

path class-attribute instance-attribute

path: str | None = None

[UNSTABLE] Specify the rollout path to resume from. If specified for a non-running thread, the thread_id param will be ignored. If thread_id identifies a running thread, the path must match the active rollout path.

permissions class-attribute instance-attribute

permissions: str | None = None

Named profile id for the resumed thread. Cannot be combined with sandbox.

personality class-attribute instance-attribute

personality: Personality | None = None

@deprecated friendly and pragmatic no longer select a style. Changing this does not rewrite the thread's existing instructions.

runtime_workspace_roots class-attribute instance-attribute

runtime_workspace_roots: list[AbsolutePathBuf] | None = None

Replace the thread's runtime workspace roots. Paths must be absolute.

ThreadRevertParams

Bases: CodexBaseModel

Replace a paginated thread's durable history with the prefix before one turn.

This only changes persisted conversation history. It does not revert local file changes.

Source code in src/codexed/models/v2_protocol.py
class ThreadRevertParams(CodexBaseModel):
    """Replace a paginated thread's durable history with the prefix before one turn.

    This only changes persisted conversation history. It does not revert local file changes.
    """

    before_turn_id: str
    """
    Turn excluded from the replacement history, together with every later turn.
    """
    thread_id: str

before_turn_id instance-attribute

before_turn_id: str

Turn excluded from the replacement history, together with every later turn.

ThreadRevertResponse

Bases: CodexBaseModel

Response for thread/revert request.

Source code in src/codexed/models/responses.py
class ThreadRevertResponse(CodexBaseModel):
    """Response for thread/revert request."""

    thread: Thread
    """Updated thread metadata. `turns` is always empty; use `thread/turns/list`."""
    items_backwards_cursor: str | None = None
    """Cursor for hydrating paginated items backwards via `thread/items/list`."""
    turns_backwards_cursor: str | None = None
    """Cursor for hydrating paginated turns backwards via `thread/turns/list`."""

items_backwards_cursor class-attribute instance-attribute

items_backwards_cursor: str | None = None

Cursor for hydrating paginated items backwards via thread/items/list.

thread instance-attribute

thread: Thread

Updated thread metadata. turns is always empty; use thread/turns/list.

turns_backwards_cursor class-attribute instance-attribute

turns_backwards_cursor: str | None = None

Cursor for hydrating paginated turns backwards via thread/turns/list.

ThreadShellCommandParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadShellCommandParams(CodexBaseModel):
    command: str
    """
    Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.
    """
    thread_id: str
    timeout_ms: int | None = None
    """
    Maximum execution time in milliseconds. Defaults to one hour when omitted or null. Must be non-negative; zero requests an immediate timeout, not unlimited execution. Does not affect the immediate RPC acknowledgement.
    """

command instance-attribute

command: str

Shell command string evaluated by the thread's configured shell. Unlike command/exec, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.

timeout_ms class-attribute instance-attribute

timeout_ms: int | None = None

Maximum execution time in milliseconds. Defaults to one hour when omitted or null. Must be non-negative; zero requests an immediate timeout, not unlimited execution. Does not affect the immediate RPC acknowledgement.

ThreadStartParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadStartParams(CodexBaseModel):
    allow_provider_model_fallback: bool | None = None
    """
    Allow a provider with an authoritative static model catalog to replace an unavailable requested model with its default.
    """
    approval_policy: AskForApproval | None = None
    approvals_reviewer: ApprovalsReviewer | None = None
    """
    Override where approval requests are routed for review on this thread and subsequent turns.
    """
    base_instructions: str | None = None
    config: dict[str, Any] | None = None
    cwd: str | None = None
    daybreak_enabled: bool | None = None
    """
    Initial Daybreak choice for this persistent thread. Omitted or null leaves it unset. This does not select a turn's `cyberAccessProgram` or grant access. Not supported for ephemeral threads.
    """
    developer_instructions: str | None = None
    dynamic_tools: list[DynamicToolSpec] | None = None
    environments: list[TurnEnvironmentParams] | None = None
    """
    Optional sticky environments for this thread.

    Omitted selects the default environment when environment access is enabled. Empty disables environment access for turns that do not provide a turn override. Non-empty selects the first environment as the current turn environment.
    """
    ephemeral: bool | None = None
    experimental_raw_events: bool | None = None
    """
    If true, opt into emitting raw Responses API items on the event stream. This is for internal use only (e.g. Codex Cloud).
    """
    history_mode: ThreadHistoryMode | None = None
    """
    Persisted thread history contract to use for this new thread.
    """
    mock_experimental_field: str | None = None
    """
    Test-only experimental field used to validate experimental gating and schema filtering behavior in a stable way.
    """
    model: str | None = None
    model_provider: str | None = None
    multi_agent_mode: MultiAgentMode | None = None
    """
    @deprecated Ignored. Use Ultra reasoning effort for proactive multi-agent behavior.
    """
    permissions: str | None = None
    """
    Named profile id for this thread. Cannot be combined with `sandbox`.
    """
    personality: Personality | None = None
    """
    @deprecated `friendly` and `pragmatic` no longer select a style.
    """
    project_id: str | None = None
    """
    Optional project identity for this new thread. Durable threads persist the assignment; ephemeral threads expose it only in live responses.
    """
    runtime_workspace_roots: list[AbsolutePathBuf] | None = None
    """
    Replace the thread's runtime workspace roots. Paths must be absolute.
    """
    sandbox: SandboxMode | None = None
    selected_capability_roots: list[SelectedCapabilityRoot] | None = None
    """
    Capability roots selected for this thread by the hosting platform.
    """
    service_name: str | None = None
    service_tier: str | None = None
    session_start_source: ThreadStartSource | None = None
    thread_source: ThreadSource | None = None
    """
    Optional client-supplied analytics source classification for this thread.
    """

allow_provider_model_fallback class-attribute instance-attribute

allow_provider_model_fallback: bool | None = None

Allow a provider with an authoritative static model catalog to replace an unavailable requested model with its default.

approvals_reviewer class-attribute instance-attribute

approvals_reviewer: ApprovalsReviewer | None = None

Override where approval requests are routed for review on this thread and subsequent turns.

daybreak_enabled class-attribute instance-attribute

daybreak_enabled: bool | None = None

Initial Daybreak choice for this persistent thread. Omitted or null leaves it unset. This does not select a turn's cyberAccessProgram or grant access. Not supported for ephemeral threads.

environments class-attribute instance-attribute

environments: list[TurnEnvironmentParams] | None = None

Optional sticky environments for this thread.

Omitted selects the default environment when environment access is enabled. Empty disables environment access for turns that do not provide a turn override. Non-empty selects the first environment as the current turn environment.

experimental_raw_events class-attribute instance-attribute

experimental_raw_events: bool | None = None

If true, opt into emitting raw Responses API items on the event stream. This is for internal use only (e.g. Codex Cloud).

history_mode class-attribute instance-attribute

history_mode: ThreadHistoryMode | None = None

Persisted thread history contract to use for this new thread.

mock_experimental_field class-attribute instance-attribute

mock_experimental_field: str | None = None

Test-only experimental field used to validate experimental gating and schema filtering behavior in a stable way.

multi_agent_mode class-attribute instance-attribute

multi_agent_mode: MultiAgentMode | None = None

@deprecated Ignored. Use Ultra reasoning effort for proactive multi-agent behavior.

permissions class-attribute instance-attribute

permissions: str | None = None

Named profile id for this thread. Cannot be combined with sandbox.

personality class-attribute instance-attribute

personality: Personality | None = None

@deprecated friendly and pragmatic no longer select a style.

project_id class-attribute instance-attribute

project_id: str | None = None

Optional project identity for this new thread. Durable threads persist the assignment; ephemeral threads expose it only in live responses.

runtime_workspace_roots class-attribute instance-attribute

runtime_workspace_roots: list[AbsolutePathBuf] | None = None

Replace the thread's runtime workspace roots. Paths must be absolute.

selected_capability_roots class-attribute instance-attribute

selected_capability_roots: list[SelectedCapabilityRoot] | None = None

Capability roots selected for this thread by the hosting platform.

thread_source class-attribute instance-attribute

thread_source: ThreadSource | None = None

Optional client-supplied analytics source classification for this thread.

ThreadStartedData

Bases: CodexBaseModel

Payload for thread/started notification (V2 protocol).

Source code in src/codexed/models/event_data.py
class ThreadStartedData(CodexBaseModel):
    """Payload for thread/started notification (V2 protocol)."""

    thread: Thread

    @property
    def thread_id(self) -> str:
        """Thread ID derived from the thread object."""
        return self.thread.id

thread_id property

thread_id: str

Thread ID derived from the thread object.

ThreadStartedEvent

Bases: CodexBaseModel

Thread started event.

Source code in src/codexed/models/events.py
class ThreadStartedEvent(CodexBaseModel):
    """Thread started event."""

    method: Literal["thread/started"] = "thread/started"
    params: ThreadStartedData

ThreadStatusChangedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadStatusChangedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/status/changed"] = "thread/status/changed"
    params: ThreadStatusChangedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ThreadTokenUsageUpdatedEvent

Bases: CodexBaseModel

Thread token usage updated event.

Source code in src/codexed/models/events.py
class ThreadTokenUsageUpdatedEvent(CodexBaseModel):
    """Thread token usage updated event."""

    method: Literal["thread/tokenUsage/updated"] = "thread/tokenUsage/updated"
    params: ThreadTokenUsageUpdatedNotification

    @property
    def total(self) -> TokenUsageBreakdown:
        """Total Token usage of the Thread."""
        return self.params.token_usage.total

    @property
    def last(self) -> TokenUsageBreakdown:
        """Token usage of last turn."""
        return self.params.token_usage.last

    @property
    def context_window(self) -> int | None:
        """Model context window."""
        return self.params.token_usage.model_context_window

context_window property

context_window: int | None

Model context window.

last property

last: TokenUsageBreakdown

Token usage of last turn.

total property

total: TokenUsageBreakdown

Total Token usage of the Thread.

ThreadTurnsListParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadTurnsListParams(CodexBaseModel):
    cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last turn.
    """
    items_view: TurnItemsView | None = None
    """
    How much item detail to include for each returned turn; defaults to summary.
    """
    limit: int | None = Field(None, ge=0)
    """
    Optional turn page size.
    """
    sort_direction: SortDirection | None = None
    """
    Optional turn pagination direction; defaults to descending.
    """
    thread_id: str

cursor class-attribute instance-attribute

cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last turn.

items_view class-attribute instance-attribute

items_view: TurnItemsView | None = None

How much item detail to include for each returned turn; defaults to summary.

limit class-attribute instance-attribute

limit: int | None = Field(None, ge=0)

Optional turn page size.

sort_direction class-attribute instance-attribute

sort_direction: SortDirection | None = None

Optional turn pagination direction; defaults to descending.

ThreadTurnsListResponse

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class ThreadTurnsListResponse(CodexBaseModel):
    backwards_cursor: str | None = None
    """
    Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one turn. Use it with the opposite `sortDirection` to include the anchor turn again and catch updates to that turn.
    """
    data: list[Turn]
    next_cursor: str | None = None
    """
    Opaque cursor to pass to the next call to continue after the last turn. if None, there are no more turns to return.
    """

backwards_cursor class-attribute instance-attribute

backwards_cursor: str | None = None

Opaque cursor to pass as cursor when reversing sortDirection. This is only populated when the page contains at least one turn. Use it with the opposite sortDirection to include the anchor turn again and catch updates to that turn.

next_cursor class-attribute instance-attribute

next_cursor: str | None = None

Opaque cursor to pass to the next call to continue after the last turn. if None, there are no more turns to return.

ThreadUnarchiveResponse

Bases: CodexBaseModel

Response for thread/unarchive request.

Source code in src/codexed/models/responses.py
class ThreadUnarchiveResponse(CodexBaseModel):
    """Response for thread/unarchive request."""

    thread: Thread

ThreadUnarchivedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class ThreadUnarchivedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["thread/unarchived"] = "thread/unarchived"
    params: ThreadUnarchivedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

ToolRequestUserInputAnswer

Bases: CodexBaseModel

A user's answer to a request_user_input question.

Source code in src/codexed/models/misc.py
class ToolRequestUserInputAnswer(CodexBaseModel):
    """A user's answer to a request_user_input question."""

    answers: list[str]

ToolRequestUserInputOption

Bases: CodexBaseModel

A selectable option for a user input question.

Source code in src/codexed/models/misc.py
class ToolRequestUserInputOption(CodexBaseModel):
    """A selectable option for a user input question."""

    label: str
    description: str

ToolRequestUserInputParams

Bases: CodexBaseModel

Parameters for item/tool/requestUserInput server request.

Source code in src/codexed/models/request_params.py
class ToolRequestUserInputParams(CodexBaseModel):
    """Parameters for item/tool/requestUserInput server request."""

    thread_id: str
    turn_id: str
    item_id: str
    questions: list[ToolRequestUserInputQuestion]

ToolRequestUserInputQuestion

Bases: CodexBaseModel

A question in a tool request for user input.

Source code in src/codexed/models/misc.py
class ToolRequestUserInputQuestion(CodexBaseModel):
    """A question in a tool request for user input."""

    id: str
    header: str
    question: str
    is_other: bool = False
    is_secret: bool = False
    options: list[ToolRequestUserInputOption] | None = None

    def to_schema_property(self) -> dict[str, Any]:
        """Convert a Codex user input question to a JSON Schema property.

        Maps question options to enum values, and handles secret/free-text questions.

        Args:
            question: Codex question with optional options list

        Returns:
            JSON Schema property definition
        """
        prop: dict[str, Any] = {"title": self.header or self.id}
        if self.question:
            prop["description"] = self.question

        if self.options and not self.is_other:
            # Question with fixed options -> enum
            prop["type"] = "string"
            prop["enum"] = [opt.label for opt in self.options]
        elif self.options and self.is_other:
            # Options with an "other" free-text fallback -> enum + freeform
            prop["type"] = "string"
            prop["enum"] = [opt.label for opt in self.options]
        else:
            # Free-text question
            prop["type"] = "string"

        if self.is_secret:
            prop["writeOnly"] = True

        return prop

to_schema_property

to_schema_property() -> dict[str, Any]

Convert a Codex user input question to a JSON Schema property.

Maps question options to enum values, and handles secret/free-text questions.

Parameters:

Name Type Description Default
question

Codex question with optional options list

required

Returns:

Type Description
dict[str, Any]

JSON Schema property definition

Source code in src/codexed/models/misc.py
def to_schema_property(self) -> dict[str, Any]:
    """Convert a Codex user input question to a JSON Schema property.

    Maps question options to enum values, and handles secret/free-text questions.

    Args:
        question: Codex question with optional options list

    Returns:
        JSON Schema property definition
    """
    prop: dict[str, Any] = {"title": self.header or self.id}
    if self.question:
        prop["description"] = self.question

    if self.options and not self.is_other:
        # Question with fixed options -> enum
        prop["type"] = "string"
        prop["enum"] = [opt.label for opt in self.options]
    elif self.options and self.is_other:
        # Options with an "other" free-text fallback -> enum + freeform
        prop["type"] = "string"
        prop["enum"] = [opt.label for opt in self.options]
    else:
        # Free-text question
        prop["type"] = "string"

    if self.is_secret:
        prop["writeOnly"] = True

    return prop

ToolRequestUserInputResponse

Bases: CodexBaseModel

Response for item/tool/requestUserInput server request.

Source code in src/codexed/models/responses.py
class ToolRequestUserInputResponse(CodexBaseModel):
    """Response for item/tool/requestUserInput server request."""

    answers: dict[str, ToolRequestUserInputAnswer]

ToolSearchToolConfig

Bases: _ToolConfigBase

Configuration for the tool_search tool (requires apps).

Source code in src/codexed/models/tool_config.py
class ToolSearchToolConfig(_ToolConfigBase):
    """Configuration for the tool_search tool (requires apps)."""

    type: Literal["tool_search"] = "tool_search"

ToolSuggestToolConfig

Bases: _ToolConfigBase

Configuration for the tool_suggest tool (requires discoverable tools).

Source code in src/codexed/models/tool_config.py
class ToolSuggestToolConfig(_ToolConfigBase):
    """Configuration for the tool_suggest tool (requires discoverable tools)."""

    type: Literal["tool_suggest"] = "tool_suggest"

Turn

Bases: CodexBaseModel

Turn data structure.

Source code in src/codexed/models/misc.py
class Turn(CodexBaseModel):
    """Turn data structure."""

    id: str

    completed_at: int | None = None
    """
    Unix timestamp (in seconds) when the turn completed.
    """
    duration_ms: int | None = None
    """
    Duration between turn start and completion in milliseconds, if known.
    """
    error: TurnError | None = None
    """
    Only populated when the Turn's status is failed.
    """
    items: list[ThreadItem]
    """
    Only populated on a `thread/resume` or `thread/fork` response.

    For all other responses and notifications returning a Turn,
    the items field will be an empty list.
    """
    started_at: int | None = None
    """
    Unix timestamp (in seconds) when the turn started.
    """
    status: TurnStatus

    @property
    def final_response(self) -> str | None:
        """Extract the final assistant response text from this turn.

        Looks for the last ``ThreadItemAgentMessage`` with ``phase="final_answer"``.
        Falls back to the last agent message with no phase (for models that don't
        emit phase metadata). Returns None if the turn has no agent messages.

        For structured output turns, this returns the raw JSON string.
        """
        last_unphased: str | None = None
        for item in reversed(self.items):
            match item:
                case ThreadItemAgentMessage(phase="final_answer", text=text):
                    return text
                case ThreadItemAgentMessage(phase=None, text=text) if last_unphased is None:
                    last_unphased = text
        return last_unphased

    items_view: TurnItemsView | None = None
    """How completely the turn's items are included in this payload."""
    root_turn_id: str | None = None

completed_at class-attribute instance-attribute

completed_at: int | None = None

Unix timestamp (in seconds) when the turn completed.

duration_ms class-attribute instance-attribute

duration_ms: int | None = None

Duration between turn start and completion in milliseconds, if known.

error class-attribute instance-attribute

error: TurnError | None = None

Only populated when the Turn's status is failed.

final_response property

final_response: str | None

Extract the final assistant response text from this turn.

Looks for the last ThreadItemAgentMessage with phase="final_answer". Falls back to the last agent message with no phase (for models that don't emit phase metadata). Returns None if the turn has no agent messages.

For structured output turns, this returns the raw JSON string.

items instance-attribute

items: list[ThreadItem]

Only populated on a thread/resume or thread/fork response.

For all other responses and notifications returning a Turn, the items field will be an empty list.

items_view class-attribute instance-attribute

items_view: TurnItemsView | None = None

How completely the turn's items are included in this payload.

started_at class-attribute instance-attribute

started_at: int | None = None

Unix timestamp (in seconds) when the turn started.

TurnCompletedData

Bases: CodexBaseModel

Payload for turn/completed notification (V2 protocol).

Source code in src/codexed/models/event_data.py
class TurnCompletedData(CodexBaseModel):
    """Payload for turn/completed notification (V2 protocol)."""

    thread_id: str
    turn: Turn

TurnCompletedEvent

Bases: CodexBaseModel

Turn completed event.

Source code in src/codexed/models/events.py
class TurnCompletedEvent(CodexBaseModel):
    """Turn completed event."""

    method: Literal["turn/completed"] = "turn/completed"
    params: TurnCompletedData

TurnData

Bases: CodexBaseModel

Turn data in responses.

Source code in src/codexed/models/misc.py
class TurnData(CodexBaseModel):
    """Turn data in responses."""

    id: str
    status: TurnStatus  # always provided by the server
    thread_id: str | None = None
    items: list[ThreadItem] = Field(default_factory=list)
    error: str | None = None
    items_view: TurnItemsView | None = None
    """How completely the turn's items are included in this payload."""
    root_turn_id: str | None = None
    started_at: int | None = None
    completed_at: int | None = None
    duration_ms: int | None = None

items_view class-attribute instance-attribute

items_view: TurnItemsView | None = None

How completely the turn's items are included in this payload.

TurnDiffUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class TurnDiffUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["turn/diff/updated"] = "turn/diff/updated"
    params: TurnDiffUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

TurnDiffUpdatedNotification

Bases: CodexBaseModel

Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.

Source code in src/codexed/models/v2_protocol.py
class TurnDiffUpdatedNotification(CodexBaseModel):
    """Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn."""

    diff: str
    thread_id: str
    turn_id: str

TurnEnvironmentParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TurnEnvironmentParams(CodexBaseModel):
    cwd: LegacyAppPathString
    environment_id: str
    runtime_workspace_roots: list[LegacyAppPathString] | None = None
    """
    Environment-native runtime workspace roots. Omitted defaults to `cwd`.
    """

runtime_workspace_roots class-attribute instance-attribute

runtime_workspace_roots: list[LegacyAppPathString] | None = None

Environment-native runtime workspace roots. Omitted defaults to cwd.

TurnError

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TurnError(CodexBaseModel):
    additional_details: str | None = None
    codex_error_info: CodexErrorInfo | None = None
    message: str
    misalignment: MisalignmentErrorDetails | None = None
    """
    Optional public explanation and continuation instruction for a misalignment block.
    """

misalignment class-attribute instance-attribute

misalignment: MisalignmentErrorDetails | None = None

Optional public explanation and continuation instruction for a misalignment block.

TurnPlanUpdatedMessage

Bases: CodexBaseModel

Notification sent from the server to the client.

Source code in src/codexed/models/v2_protocol.py
class TurnPlanUpdatedMessage(CodexBaseModel):
    """Notification sent from the server to the client."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["turn/plan/updated"] = "turn/plan/updated"
    params: TurnPlanUpdatedNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

TurnStartParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TurnStartParams(CodexBaseModel):
    additional_context: dict[str, Any] | None = None
    """
    Optional client-provided context fragments keyed by an opaque source identifier.
    """
    approval_policy: AskForApproval | None = None
    """
    Override the approval policy for this turn and subsequent turns.
    """
    approvals_reviewer: ApprovalsReviewer | None = None
    """
    Override where approval requests are routed for review on this turn and subsequent turns.
    """
    client_user_message_id: str | None = None
    collaboration_mode: CollaborationMode | None = None
    """
    EXPERIMENTAL - Set a pre-set collaboration mode. Takes precedence over model, reasoning_effort, and developer instructions if set.

    For `collaboration_mode.settings.developer_instructions`, `null` means "use the built-in instructions for the selected mode".
    """
    cwd: str | None = None
    """
    Override the working directory for this turn and subsequent turns.
    """
    cyber_access_program: CyberAccessProgram | None = None
    """
    EXPERIMENTAL - Request an authorized cyber program for this turn. Omission preserves automatic behavior. This does not grant access.
    """
    disabled_plugin_ids: list[str] | None = None
    """
    Replace this thread's disabled plugin IDs. Omitted/null preserves the list; [] clears it.
    """
    effort: ReasoningEffort | None = None
    """
    Override the reasoning effort for this turn and subsequent turns.
    """
    environments: list[TurnEnvironmentParams] | None = None
    """
    Optional environments for this turn and subsequent turns.

    Omitted uses the thread sticky environments. Empty disables environment access for this turn. Non-empty selects the first environment as the current turn environment for this turn.
    """
    input: list[UserInput]
    model: str | None = None
    """
    Override the model for this turn and subsequent turns.
    """
    multi_agent_mode: MultiAgentMode | None = None
    """
    @deprecated Ignored. Use `effort: "ultra"` for proactive multi-agent behavior.
    """
    output_schema: Any | None = None
    """
    Optional JSON Schema used to constrain the final assistant message for this turn.
    """
    parent_turn_id: str | None = None
    """
    ID of the turn that caused this new turn to start.

    Set this when starting work on behalf of another turn, such as delegated work in a different thread. Leave unset for work started directly by the user. Ignored when this request adds input to an active turn.
    """
    permissions: str | None = None
    """
    Select a named permissions profile id for this turn and subsequent turns. Cannot be combined with `sandboxPolicy`.
    """
    personality: Personality | None = None
    """
    @deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.
    """
    responsesapi_client_metadata: dict[str, Any] | None = None
    """
    Optional metadata to enrich Codex's ResponsesAPI turn metadata. Replaces unprotected client-provided entries when supplied; an empty map clears them.

    Entries are flattened into the JSON string sent as `client_metadata["x-codex-turn-metadata"]` on ResponsesAPI HTTP and websocket requests.

    They are not sent as top-level ResponsesAPI `client_metadata` keys, and reserved keys such as `session_id`, `thread_id`, `turn_id`, and `window_id` cannot be overridden.
    """
    responsesapi_client_metadata_patch: dict[str, Any] | None = None
    """
    Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after `responsesapiClientMetadata` if both are provided; reserved keys remain protected.
    """
    root_turn_id: str | None = None
    """
    ID of the first turn in the chain of work that led to this new turn.

    When setting `parentTurnId`, set this to the parent turn's `rootTurnId` when known. This keeps descendant work attributed to the original turn. If omitted, the new turn becomes its own root. Ignored when this request adds input to an active turn.
    """
    runtime_workspace_roots: list[AbsolutePathBuf] | None = None
    """
    Replace the thread's runtime workspace roots for this turn and subsequent turns. Paths must be absolute.
    """
    sandbox_policy: SandboxPolicy | None = None
    """
    Override the sandbox policy for this turn and subsequent turns.
    """
    service_tier: str | None = None
    """
    Override the service tier for this turn and subsequent turns.
    """
    service_tier_for_turn: str | None = None
    """
    Override the service tier only when this request starts a new turn. Use "default" for standard speed. Omitted or null inherits the thread's tier. Does not change the thread's tier or a turn being steered.
    """
    summary: ReasoningSummary | None = None
    """
    Override the reasoning summary for this turn and subsequent turns.
    """
    thread_id: str
    tool_output: TurnToolOutput | None = None
    turn_trigger: str | None = None
    """
    Optional source classification for the caller that starts this turn. Ignored when this request steers an already-active turn.
    """

additional_context class-attribute instance-attribute

additional_context: dict[str, Any] | None = None

Optional client-provided context fragments keyed by an opaque source identifier.

approval_policy class-attribute instance-attribute

approval_policy: AskForApproval | None = None

Override the approval policy for this turn and subsequent turns.

approvals_reviewer class-attribute instance-attribute

approvals_reviewer: ApprovalsReviewer | None = None

Override where approval requests are routed for review on this turn and subsequent turns.

collaboration_mode class-attribute instance-attribute

collaboration_mode: CollaborationMode | None = None

EXPERIMENTAL - Set a pre-set collaboration mode. Takes precedence over model, reasoning_effort, and developer instructions if set.

For collaboration_mode.settings.developer_instructions, null means "use the built-in instructions for the selected mode".

cwd class-attribute instance-attribute

cwd: str | None = None

Override the working directory for this turn and subsequent turns.

cyber_access_program class-attribute instance-attribute

cyber_access_program: CyberAccessProgram | None = None

EXPERIMENTAL - Request an authorized cyber program for this turn. Omission preserves automatic behavior. This does not grant access.

disabled_plugin_ids class-attribute instance-attribute

disabled_plugin_ids: list[str] | None = None

Replace this thread's disabled plugin IDs. Omitted/null preserves the list; [] clears it.

effort class-attribute instance-attribute

effort: ReasoningEffort | None = None

Override the reasoning effort for this turn and subsequent turns.

environments class-attribute instance-attribute

environments: list[TurnEnvironmentParams] | None = None

Optional environments for this turn and subsequent turns.

Omitted uses the thread sticky environments. Empty disables environment access for this turn. Non-empty selects the first environment as the current turn environment for this turn.

model class-attribute instance-attribute

model: str | None = None

Override the model for this turn and subsequent turns.

multi_agent_mode class-attribute instance-attribute

multi_agent_mode: MultiAgentMode | None = None

@deprecated Ignored. Use effort: "ultra" for proactive multi-agent behavior.

output_schema class-attribute instance-attribute

output_schema: Any | None = None

Optional JSON Schema used to constrain the final assistant message for this turn.

parent_turn_id class-attribute instance-attribute

parent_turn_id: str | None = None

ID of the turn that caused this new turn to start.

Set this when starting work on behalf of another turn, such as delegated work in a different thread. Leave unset for work started directly by the user. Ignored when this request adds input to an active turn.

permissions class-attribute instance-attribute

permissions: str | None = None

Select a named permissions profile id for this turn and subsequent turns. Cannot be combined with sandboxPolicy.

personality class-attribute instance-attribute

personality: Personality | None = None

@deprecated friendly and pragmatic no longer select a style. Changing this does not rewrite the thread's existing instructions.

responsesapi_client_metadata class-attribute instance-attribute

responsesapi_client_metadata: dict[str, Any] | None = None

Optional metadata to enrich Codex's ResponsesAPI turn metadata. Replaces unprotected client-provided entries when supplied; an empty map clears them.

Entries are flattened into the JSON string sent as client_metadata["x-codex-turn-metadata"] on ResponsesAPI HTTP and websocket requests.

They are not sent as top-level ResponsesAPI client_metadata keys, and reserved keys such as session_id, thread_id, turn_id, and window_id cannot be overridden.

responsesapi_client_metadata_patch class-attribute instance-attribute

responsesapi_client_metadata_patch: dict[str, Any] | None = None

Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after responsesapiClientMetadata if both are provided; reserved keys remain protected.

root_turn_id class-attribute instance-attribute

root_turn_id: str | None = None

ID of the first turn in the chain of work that led to this new turn.

When setting parentTurnId, set this to the parent turn's rootTurnId when known. This keeps descendant work attributed to the original turn. If omitted, the new turn becomes its own root. Ignored when this request adds input to an active turn.

runtime_workspace_roots class-attribute instance-attribute

runtime_workspace_roots: list[AbsolutePathBuf] | None = None

Replace the thread's runtime workspace roots for this turn and subsequent turns. Paths must be absolute.

sandbox_policy class-attribute instance-attribute

sandbox_policy: SandboxPolicy | None = None

Override the sandbox policy for this turn and subsequent turns.

service_tier class-attribute instance-attribute

service_tier: str | None = None

Override the service tier for this turn and subsequent turns.

service_tier_for_turn class-attribute instance-attribute

service_tier_for_turn: str | None = None

Override the service tier only when this request starts a new turn. Use "default" for standard speed. Omitted or null inherits the thread's tier. Does not change the thread's tier or a turn being steered.

summary class-attribute instance-attribute

summary: ReasoningSummary | None = None

Override the reasoning summary for this turn and subsequent turns.

turn_trigger class-attribute instance-attribute

turn_trigger: str | None = None

Optional source classification for the caller that starts this turn. Ignored when this request steers an already-active turn.

TurnStartResponse

Bases: CodexBaseModel

Response for turn/start request.

Source code in src/codexed/models/responses.py
class TurnStartResponse(CodexBaseModel):
    """Response for turn/start request."""

    turn: TurnData

TurnStartedData

Bases: CodexBaseModel

Payload for turn/started notification (V2 protocol).

Source code in src/codexed/models/event_data.py
class TurnStartedData(CodexBaseModel):
    """Payload for turn/started notification (V2 protocol)."""

    thread_id: str
    turn: Turn

TurnStartedEvent

Bases: CodexBaseModel

Turn started event.

Source code in src/codexed/models/events.py
class TurnStartedEvent(CodexBaseModel):
    """Turn started event."""

    method: Literal["turn/started"] = "turn/started"
    params: TurnStartedData

TurnSteerParams

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class TurnSteerParams(CodexBaseModel):
    additional_context: dict[str, Any] | None = None
    """
    Optional client-provided context fragments keyed by an opaque source identifier.
    """
    client_user_message_id: str | None = None
    expected_turn_id: str
    """
    Required active turn id precondition. The request fails when it does not match the currently active turn.
    """
    input: list[UserInput]
    responsesapi_client_metadata: dict[str, Any] | None = None
    """
    Optional metadata to enrich Codex's ResponsesAPI turn metadata. Replaces unprotected client-provided entries when supplied; an empty map clears them.

    Entries are flattened into the JSON string sent as `client_metadata["x-codex-turn-metadata"]` on ResponsesAPI HTTP and websocket requests.

    They are not sent as top-level ResponsesAPI `client_metadata` keys, and reserved keys such as `session_id`, `thread_id`, `turn_id`, and `window_id` cannot be overridden.
    """
    responsesapi_client_metadata_patch: dict[str, Any] | None = None
    """
    Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after `responsesapiClientMetadata` if both are provided; reserved keys remain protected.
    """
    thread_id: str

additional_context class-attribute instance-attribute

additional_context: dict[str, Any] | None = None

Optional client-provided context fragments keyed by an opaque source identifier.

expected_turn_id instance-attribute

expected_turn_id: str

Required active turn id precondition. The request fails when it does not match the currently active turn.

responsesapi_client_metadata class-attribute instance-attribute

responsesapi_client_metadata: dict[str, Any] | None = None

Optional metadata to enrich Codex's ResponsesAPI turn metadata. Replaces unprotected client-provided entries when supplied; an empty map clears them.

Entries are flattened into the JSON string sent as client_metadata["x-codex-turn-metadata"] on ResponsesAPI HTTP and websocket requests.

They are not sent as top-level ResponsesAPI client_metadata keys, and reserved keys such as session_id, thread_id, turn_id, and window_id cannot be overridden.

responsesapi_client_metadata_patch class-attribute instance-attribute

responsesapi_client_metadata_patch: dict[str, Any] | None = None

Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after responsesapiClientMetadata if both are provided; reserved keys remain protected.

UncommittedChangesReviewTarget

Bases: CodexBaseModel

Review the working tree: staged, unstaged, and untracked files.

Source code in src/codexed/models/v2_protocol.py
class UncommittedChangesReviewTarget(CodexBaseModel):
    """Review the working tree: staged, unstaged, and untracked files."""

    type: Literal["uncommittedChanges"] = "uncommittedChanges"

ViewImageToolConfig

Bases: _ToolConfigBase

Configuration for the view_image tool.

Source code in src/codexed/models/tool_config.py
class ViewImageToolConfig(_ToolConfigBase):
    """Configuration for the view_image tool."""

    type: Literal["view_image"] = "view_image"

WarningNotification

Bases: CodexBaseModel

Source code in src/codexed/models/v2_protocol.py
class WarningNotification(CodexBaseModel):
    message: str
    """
    Concise warning message for the user.
    """
    thread_id: str | None = None
    """
    Optional thread target when the warning applies to a specific thread.
    """

message instance-attribute

message: str

Concise warning message for the user.

thread_id class-attribute instance-attribute

thread_id: str | None = None

Optional thread target when the warning applies to a specific thread.

WebSearchToolConfig

Bases: _ToolConfigBase

Configuration for the web_search tool.

Source code in src/codexed/models/tool_config.py
class WebSearchToolConfig(_ToolConfigBase):
    """Configuration for the web_search tool."""

    type: Literal["web_search"] = "web_search"

    mode: WebSearchMode | None = None
    """Search mode."""

    context_size: WebSearchContextSize | None = None
    """Amount of context returned from search results."""

    allowed_domains: list[str] | None = None
    """Restrict search to these domains only."""

    location: WebSearchLocation | None = None
    """Approximate user location for localised results."""

allowed_domains class-attribute instance-attribute

allowed_domains: list[str] | None = None

Restrict search to these domains only.

context_size class-attribute instance-attribute

context_size: WebSearchContextSize | None = None

Amount of context returned from search results.

location class-attribute instance-attribute

location: WebSearchLocation | None = None

Approximate user location for localised results.

mode class-attribute instance-attribute

mode: WebSearchMode | None = None

Search mode.

WindowsWorldWritableWarningMessage

Bases: CodexBaseModel

Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.

Source code in src/codexed/models/v2_protocol.py
class WindowsWorldWritableWarningMessage(CodexBaseModel):
    """Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox."""

    emitted_at_ms: int | None = None
    """
    Unix timestamp (in milliseconds) when app-server emitted this notification.
    """
    method: Literal["windows/worldWritableWarning"] = "windows/worldWritableWarning"
    params: WindowsWorldWritableWarningNotification

emitted_at_ms class-attribute instance-attribute

emitted_at_ms: int | None = None

Unix timestamp (in milliseconds) when app-server emitted this notification.

tools_to_config_dict

tools_to_config_dict(tools: list[ToolConfig]) -> dict[str, Any]

Convert a list of tool configs into the config dict for ThreadStartParams.

Each tool config contributes its settings to the appropriate config keys. An empty list explicitly disables all builtin tools.

Example::

config = tools_to_config_dict([])  # disable all tools
config = tools_to_config_dict([    # enable only these
    WebSearchToolConfig(mode="live", context_size="high"),
    JsReplToolConfig(),
])
Source code in src/codexed/models/tool_config.py
def tools_to_config_dict(tools: list[ToolConfig]) -> dict[str, Any]:
    """Convert a list of tool configs into the ``config`` dict for ``ThreadStartParams``.

    Each tool config contributes its settings to the appropriate config keys.
    An empty list explicitly disables all builtin tools.

    Example::

        config = tools_to_config_dict([])  # disable all tools
        config = tools_to_config_dict([    # enable only these
            WebSearchToolConfig(mode="live", context_size="high"),
            JsReplToolConfig(),
        ])
    """
    if not tools:
        return _disable_all_tools()

    features: dict[str, bool] = {}
    config: dict[str, Any] = {}
    tools_section: dict[str, Any] = {}
    experimental_tools: list[str] = []

    for tool in tools:
        match tool:
            case ShellToolConfig(allow_login_shell=allow_login):
                features["shell_tool"] = True
                if allow_login is not None:
                    config["allow_login_shell"] = allow_login

            case ApplyPatchToolConfig(variant=variant):
                config["include_apply_patch_tool"] = True
                match variant:
                    case "freeform":
                        features["apply_patch_freeform"] = True
                    case "function":
                        features["apply_patch_freeform"] = False
                    case None:
                        pass
                    case _ as unreachable:
                        assert_never(unreachable)

            case WebSearchToolConfig(
                mode=mode,
                context_size=context_size,
                allowed_domains=allowed_domains,
                location=location,
            ):
                if mode is not None:
                    config["web_search"] = mode
                ws_config: dict[str, Any] = {}
                if context_size is not None:
                    ws_config["context_size"] = context_size
                if allowed_domains is not None:
                    ws_config["allowed_domains"] = allowed_domains
                if location is not None and (loc := location.model_dump(exclude_none=True)):
                    ws_config["location"] = loc
                if ws_config:
                    tools_section["web_search"] = ws_config

            case ImageGenerationToolConfig():
                features["image_generation"] = True

            case ViewImageToolConfig():
                tools_section["view_image"] = True

            case JsReplToolConfig():
                features["js_repl"] = True

            case CollabToolsConfig():
                features["multi_agent"] = True

            case AgentJobsToolsConfig():
                features["enable_fanout"] = True

            case RequestPermissionsToolConfig():
                features["request_permissions_tool"] = True

            case ArtifactsToolConfig():
                features["artifact"] = True

            case ToolSuggestToolConfig():
                features["tool_suggest"] = True

            case GrepFilesToolConfig():
                experimental_tools.append("grep_files")

            case ReadFileToolConfig():
                experimental_tools.append("read_file")

            case ListDirToolConfig():
                experimental_tools.append("list_dir")

            case (
                PlanToolConfig()
                | RequestUserInputToolConfig()
                | ToolSearchToolConfig()
                | McpResourceToolsConfig()
            ):
                pass  # No config keys to emit for these currently

    if features:
        config["features"] = features
    if tools_section:
        config["tools"] = tools_section
    if experimental_tools:
        config["experimental_supported_tools"] = experimental_tools

    return config