Runtime commands¶
octomate.schemas.commands ¶
Runtime command catalogs and explicit invocations, separate from chat text.
CommandOutcome
module-attribute
¶
CommandContext
dataclass
¶
Server-resolved context shared by discovery and execution.
The caller authorizes the user and resolves the selected conversation and effective workspace before calling an adapter. A native transcript's session handle alone does not grant permission to drive that runtime.
Source code in octomate/schemas/commands.py
agent_id
instance-attribute
¶
agent_id: Annotated[
str,
Field(
min_length=1,
description="The configured agent owning this context.",
),
]
user_id
instance-attribute
¶
user_id: Annotated[
UUID,
Field(
description="The authenticated Octomate user, not a platform sender id."
),
]
address
instance-attribute
¶
address: Annotated[
ChannelAddress,
Field(
description="The originating surface and its platform user."
),
]
cwd
instance-attribute
¶
cwd: Annotated[
Path | None,
Field(
description="The effective runtime workspace, never a client-supplied path; null before a thread exists. Discovery must not prepare this directory."
),
]
conversation
instance-attribute
¶
conversation: Annotated[
Conversation | None,
Field(
description="None while composing a new conversation."
),
]
model
class-attribute
instance-attribute
¶
model: Annotated[
str | None,
Field(
description="The selected runtime model, resolved by the host."
),
] = None
permission_mode
class-attribute
instance-attribute
¶
permission_mode: Annotated[
str | None,
Field(
description="The effective runtime approval posture."
),
] = None
matches ¶
Whether a resolved context can reuse this context's catalog.
Source code in octomate/schemas/commands.py
CommandDescriptor
pydantic-model
¶
Bases: BaseModel
The fields channels consume for runtime commands and skills.
Tentacles subclass this model for typed runtime metadata. Catalog serialization preserves those fields, but channels depend only on this base. Rehydrate an extended descriptor with its tentacle's concrete model, not this base model. Descriptors are frozen; runtime extensions must use hashable field values.
Fields:
-
id(str) -
name(str) -
description(str) -
argument_hint(str | None) -
requires_conversation(bool) -
unavailable_reason(str | None) -
unavailable_kind(Literal['context', 'unsupported']) -
accepts_attachments(bool | None)
Source code in octomate/schemas/commands.py
id
pydantic-field
¶
Opaque identity, stable and unique within the agent's scoped catalog. The tentacle maps it to the upstream invocation.
argument_hint
pydantic-field
¶
Upstream free-form input hint, when provided.
requires_conversation
pydantic-field
¶
Whether execution needs an existing conversation. False permits a direct outcome before a conversation exists, without creating a thread, run or delivery receipt. An adapter must not start an agent run in that context.
unavailable_reason
pydantic-field
¶
Why a known command cannot execute through this adapter. Null means available, subject to context requirements. Channels display disabled entries with this reason; the host refuses their execution.
unavailable_kind
pydantic-field
¶
Classifies unavailable_reason: context means a supported command is blocked by the current session or configuration; unsupported means this adapter does not implement it. Ignored when unavailable_reason is null. Channels decide whether they provide their own handling.
accepts_attachments
pydantic-field
¶
Whether attached input is supported; null means unspecified. Channels offer attachments only when this is explicitly true.
CommandCatalog
pydantic-model
¶
Bases: BaseModel
Runtime descriptors and their discovery state in one resolved context.
Fields:
-
context(CommandContext) -
descriptors(set[SerializeAsAny[CommandDescriptor]]) -
status(Literal['ready', 'loading', 'unsupported', 'unavailable', 'failed']) -
message(str | None) -
limitations(list[str])
Validators:
Source code in octomate/schemas/commands.py
descriptors
pydantic-field
¶
Unique known runtime entries, with no ordering guarantee. Runtime-specific descriptor subclasses retain their additional fields; empty unless ready.
status
pydantic-field
¶
Discovery state; ready with no descriptors is a successful empty catalog.
message
pydantic-field
¶
Required explanation when discovery cannot supply a catalog.
limitations
pydantic-field
¶
User-visible discovery gaps, such as skills without native slash commands.
valid_discovery_state
pydantic-validator
¶
Only ready catalogs contain descriptors; failed discovery explains why.
Source code in octomate/schemas/commands.py
snapshot ¶
Copy catalog data without deep-copying the conversation's database state.
Source code in octomate/schemas/commands.py
CommandInvocation
pydantic-model
¶
Bases: BaseModel
Explicit command intent; ordinary chat text does not use this contract.
The caller must revalidate catalog membership and attachment support before dispatch. Attachments here are already resolved by the host, not arbitrary client paths.
Fields:
-
command_id(str) -
arguments(str) -
attachments(list[Annotated[ImageSegment | FileSegment, Field(discriminator=type)]])
Source code in octomate/schemas/commands.py
CommandResult
pydantic-model
¶
Bases: BaseModel
A direct command's user-visible output, without a fabricated model turn.
Fields:
-
status(Literal['completed']) -
segments(list[MessageSegment])
Source code in octomate/schemas/commands.py
CommandError
pydantic-model
¶
Bases: BaseModel
An explicit refusal or failure; none of these outcomes falls back to chat.
Fields:
Source code in octomate/schemas/commands.py
CommandOutcomeEvent
pydantic-model
¶
Bases: BaseModel
The terminal command result, refusal or saved delivery outcome.
Fields:
-
event_kind(Literal['command_outcome']) -
outcome(CommandOutcome)
Source code in octomate/schemas/commands.py
octomate.tentacles.codex.schemas ¶
Codex model and command metadata and native protocol extensions.
CodexModelCatalog ¶
Bases: NamedTuple
Visible native models and the configured provider and defaults.
Source code in octomate/tentacles/codex/schemas.py
ThreadSettingsUpdateResponse
pydantic-model
¶
Bases: BaseModel
Native acknowledgement that a thread settings update was queued.
The SDK omits this experimental endpoint. Codex emits thread/settings/updated when the settings have been applied for future turns.
Source code in octomate/tentacles/codex/schemas.py
CodexCommandDescriptor
pydantic-model
¶
Bases: CommandDescriptor
An enabled Codex skill, identified by its native invocation path.
Fields:
-
id(str) -
name(str) -
description(str) -
argument_hint(str | None) -
requires_conversation(bool) -
unavailable_reason(str | None) -
unavailable_kind(Literal['context', 'unsupported']) -
accepts_attachments(bool | None) -
path(Path) -
scope(SkillScope) -
plugin_id(str | None)
Source code in octomate/tentacles/codex/schemas.py
octomate.tentacles.codex.catalog ¶
Known app/IDE commands, separate from dynamically discovered skills.
Codex implements these composer actions in its clients, not a commands/list RPC. Sources: https://learn.chatgpt.com/docs/reference/slash-commands and https://developers.openai.com/codex/ide/slash-commands.
APP_COMMANDS
module-attribute
¶
APP_COMMANDS: frozenset[CommandDescriptor] = frozenset(
(
CommandDescriptor(
id=f"builtin:{name}",
name=name,
description=description,
unavailable_reason=reason,
unavailable_kind="unsupported",
)
)
for name, description, reason in (
(
"cloud",
"Run in the cloud.",
"Cloud execution is not supported here.",
),
(
"cloud-environment",
"Choose a cloud environment.",
"Cloud environments are managed in Codex.",
),
(
"fast",
"Toggle fast execution.",
"Codex service-tier changes are not supported here yet.",
),
(
"feedback",
"Send feedback to OpenAI.",
"Use the feedback dialog in Codex.",
),
(
"ide-context",
"Toggle automatic editor context.",
"Editor context is managed in the Codex IDE extension.",
),
(
"local",
"Run in a local workspace.",
"Driven Codex runs already use the thread's workspace.",
),
(
"memories",
"Configure memory use and generation.",
"Codex memory settings are not supported here yet.",
),
(
"pet",
"Show or hide the desktop pet.",
"Desktop pets are managed in the Codex app.",
),
(
"personality",
"Choose a response style.",
"Codex personality changes are not supported here yet.",
),
(
"side",
"Open a temporary side conversation.",
"Side conversations are not supported here yet.",
),
)
) | frozenset(
{
CommandDescriptor(
id="builtin:model",
name="model",
description="Choose the conversation model.",
unavailable_reason="Codex's app-server does not expose a model selection command.",
unavailable_kind="unsupported",
requires_conversation=False,
),
CommandDescriptor(
id="builtin:project",
name="project",
description="Choose a project for a new conversation.",
unavailable_reason="Codex's app-server does not expose a project selection command.",
unavailable_kind="unsupported",
requires_conversation=False,
),
CommandDescriptor(
id="builtin:task",
name="task",
description="Start a conversation without a project.",
unavailable_reason="Codex's app-server does not expose a task command.",
unavailable_kind="unsupported",
requires_conversation=False,
),
CommandDescriptor(
id="builtin:worktree",
name="worktree",
description="Run in a new Git worktree.",
unavailable_reason="Codex's app-server does not expose a worktree command.",
unavailable_kind="unsupported",
requires_conversation=False,
),
CommandDescriptor(
id="builtin:approve",
name="approve",
description="Approve a denial from the latest run and retry it.",
argument_hint="[review-id]",
),
CommandDescriptor(
id="builtin:fork",
name="fork",
description="Copy this conversation into an independent thread.",
),
CommandDescriptor(
id="builtin:compact",
name="compact",
description="Compact the conversation context.",
),
CommandDescriptor(
id="builtin:review",
name="review",
description="Review uncommitted changes, or changes against a branch.",
argument_hint="[branch]",
),
CommandDescriptor(
id="builtin:init",
name="init",
description="Create project instructions in AGENTS.md.",
),
CommandDescriptor(
id="builtin:mcp",
name="mcp",
description="Inspect connected MCP servers.",
),
CommandDescriptor(
id="builtin:plan",
name="plan",
description="Enter or leave planning mode.",
argument_hint="[on|off]",
),
CommandDescriptor(
id="builtin:reasoning",
name="reasoning",
description="Choose the reasoning effort.",
argument_hint="[level]",
),
CommandDescriptor(
id="builtin:status",
name="status",
description="Inspect the conversation and its current settings.",
requires_conversation=False,
),
}
)
octomate.tentacles.claude.catalog.ClaudeCommandDescriptor
pydantic-model
¶
Bases: CommandDescriptor
A native initialize command normalized for the shared catalog.
Fields:
-
name(str) -
description(str) -
requires_conversation(bool) -
unavailable_reason(str | None) -
unavailable_kind(Literal['context', 'unsupported']) -
accepts_attachments(bool | None) -
id(str) -
argument_hint(str | None) -
aliases(tuple[str, ...])
Source code in octomate/tentacles/claude/catalog.py
octomate.tentacles.deepseek.catalog.DeepseekCommandDescriptor
pydantic-model
¶
Bases: CommandDescriptor
Native command metadata normalized for channel discovery.
Fields:
-
name(str) -
description(str) -
requires_conversation(bool) -
unavailable_reason(str | None) -
unavailable_kind(Literal['context', 'unsupported']) -
id(str) -
argument_hint(str | None) -
accepts_attachments(bool) -
definition_id(str | None)
Source code in octomate/tentacles/deepseek/catalog.py
octomate.tentacles.deepseek.wire.CommandSuccess
pydantic-model
¶
Bases: BaseModel
A command settled successfully, optionally referencing richer presentation.
Config:
default:PERMISSIVE
Fields:
-
kind(Literal['success']) -
text(str | None) -
source_event_seq(int | None)
Source code in octomate/tentacles/deepseek/wire.py
source_event_seq
pydantic-field
¶
Earlier session event that owns a richer presentation of this result.
octomate.tentacles.deepseek.wire.CommandError
pydantic-model
¶
Bases: BaseModel
A command-level refusal inside a successful Remote response.
Config:
default:PERMISSIVE
Fields:
Source code in octomate/tentacles/deepseek/wire.py
octomate.tentacles.deepseek.wire.CommandExecutionValue
pydantic-model
¶
Bases: BaseModel
A matched commands/execute result; Ink maps a null wire value to no match.
Config:
default:PERMISSIVE
Fields:
-
command_id(str) -
result(CommandResult)