pub struct CodexRunner;Expand description
Adapter for OpenAI Codex CLI (codex binary).
Headless invocation:
codex exec –json “
Stream format: NDJSON with event types:
- { type: “thread.started”, thread_id }
- { type: “turn.started” }
- { type: “item.started”, item: { id, type: “command_execution”, command, status: “in_progress”, … } }
- { type: “item.completed”, item: { id, type: “agent_message”|“command_execution”|“reasoning”, … } }
- { type: “turn.completed”, usage: { input_tokens, cached_input_tokens, output_tokens } }
- { type: “turn.failed”, error }
- { type: “error”, message }
Trait Implementations§
Source§impl AgentRunner for CodexRunner
impl AgentRunner for CodexRunner
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check whether the agent binary is available on the system.
Source§fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
fn binary_path(&self, config: &TaskConfig) -> Result<PathBuf>
Resolve the binary path (user override or PATH lookup).
Source§fn build_args(&self, config: &TaskConfig) -> Vec<String>
fn build_args(&self, config: &TaskConfig) -> Vec<String>
Build the command-line arguments for the agent process.
Source§fn build_env(&self, _config: &TaskConfig) -> Vec<(String, String)>
fn build_env(&self, _config: &TaskConfig) -> Vec<(String, String)>
Build the environment variables for the agent process.
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 TaskConfig,
cancel_token: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<StreamHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the task and return a
StreamHandle with event stream and cancel token.Source§fn capabilities(&self) -> AgentCapabilities
fn capabilities(&self) -> AgentCapabilities
What features this agent supports.
Source§fn version(&self, config: &TaskConfig) -> Option<String>
fn version(&self, config: &TaskConfig) -> Option<String>
Get the version of the installed agent binary.
Source§fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
fn validate_config(&self, config: &TaskConfig) -> Vec<ConfigWarning>
Validate config against this agent’s capabilities.
Auto Trait Implementations§
impl Freeze for CodexRunner
impl RefUnwindSafe for CodexRunner
impl Send for CodexRunner
impl Sync for CodexRunner
impl Unpin for CodexRunner
impl UnwindSafe for CodexRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more