pub struct AdvisorRuntime { /* private fields */ }Expand description
Implementations§
Source§impl AdvisorRuntime
impl AdvisorRuntime
Sourcepub fn new(
agent: Arc<dyn AdvisorAgent>,
host: Arc<dyn AdvisorRuntimeHost>,
retry_delay: Duration,
) -> AdvisorRuntime
pub fn new( agent: Arc<dyn AdvisorAgent>, host: Arc<dyn AdvisorRuntimeHost>, retry_delay: Duration, ) -> AdvisorRuntime
Construct. retry_delay is the backoff between failed advisor turns
(omp default 1000ms).
Sourcepub fn set_transcript_path(&self, path: Option<PathBuf>)
pub fn set_transcript_path(&self, path: Option<PathBuf>)
Attach the host-owned advisor transcript path.
Sourcepub fn transcript_path(&self) -> Option<PathBuf>
pub fn transcript_path(&self) -> Option<PathBuf>
Path to the advisor transcript, when persistence is available.
Sourcepub fn install_self(&self, weak: Weak<AdvisorRuntime>)
pub fn install_self(&self, weak: Weak<AdvisorRuntime>)
Install the weak self-reference required for self-spawning the drain
task. Call once after wrapping in Arc.
Sourcepub fn is_disposed(&self) -> bool
pub fn is_disposed(&self) -> bool
Whether the runtime has been disposed.
Sourcepub fn on_turn_end(&self, messages: Vec<Message>)
pub fn on_turn_end(&self, messages: Vec<Message>)
Feed one primary turn’s transcript to the advisor. Renders the delta
(new messages since the last drain), queues it, and spawns a drain task
if none is running. omp onTurnEnd.
Sourcepub async fn wait_for_catchup(&self, max: Duration, threshold: u64)
pub async fn wait_for_catchup(&self, max: Duration, threshold: u64)
Block until the backlog drops below threshold, or max elapses. omp
waitForCatchup. Registration + backlog-check happen under the waiters
lock so a concurrent notify_waiters cannot miss the waiter (the
catchup lost-wakeup fix).
Sourcepub fn reset(&self)
pub fn reset(&self)
Re-prime the advisor after a history rewrite (compaction, session
switch/resume, branch). Clears the advisor’s context and rewinds the
cursor so the next turn replays the full current transcript. omp reset.