Skip to main content

OpenCodeAdapter

Struct OpenCodeAdapter 

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

The OpenCode adapter. See the module notes for the store it reads.

Trait Implementations§

Source§

impl Default for OpenCodeAdapter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HarnessAdapter for OpenCodeAdapter

Source§

fn attribute( &self, _root: &ProcNode, _raw: Option<&RawProc>, ctx: &AttributeContext<'_>, ) -> (Vec<PathBuf>, Attribution)

One process runs one conversation, in the directory it was started in. The newest top-level session in that directory that started before the process, and that no other process has claimed, is the row.

Source§

fn detect(&self, _path: &Path) -> bool

OpenCode keeps no per-session file, so nothing on disk is detected as OpenCode; a session is reached through transcripts by its id.

Source§

fn harness(&self) -> Harness

Source§

fn rescan(&mut self, since: SystemTime)

Re-list the transcripts written since since. Called every fs_scan_interval, not every tick.
Source§

fn hints(&self, _pid: u32) -> Option<RegistryHints>

The harness’s own registry entry for a process, if it keeps one.
Source§

fn unowned(&self, attached: &HashSet<PathBuf>) -> Vec<PathBuf>

Recently written transcripts no process owns: the stopped list.
Source§

fn open(&self, path: &Path, spans: SpanRetention) -> Box<dyn SessionTracker>

A tracker for one transcript.
Source§

fn transcripts(&self) -> Vec<(String, PathBuf)>

Every transcript on disk, however old, with the id a user would type to name it. For agent-top trace --session <id>.
Source§

fn prepare(&mut self, _roots: &[&ProcNode], _by_pid: &HashMap<u32, &RawProc>)

Called once per pass with this harness’s root processes, before any of them is attributed. For work that must see every process at once: Codex reads which rollouts each process holds open here, so that no process’s fallback can claim a thread another is demonstrably writing.
Source§

fn stamp(&self, path: &Path) -> Option<SourceStamp>

The size and modification time of everything open reads for this transcript, so the store can skip one that has not changed since it was synced. None when the transcript is not a file (a database row), which is always re-read.

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
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
Source§

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

Source§

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.

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.

Source§

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

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.