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: notifyEverything else — retries, escalation, priority — falls back to a value the engine considers “reasonable for hobby use”.
Fields§
§auto: boolMaster 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: ReactionActionWhat 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: boolWhether 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
impl ReactionConfig
Sourcepub fn new(action: ReactionAction) -> Self
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
impl Clone for ReactionConfig
Source§fn clone(&self) -> ReactionConfig
fn clone(&self) -> ReactionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReactionConfig
impl Debug for ReactionConfig
Source§impl<'de> Deserialize<'de> for ReactionConfig
impl<'de> Deserialize<'de> for ReactionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ReactionConfig
impl PartialEq for ReactionConfig
Source§impl Serialize for ReactionConfig
impl Serialize for ReactionConfig
impl Eq for ReactionConfig
impl StructuralPartialEq for ReactionConfig
Auto Trait Implementations§
impl Freeze for ReactionConfig
impl RefUnwindSafe for ReactionConfig
impl Send for ReactionConfig
impl Sync for ReactionConfig
impl Unpin for ReactionConfig
impl UnsafeUnpin for ReactionConfig
impl UnwindSafe for ReactionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.