Skip to content

ProcessSpawnParams

Base classes

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

⋔ Inheritance diagram

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

🛈 DocStrings

Bases: CodexBaseModel

Spawn a standalone process (argv vector) without a Codex sandbox on the host where the app server is running.

process/spawn returns after the process has started and the connection-scoped processHandle has been registered. Process output and exit are reported via process/outputDelta and process/exited notifications.

Source code in src/codexed/models/v2_protocol.py
class ProcessSpawnParams(CodexBaseModel):
    """Spawn a standalone process (argv vector) without a Codex sandbox on the host where the app server is running.

    `process/spawn` returns after the process has started and the connection-scoped `processHandle` has been registered. Process output and exit are reported via `process/outputDelta` and `process/exited` notifications.
    """

    command: list[str]
    """
    Command argv vector. Empty arrays are rejected.
    """
    cwd: AbsolutePathBuf
    """
    Absolute working directory for the process.
    """
    env: dict[str, Any] | None = None
    """
    Optional environment overrides merged into the app-server process 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. Set to `null` to disable the cap.
    """
    process_handle: str
    """
    Client-supplied, connection-scoped process handle.

    Duplicate active handles are rejected on the same connection. The same handle can be reused after the prior process exits.
    """
    size: ProcessTerminalSize | None = None
    """
    Optional initial PTY size in character cells. Only valid when `tty` is true.
    """
    stream_stdin: bool | None = None
    """
    Allow follow-up `process/writeStdin` requests to write stdin bytes.
    """
    stream_stdout_stderr: bool | None = None
    """
    Stream stdout/stderr via `process/outputDelta` notifications.

    Streamed bytes are not duplicated into the `process/exited` notification.
    """
    timeout_ms: int | None = None
    """
    Optional timeout in milliseconds.

    When omitted, the server default applies. Set to `null` to disable the timeout.
    """
    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 instance-attribute

Absolute working directory for the process.

env class-attribute instance-attribute

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

Optional environment overrides merged into the app-server process 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. Set to null to disable the cap.

process_handle instance-attribute

process_handle: str

Client-supplied, connection-scoped process handle.

Duplicate active handles are rejected on the same connection. The same handle can be reused after the prior process exits.

size class-attribute instance-attribute

size: ProcessTerminalSize | 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 process/writeStdin requests to write stdin bytes.

stream_stdout_stderr class-attribute instance-attribute

stream_stdout_stderr: bool | None = None

Stream stdout/stderr via process/outputDelta notifications.

Streamed bytes are not duplicated into the process/exited notification.

timeout_ms class-attribute instance-attribute

timeout_ms: int | None = None

Optional timeout in milliseconds.

When omitted, the server default applies. Set to null to disable the timeout.

tty class-attribute instance-attribute

tty: bool | None = None

Enable PTY mode.

This implies streamStdin and streamStdoutStderr.

:fa-brands-github: Show source on GitHub