Skip to main content

ReactionConfig

Struct ReactionConfig 

Source
pub struct ReactionConfig {
    pub auto: bool,
    pub action: ReactionAction,
    pub message: Option<String>,
    pub priority: Option<EventPriority>,
    pub retries: Option<u32>,
    pub escalate_after: Option<EscalateAfter>,
    pub threshold: Option<String>,
    pub include_summary: bool,
    pub merge_method: Option<MergeMethod>,
}
Expand description

A single reaction rule, typically read from ~/.ao-rs/config.yaml under reactions.<key>. See docs/reactions.md for the full list of reaction keys and the matrix of which actions make sense for each.

All fields except action have sensible defaults, so the minimal valid config is one line:

approved-and-green:
  action: notify

Everything else — retries, escalation, priority — falls back to a value the engine considers “reasonable for hobby use”.

Fields§

§auto: bool

Master on/off. false means the engine sees the reaction key but does nothing; useful for disabling individual rules without deleting them. Defaults to true so newly-added rules are live.

We skip serializing when true so a round-tripped config stays terse: the common case (enabled) doesn’t clutter the output. Pair with include_summary below — both default-valued fields omit on write so a user who hand-edited a minimal config reads back a minimal config.

§action: ReactionAction

What to do when the reaction fires. No default — you have to pick.

§message: Option<String>

Body for SendToAgent, override text for Notify. Ignored by AutoMerge. Missing for SendToAgent falls back to an engine-supplied boilerplate (Phase D).

§priority: Option<EventPriority>

Priority for the resulting notification. Defaults to the reaction-key-specific default the engine picks (see docs/reactions.md).

§retries: Option<u32>

Max attempts of SendToAgent before escalating to Notify. None means “retry forever”, matching TS.

§escalate_after: Option<EscalateAfter>

Escalate after N attempts or after a wall-clock duration, whichever the user configured. Absent means “use retries as the only gate”.

§threshold: Option<String>

Duration threshold for time-based triggers (e.g. "10m" for agent-stuck). Kept as an opaque string until Phase D adds a parser.

§include_summary: bool

Whether to attach a context summary to the notification. Defaults to false because the engine doesn’t yet know how to produce one; Phase D might flip the default.

§merge_method: Option<MergeMethod>

Merge method to use when action: auto-merge. If unset, the SCM plugin’s default is used.

Implementations§

Source§

impl ReactionConfig

Source

pub fn new(action: ReactionAction) -> Self

Convenience constructor for tests and Phase D wiring. Mirrors the minimum useful config (auto: true, action set, everything else default).

Trait Implementations§

Source§

impl Clone for ReactionConfig

Source§

fn clone(&self) -> ReactionConfig

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 ReactionConfig

Source§

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

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

impl<'de> Deserialize<'de> for ReactionConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ReactionConfig

Source§

fn eq(&self, other: &ReactionConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ReactionConfig

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

impl Eq for ReactionConfig

Source§

impl StructuralPartialEq for ReactionConfig

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,