Skip to content

Thread

Base classes

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

⋔ Inheritance diagram

graph TD
  3916687912["misc.Thread"]
  3116041069["base.CodexBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3116041069 --> 3916687912
  3879467795 --> 3116041069
  2751680898 --> 3879467795

🛈 DocStrings

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.

:fa-brands-github: Show source on GitHub