Skip to main content

OrchestratorEvent

Enum OrchestratorEvent 

Source
pub enum OrchestratorEvent {
    Spawned {
        id: SessionId,
        project_id: String,
    },
    SessionRestored {
        id: SessionId,
        project_id: String,
        status: SessionStatus,
    },
    StatusChanged {
        id: SessionId,
        from: SessionStatus,
        to: SessionStatus,
    },
    ActivityChanged {
        id: SessionId,
        prev: Option<ActivityState>,
        next: ActivityState,
    },
    Terminated {
        id: SessionId,
        reason: TerminationReason,
    },
    TickError {
        id: SessionId,
        message: String,
    },
    ReactionTriggered {
        id: SessionId,
        reaction_key: String,
        action: ReactionAction,
    },
    ReactionEscalated {
        id: SessionId,
        reaction_key: String,
        attempts: u32,
    },
    UiNotification {
        notification: UiNotification,
    },
}

Variants§

§

Spawned

A session was created after the lifecycle loop was already running. The loop decides “new” by comparing session.created_at against its own startup timestamp — a session observed on the first tick whose created_at predates startup is reported via SessionRestored instead, so watch output distinguishes “brand new spawn” from “restored from disk”.

Fields

§project_id: String
§

SessionRestored

A session that already existed on disk was observed by the lifecycle loop on its first tick after startup. Emitted at most once per session and only during the first tick — subsequent appearances use Spawned. Consumers use this to suppress the “N sessions just spawned” flood on reconnect.

Fields

§project_id: String
§status: SessionStatus

On-disk status at the moment of observation. Useful for UI filtering (e.g. skip terminal sessions) without an extra snapshot round-trip.

§

StatusChanged

Lifecycle-driven status transition. from == to is never emitted.

§

ActivityChanged

Polled activity changed. prev is None on the first successful poll.

§

Terminated

Runtime process is gone. Emitted exactly once per session.

§

TickError

Polling-loop error for one session. The loop itself keeps running.

Fields

§message: String
§

ReactionTriggered

A configured reaction successfully ran its action. The engine emits this on every successful dispatch — subscribers use it to surface “ao-rs just fired X” in the CLI and for assertions in tests.

action is the action the engine actually took, which may differ from the configured action if the engine escalated mid-flight (SendToAgentNotify). Pair with ReactionEscalated to tell first-time successes apart from escalations.

Fields

§reaction_key: String

Reaction key from config (e.g. "ci-failed").

§action: ReactionAction

Action the engine actually executed this attempt.

§

ReactionEscalated

The retry budget for a reaction was exhausted and the engine fell back to Notify. Emitted in addition to the ReactionTriggered that represents the escalated notify — so subscribers that only care about “something was escalated” can filter on this event alone without having to join on attempts counts.

Fields

§reaction_key: String
§attempts: u32

How many attempts had been made when escalation was decided. The value is the attempt count that triggered escalation, not retries + 1, so a user reading logs sees exactly how many times the agent was poked before the notify fell through.

§

UiNotification

UI-friendly notification event (dashboard/desktop toasts).

Emitted in addition to ReactionTriggered for reactions that should surface to users in real time.

Fields

§notification: UiNotification

Trait Implementations§

Source§

impl Clone for OrchestratorEvent

Source§

fn clone(&self) -> OrchestratorEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrchestratorEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for OrchestratorEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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