Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions crates/openab-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// 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
}
Expand Down
4 changes: 2 additions & 2 deletions docs/ambient.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion docs/config-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

---
Expand Down
Loading