Skip to content

ThreadItemCommandExecution

Base classes

Name Children Inherits
BaseThreadItem
codexed.models.thread_item
Base class for thread items.

⋔ Inheritance diagram

graph TD
  3674573179["thread_item.ThreadItemCommandExecution"]
  2083311648["thread_item.BaseThreadItem"]
  3116041069["base.CodexBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2083311648 --> 3674573179
  3116041069 --> 2083311648
  3879467795 --> 3116041069
  2751680898 --> 3879467795

🛈 DocStrings

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.

:fa-brands-github: Show source on GitHub