Struct MatrixConfig
pub struct MatrixConfig {Show 24 fields
pub enabled: bool,
pub homeserver: String,
pub access_token: Option<String>,
pub user_id: Option<String>,
pub device_id: Option<String>,
pub allowed_rooms: Vec<String>,
pub interrupt_on_new_message: bool,
pub stream_mode: MatrixStreamMode,
pub draft_update_interval_ms: u64,
pub multi_message_delay_ms: u64,
pub stream_draft_lines: usize,
pub message_max_bytes: usize,
pub stream_draft_delete: bool,
pub stream_reasoning: StreamReasoningMode,
pub stream_tool_arguments: Vec<StreamToolArgumentEntry>,
pub mention_only: bool,
pub recovery_key: Option<String>,
pub password: Option<String>,
pub approval_timeout_secs: u64,
pub reply_in_thread: bool,
pub ack_reactions: Option<bool>,
pub excluded_tools: Vec<String>,
pub reply_min_interval_secs: u64,
pub reply_queue_depth_max: u16,
}Expand description
Matrix channel configuration.
Default is implemented below rather than derived. A derived Default
zeroes every field, which disagrees with the serde defaults, and for
approval_timeout_secs that disagreement is load-bearing: 0 is an
already-elapsed deadline, so an alias built in Rust would deny every
approval while an alias parsed from a file waits the documented 300s.
Fields§
§enabled: boolWhether this channel is active. The runtime only loads channels whose
enabled = true. Default: false so an operator who pastes a partial
[channels.<type>.<alias>] block doesn’t accidentally bring a channel
live before the rest of its config is filled in.
homeserver: StringMatrix server name or homeserver URL (e.g. "matrix.org" or
"https://matrix.example.org"). Server names use standard
/.well-known/matrix/client discovery.
access_token: Option<String>Matrix access token for the bot account. When unset, the channel
falls back to password login using user_id + password.
user_id: Option<String>Optional Matrix user ID (e.g. "@bot:matrix.org").
device_id: Option<String>Optional Matrix device ID.
allowed_rooms: Vec<String>Allowed Matrix room IDs. Empty = allow all rooms the bot has joined.
Entries are matched literally against the canonical room ID
(!abc:server) of each incoming message; #room:server aliases are
not resolved for this allowlist (they are resolved only for outbound
delivery targets such as cron delivery.to).
interrupt_on_new_message: boolWhether to interrupt an in-flight agent response when a new message arrives.
stream_mode: MatrixStreamModeStreaming mode for progressive response delivery.
"off" (default): single final message. "partial": edit-in-place draft.
"single_message": progress draft plus separate final message.
"multi_message": paragraph-split delivery.
draft_update_interval_ms: u64Minimum interval (ms) between Matrix draft edits in Partial mode and thinking/reasoning progress edits in SingleMessage mode.
multi_message_delay_ms: u64Delay (ms) between sending each paragraph in MultiMessage mode.
stream_draft_lines: usizeMaximum number of progress lines kept in the Matrix single-message streaming draft. Set to 0 to remove the line-count limit; all lines still compete within one byte-bounded Matrix draft event.
message_max_bytes: usizeSerialized Matrix event-content byte budget for single-message streaming draft edits and the separate final response. The rendered Markdown body, generated HTML, and reply/edit relation all count toward this limit. Oversized progress drops complete oldest entries; the separate final response retains a UTF-8-safe prefix. Values below 512 use that minimum, which leaves room for a non-empty serialized event.
stream_draft_delete: boolDelete the Matrix single-message progress draft before sending the final response. When false, durable progress remains as a visible transcript; placeholder-only drafts are still removed before the final response.
stream_reasoning: StreamReasoningModeMatrix single-message reasoning visibility. "off" suppresses
reasoning-derived draft updates, "status" emits liveness ticks without
raw reasoning text, and "full" emits raw provider reasoning text into
the progress draft.
stream_tool_arguments: Vec<StreamToolArgumentEntry>Tool arguments shown in Matrix single-message progress lines. Missing or
empty means the conservative safe defaults. Use one
{ default_base = "none" | "safe" | "all" } entry for inherited
settings, then exact-name tool entries with optional base, include,
exclude, and argument_chars adjustments. argument_chars limits
each displayed value and defaults to 60; 0 disables that limit.
Unknown tools resolve to no arguments under safe; every selected value
is leak-scrubbed before display.
mention_only: boolWhen true, only respond to messages that @-mention the bot in groups. Direct messages are always processed.
recovery_key: Option<String>Optional Matrix recovery key for automatic E2EE key backup restore. When set, ZeroClaw recovers room keys and cross-signing secrets on startup.
password: Option<String>Optional login password for Matrix account (used for initial login flow).
approval_timeout_secs: u64Seconds to wait for operator approval on always_ask tools before auto-denying.
reply_in_thread: boolWhen true (default), replies are sent as thread replies. Starts a new thread from the incoming message when none exists. When false, only continues existing threads.
ack_reactions: Option<bool>Override for the top-level [channels].ack_reactions. When
None, falls back to the channels-wide default. When set
explicitly (true/false), takes precedence for this Matrix
instance only.
excluded_tools: Vec<String>Tools excluded from this channel’s tool spec. When set, these tools are not exposed to the model when responding via this channel.
reply_min_interval_secs: u64Per-(channel, recipient) outbound pacing floor in seconds.
Range: 0..=REPLY_MIN_INTERVAL_MAX_SECS (0 disables).
reply_queue_depth_max: u16Per-(channel, recipient) outbound pacing queue depth.
Range: 0..=REPLY_QUEUE_DEPTH_CEILING. When reply_min_interval_secs > 0
and this value is 0, the pacing wrapper substitutes
DEFAULT_REPLY_QUEUE_DEPTH (16). When the queue is full, the
newest send is dropped and a WARN is logged.
Implementations§
Source§impl MatrixConfig
impl MatrixConfig
Sourcepub fn configurable_prefix() -> &'static str
pub fn configurable_prefix() -> &'static str
Returns the #[prefix] value for this Configurable struct.
Sourcepub fn init_requires_explicit_config() -> bool
pub fn init_requires_explicit_config() -> bool
True when this struct has a required leaf field that a
bare/ancestor-prefix init_defaults scaffold must not
materialize (it would fill the field with its Rust
Default, which prune_empty_leaves then strips on save,
leaving a partial sub-table that fails strict reload).
Explicitly targeting this section (or a descendant of it)
still scaffolds regardless of this flag, so the section can
be materialized for the operator to fill in.
Sourcepub fn secret_fields(&self) -> Vec<SecretFieldInfo>
pub fn secret_fields(&self) -> Vec<SecretFieldInfo>
Returns metadata about all #[secret] fields on this struct and nested children.
pub fn secret_field_terminals() -> Vec<&'static str>
Sourcepub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Encrypt all secret fields in place using the provided store.
Sourcepub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Decrypt all secret fields in place using the provided store.
Sourcepub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
pub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
Set a secret field by its full dotted name, dispatching to nested children.
Sourcepub fn prop_fields(&self) -> Vec<PropFieldInfo>
pub fn prop_fields(&self) -> Vec<PropFieldInfo>
Returns metadata about all property fields on this struct and nested children.
Sourcepub fn get_prop(&self, name: &str) -> Result<String, Error>
pub fn get_prop(&self, name: &str) -> Result<String, Error>
Get a property value by its full dotted name, returning it as a display string.
Sourcepub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
Set a property value by its full dotted name, parsing from string.
Sourcepub fn prop_is_secret(name: &str) -> bool
pub fn prop_is_secret(name: &str) -> bool
Check if a property name refers to a secret field (static, no instance needed).
Sourcepub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
Instantiate None nested sections whose prefix matches.
Returns the prefixes that were initialized.
Sourcepub fn map_key_sections() -> Vec<MapKeySection>
pub fn map_key_sections() -> Vec<MapKeySection>
Enumerate every map-keyed (HashMap<String, T>) and list-shaped
(Vec<T>) section discoverable from this Configurable’s tree.
The dashboard / CLI consume this to surface “+ Add” affordances
without hardcoding the section list.
Sourcepub fn nested_section_help(name: &str) -> Option<&'static str>
pub fn nested_section_help(name: &str) -> Option<&'static str>
Help blurb for a #[nested] field on this struct, sourced from
the field-level /// docstring. Returns None for unknown
names so callers can fall through to a different lookup.
pub fn nested_section_group(name: &str) -> Option<&'static str>
Sourcepub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
Return the current alias keys at section_path, or None if
the path doesn’t resolve to a map-keyed section in this tree.
pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>
pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>
Source§impl MatrixConfig
impl MatrixConfig
Sourcepub fn effective_message_max_bytes(&self) -> usize
pub fn effective_message_max_bytes(&self) -> usize
Effective UTF-8 body budget for Matrix single-message streaming.
A serialized Matrix event has fixed JSON, message, and relation overhead in addition to UTF-8 source text. Keeping this floor avoids accepting a budget that cannot contain even a one-scalar event.
Sourcepub fn validate_stream_tool_arguments(&self) -> Result<(), Error>
pub fn validate_stream_tool_arguments(&self) -> Result<(), Error>
Validate the order-independent tool argument display policy.
Trait Implementations§
Source§impl ChannelConfig for MatrixConfig
impl ChannelConfig for MatrixConfig
Source§impl Clone for MatrixConfig
impl Clone for MatrixConfig
Source§fn clone(&self) -> MatrixConfig
fn clone(&self) -> MatrixConfig
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MatrixConfig
impl Debug for MatrixConfig
Source§impl Default for MatrixConfig
impl Default for MatrixConfig
Source§fn default() -> MatrixConfig
fn default() -> MatrixConfig
Built by deserializing an object supplying only homeserver, the one
field with no serde default - a Matrix channel must always name a
homeserver, so it stays required rather than gaining one. Every other
field either declares a serde default or is an Option, so this is
the minimal object that makes the deserialize total; those defaults
stay the only source of truth for everything but homeserver.
Source§impl<'de> Deserialize<'de> for MatrixConfig
impl<'de> Deserialize<'de> for MatrixConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MatrixConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MatrixConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl HasReplyPacing for MatrixConfig
impl HasReplyPacing for MatrixConfig
fn reply_min_interval_secs(&self) -> u64
fn reply_queue_depth_max(&self) -> u16
Source§impl JsonSchema for MatrixConfig
impl JsonSchema for MatrixConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl MaskSecrets for MatrixConfig
impl MaskSecrets for MatrixConfig
fn mask_secrets(&mut self)
fn restore_secrets_from(&mut self, current: &MatrixConfig)
Source§impl Serialize for MatrixConfig
impl Serialize for MatrixConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for MatrixConfig
impl RefUnwindSafe for MatrixConfig
impl Send for MatrixConfig
impl Sync for MatrixConfig
impl Unpin for MatrixConfig
impl UnsafeUnpin for MatrixConfig
impl UnwindSafe for MatrixConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more