From 98be99384ce135150c0d8d9f1eaab1c5d2aaa7c7 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Sat, 27 Jun 2026 19:20:45 -0400 Subject: [PATCH] fix(ambient): default allow_bot_messages to true Bot messages should be included in the ambient buffer by default so the agent has full channel context. Users can opt out with allow_bot_messages = false if needed. --- crates/openab-core/src/config.rs | 15 ++++++++++++--- docs/ambient.md | 4 ++-- docs/config-reference.md | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/crates/openab-core/src/config.rs b/crates/openab-core/src/config.rs index 5b5bde4ca..55d7930b8 100644 --- a/crates/openab-core/src/config.rs +++ b/crates/openab-core/src/config.rs @@ -1324,16 +1324,25 @@ impl Default for AmbientPoolConfig { } /// `[ambient.discord]` — Discord-specific ambient settings. -#[derive(Debug, Clone, Default, Deserialize)] +#[derive(Debug, Clone, Deserialize)] pub struct AmbientDiscordConfig { /// Explicit channel allowlist. Required — empty means ambient is disabled. #[serde(default)] pub channels: Vec, - /// Whether other bots' messages enter the ambient buffer. Default: false. - #[serde(default)] + /// Whether other bots' messages enter the ambient buffer. Default: true. + #[serde(default = "default_true")] pub allow_bot_messages: bool, } +impl Default for AmbientDiscordConfig { + fn default() -> Self { + Self { + channels: Vec::new(), + allow_bot_messages: true, + } + } +} + fn default_flush_interval_seconds() -> u64 { 60 } diff --git a/docs/ambient.md b/docs/ambient.md index 0a3d3a0cd..bda2e4841 100644 --- a/docs/ambient.md +++ b/docs/ambient.md @@ -26,7 +26,7 @@ debug = false # ⚠️ Only enable in test channels (exposes [ambient.discord] channels = ["1234567890"] # Channel IDs to monitor (and their threads) -allow_bot_messages = false # Include other bots' messages in buffer +allow_bot_messages = true # Include other bots' messages in buffer (default) ``` ### Custom Instructions @@ -61,7 +61,7 @@ You are passively observing a Discord channel. | `flush_timeout_seconds` | `120` | Safety timeout — resets flushing state if exceeded. Clamped to [5, 600]. | | `instructions_file` | `~/.openab/config/ambient.md` | Path to custom instructions file. First 2000 chars used as system prompt. Falls back to built-in default if missing. | | `channels` | `[]` | Explicit channel allowlist (required). Empty = ambient disabled. | -| `allow_bot_messages` | `false` | Whether other bots' messages enter the ambient buffer. | +| `allow_bot_messages` | `true` | Whether other bots' messages enter the ambient buffer. | > **Threads are observed by default.** Messages in **threads** whose parent is a configured channel are buffered too (most OpenAB conversation happens in auto-created threads, not the parent channel). **Both** bot-owned and non-owned threads are observed — the bot passively follows all thread conversation under an ambient channel. An @mention in any thread discards its buffer and triggers immediate dispatch, so there is no double-reply. Each thread batches independently (keyed by the thread ID). diff --git a/docs/config-reference.md b/docs/config-reference.md index e4e42d944..2f5509a14 100644 --- a/docs/config-reference.md +++ b/docs/config-reference.md @@ -484,7 +484,7 @@ context_flushes = 3 [ambient.discord] channels = [] # Channel ID allowlist — and their threads (required) -allow_bot_messages = false +allow_bot_messages = true ``` ---