pub struct CodexHarness;Expand description
OpenAI Codex CLI as a Harness.
Implementations§
Source§impl CodexHarness
impl CodexHarness
Trait Implementations§
Source§impl Clone for CodexHarness
impl Clone for CodexHarness
Source§fn clone(&self) -> CodexHarness
fn clone(&self) -> CodexHarness
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodexHarness
impl Debug for CodexHarness
Source§impl Default for CodexHarness
impl Default for CodexHarness
Source§fn default() -> CodexHarness
fn default() -> CodexHarness
Returns the “default value” for a type. Read more
Source§impl Harness for CodexHarness
impl Harness for CodexHarness
Source§fn info(&self) -> HarnessInfo
fn info(&self) -> HarnessInfo
Static metadata for the UI.
Source§fn list_models(&self) -> Result<Vec<HarnessModel>, HarnessError>
fn list_models(&self) -> Result<Vec<HarnessModel>, HarnessError>
Enumerate the models this harness can run, live. The default returns
the static list declared in
HarnessInfo
(info().capabilities.models), so existing adapters need no change. Read moreSource§fn readiness(&self) -> HarnessReadiness
fn readiness(&self) -> HarnessReadiness
Probe availability / version / auth. May shell out; callers
should treat it as blocking and run it off the UI thread.
Source§fn run(
&self,
request: RunRequest,
on_event: RunCallback,
) -> Result<RunHandle, HarnessError>
fn run( &self, request: RunRequest, on_event: RunCallback, ) -> Result<RunHandle, HarnessError>
Start a run, streaming events through
on_event. Returns a
handle immediately; work continues on background threads.Source§fn credential(&self) -> CredentialSpec
fn credential(&self) -> CredentialSpec
The credential this harness needs.
Source§fn login(&self, on_event: InstallCallback) -> Result<(), HarnessError>
fn login(&self, on_event: InstallCallback) -> Result<(), HarnessError>
Trigger the harness’s own interactive sign-in (its CLI’s OAuth),
streaming progress as
InstallEvents. The flow opens the user’s
browser; this blocks until the login process exits, then
Done { ok } reports success. This is the agent authenticating
itself — distinct from installing it, which the host’s user does.
Default: unsupported, for harnesses the host authenticates by key.Source§fn model_management(&self) -> Option<ModelManagement>
fn model_management(&self) -> Option<ModelManagement>
Whether this harness can install/list/delete its own models locally, and
if so the endpoint metadata a host UI can surface (see
ModelManagement). None (the default) means model management isn’t
supported — a host hides the “Manage models” surface. Only the
openai-compatible Ollama adapter returns Some today.Source§fn list_installed_models(&self) -> Result<Vec<InstalledModel>, HarnessError>
fn list_installed_models(&self) -> Result<Vec<InstalledModel>, HarnessError>
Installed local models with their on-disk size + details, for a manager
UI (distinct from
list_models, the picker’s
name-only set). Default: unsupported — override alongside
model_management. Blocking (hits the local
server); run it off the UI thread.Source§fn pull_model(
&self,
_model: &str,
_cancel: &AtomicBool,
_on_progress: PullProgressCallback<'_>,
) -> Result<(), HarnessError>
fn pull_model( &self, _model: &str, _cancel: &AtomicBool, _on_progress: PullProgressCallback<'_>, ) -> Result<(), HarnessError>
Download (install) a model, streaming progress to
on_progress. cancel
is polled during the download; flipping it aborts the pull. Blocking
until the download finishes (or fails / is cancelled); run it off the UI
thread. Default: unsupported.Source§fn delete_model(&self, _model: &str) -> Result<(), HarnessError>
fn delete_model(&self, _model: &str) -> Result<(), HarnessError>
Remove an installed local model. Removing one that’s already absent
succeeds (the requested end state). Default: unsupported.
Source§fn run_channel(
&self,
request: RunRequest,
) -> Result<(RunHandle, Receiver<RunEvent>), HarnessError>
fn run_channel( &self, request: RunRequest, ) -> Result<(RunHandle, Receiver<RunEvent>), HarnessError>
Convenience over
run for callers that want to
pull events off a channel instead of supplying a push callback.
Forwards each RunEvent into an mpsc channel and hands the
receiver back alongside the run handle, so the caller can simply
for event in rx { … } rather than re-write the
Arc::new(move |ev| tx.send(ev)) plumbing at every call site. Read moreAuto Trait Implementations§
impl Freeze for CodexHarness
impl RefUnwindSafe for CodexHarness
impl Send for CodexHarness
impl Sync for CodexHarness
impl Unpin for CodexHarness
impl UnsafeUnpin for CodexHarness
impl UnwindSafe for CodexHarness
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