Skip to main content

CodexHandler

Struct CodexHandler 

Source
pub struct CodexHandler { /* private fields */ }
Expand description

Starts and resumes Codex through its app-server protocol.

Trait Implementations§

Source§

impl AgentHandler for CodexHandler

Source§

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>

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>

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>

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>

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>

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>

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>

An assistant has no web tool, and its scripts have no network under any policy.

Source§

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>

Why this handler cannot hold a Mission’s Run to reading at 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>

The program the harness is started as, a name looked up on the Run’s 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>

Whether the harness can load exactly an assistant’s 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>

Starts an Agent Run with context established before its task prompt. Read more
Source§

fn resume( &self, request: AgentResume, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>

Reattaches to the same provider ID after an interruption.
Source§

fn weakenings(&self) -> Result<Vec<String>, ProviderError>

Each way this handler’s settings are looser than its default, one line each, for the Station to report. The default: none.
Source§

fn clearance_refusal( &self, clearance: String, ) -> Result<Option<String>, ProviderError>

Why this handler, with its settings, would refuse a Mission’s Run at 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>

Why the harness cannot be shown images, in a sentence; None when it reads a message in the content form, and gives its images to the model with the text. The default: it cannot.
Source§

impl ProviderDecl for CodexHandler

Source§

const KINDS: &'static [&'static str]

The name of every kind this provider serves, so a library can declare them at compile time.
Source§

fn provider(host: Host, alloc: Alloc) -> Result<ProviderParts, ValueError>

Builds this provider’s descriptor, its tables and its configuration schema, once. host is what the library was loaded by; alloc is what the schema is built through.
Source§

impl TryFrom<CodexConfig> for CodexHandler

Source§

type Error = ProviderError

The type returned in the event of a conversion error.
Source§

fn try_from(config: CodexConfig) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoMaybeUndefined<T> for T

§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
§

impl<T> IntoOption<T> for T

§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more