Skip to content

openagents_sdk::runs::commands

Commands delivered through the run host's existing device channel.

ItemWhat it does
CommandOutcome enumThe host's handling result.
CommandReceipt structA result bound to the caller's run and request ID.
CommandRefusal enumWhy a host could not accept a command.
RunCommand structThe body of POST /v1/runs/{id}/commands.
SessionCommand enumA change requested from a run's host.

CommandOutcome

pub enum CommandOutcome {
    Accepted,
    Refused { reason: CommandRefusal },
}

The host's handling result.

CommandReceipt

pub struct CommandReceipt {
    pub run: String,
    pub request_id: String,
    pub outcome: CommandOutcome,
}

A result bound to the caller's run and request ID.

CommandRefusal

pub enum CommandRefusal {
    NotSteerable,
    NoGrant,
    RunEnded,
    Offline,
    Unavailable,
}

Why a host could not accept a command.

RunCommand

pub struct RunCommand {
    pub request_id: String,
    pub command: SessionCommand,
}

The body of POST /v1/runs/{id}/commands. Keep this exact body on retry.

RunCommand::valid

pub fn valid(&self) -> bool

Whether the request ID and command meet the API's bounds.

SessionCommand

pub enum SessionCommand {
    Message { text: String },
    Steer { text: String },
    Stop,
    Restart { brief: Option<String> },
}

A change requested from a run's host. Acceptance means the host recorded the command; it does not mean a turn finished.

SessionCommand::valid

pub fn valid(&self) -> bool

Whether text fits the command's limits: nonblank, at most 16 KiB, no NUL.