Skip to content

TurnStartParams

Base classes

Name Children Inherits
CodexBaseModel
codexed.models.base
Base model for all Codex API models.

â‹” Inheritance diagram

graph TD
  3414575059["v2_protocol.TurnStartParams"]
  3116041069["base.CodexBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3116041069 --> 3414575059
  3879467795 --> 3116041069
  2751680898 --> 3879467795

🛈 DocStrings

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.

:fa-brands-github: Show source on GitHub