pub struct CodexHandler { /* private fields */ }Expand description
Starts and resumes Codex through its app-server protocol.
Trait Implementations§
Source§impl AgentHandler for CodexHandler
impl AgentHandler for CodexHandler
Source§fn stdio(&self) -> Result<HarnessStdio, ProviderError>
fn stdio(&self) -> Result<HarnessStdio, ProviderError>
codex app-server speaks JSON-RPC, one message per line, over standard input and output.
Source§fn session_commands(&self) -> Result<SessionCommands, ProviderError>
fn session_commands(&self) -> Result<SessionCommands, ProviderError>
The app server compacts a thread on request (thread/compact/start) and opens another
thread on request (thread/start), which is a clear that keeps the process.
Source§fn run_record(
&self,
query: RunRecordQuery,
) -> Result<Option<RunRecordFile>, ProviderError>
fn run_record( &self, query: RunRecordQuery, ) -> Result<Option<RunRecordFile>, ProviderError>
Codex keeps each thread as a rollout file, one JSON object per line.
Source§fn start_options(
&self,
environment: BTreeMap<String, String>,
) -> Result<StartOptions, ProviderError>
fn start_options( &self, environment: BTreeMap<String, String>, ) -> Result<StartOptions, ProviderError>
The app server’s model/list and thread/list: the models Codex offers the account
behind environment (its CODEX_HOME login or API key) with the efforts each takes, and
the threads it holds, before any model turn. With no login it answers from the catalog it
ships with, so the list is what Codex offers, not a check of the account. Its modes are
the harness-neutral ones coqui-acp-codex maps to an approval policy and a sandbox;
Codex has no other option to choose.
Source§fn usage_support(&self) -> Result<UsageSupport, ProviderError>
fn usage_support(&self) -> Result<UsageSupport, ProviderError>
Codex reports each request’s tokens and the account’s rate-limit windows as a turn goes,
and its app server answers account/rateLimits/read with no turn, so a Station may poll it.
Source§fn usage(
&self,
environment: BTreeMap<String, String>,
) -> Result<UsageReport, ProviderError>
fn usage( &self, environment: BTreeMap<String, String>, ) -> Result<UsageReport, ProviderError>
Starts an app server with environment, reads the account’s rate limits and ends it: no
thread is opened and no model turn is spent. A Codex that is not signed in with an account
that has allowances is an error, not an empty report.
Source§fn assistant_scripts(
&self,
environment: BTreeMap<String, String>,
) -> Result<Option<String>, ProviderError>
fn assistant_scripts( &self, environment: BTreeMap<String, String>, ) -> Result<Option<String>, ProviderError>
Asks Codex to run a command in the sandbox an assistant’s scripts would get (codex sandbox -P, no model involved; on Windows MXC), with environment; the answer stands
15 minutes per executable and configuration environment.
Source§fn assistant_network(&self) -> Result<Option<String>, ProviderError>
fn assistant_network(&self) -> Result<Option<String>, ProviderError>
An assistant has no web tool, and its scripts have no network under any policy.
Source§fn loadout_support(&self) -> Result<LoadoutSupport, ProviderError>
fn loadout_support(&self) -> Result<LoadoutSupport, ProviderError>
Codex takes stdio MCP servers and disables a server’s tools by name; a permission profile limits its commands’ writes and gives them no network, where its sandbox runs; it has no host list.
Source§fn read_only_refusal(&self) -> Result<Option<String>, ProviderError>
fn read_only_refusal(&self) -> Result<Option<String>, ProviderError>
READ_CLEARANCE and then
give it the Mission’s tools on a resume of the same Run, in a sentence; None when it
can. The default: it cannot say it can, so a Mission whose plan is reviewed does not start
on it.Source§fn program(&self) -> Result<Option<String>, ProviderError>
fn program(&self) -> Result<Option<String>, ProviderError>
PATH or a
path, so a Station can say a harness cannot be found before it asks a terminal to start
it. The default: None, and the Station does not look.Source§fn assistant_skills(&self) -> Result<Option<String>, ProviderError>
fn assistant_skills(&self) -> Result<Option<String>, ProviderError>
AssistantMode::skills and no
other skill: None when it can, else why not, in a sentence; a Station installs no
skill for a handler that cannot. The default: it cannot.Source§fn start(
&self,
request: AgentStart,
terminal: Object<dyn AgentTerminal>,
) -> Result<Object<dyn AgentSession>, ProviderError>
fn start( &self, request: AgentStart, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>
Source§fn resume(
&self,
request: AgentResume,
terminal: Object<dyn AgentTerminal>,
) -> Result<Object<dyn AgentSession>, ProviderError>
fn resume( &self, request: AgentResume, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>
Source§fn weakenings(&self) -> Result<Vec<String>, ProviderError>
fn weakenings(&self) -> Result<Vec<String>, ProviderError>
Source§fn clearance_refusal(
&self,
clearance: String,
) -> Result<Option<String>, ProviderError>
fn clearance_refusal( &self, clearance: String, ) -> Result<Option<String>, ProviderError>
clearance, in a
sentence; None when it holds such a Run to what the clearance promises. A route of
an Agent that would be refused is passed over. The default: it can hold any.Source§fn image_input(&self) -> Result<Option<String>, ProviderError>
fn image_input(&self) -> Result<Option<String>, ProviderError>
None when it reads a message in
the content form, and gives its images to the model with the text. The
default: it cannot.