Skip to content

Commit f9a2849

Browse files
chaodu-agentchaodu-agent
andauthored
feat(gateway): Phase 3 quick fixes — bot filter, fallback, logging, docs (#1173)
* feat(gateway): bot filter env vars, create_thread fallback, attachment logging - Add GATEWAY_ALLOW_BOT_MESSAGES / GATEWAY_TRUSTED_BOT_IDS env vars to process_gateway_event(). Bot messages are now passthrough when explicitly allowed or sender is in trusted list. (Issue #1172 task 1) - Send user-facing fallback message when create_thread fails instead of silently falling back to channel. (Issue #1172 task 6) - Log warning when attachment has neither path nor data. (Issue #1172 task 7) * docs: add unified mode env vars to config-reference Documents all GATEWAY_* env vars including security gating (ALLOW_ALL_CHANNELS/USERS defaults, ALLOW_BOT_MESSAGES, TRUSTED_BOT_IDS) with production checklist warning. Issue #1172 task 5. --------- Co-authored-by: chaodu-agent <chaodu-agent@openab.dev>
1 parent 7849a35 commit f9a2849

5 files changed

Lines changed: 420 additions & 108 deletions

File tree

crates/openab-core/src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,16 @@ pub struct GatewayConfig {
462462
pub allowed_channels: Vec<String>,
463463
#[serde(default)]
464464
pub allowed_users: Vec<String>,
465+
/// Allow messages from bots. Default: false.
466+
/// NOTE: Intentionally `bool` (not `AllowBots` enum) — the gateway adapter
467+
/// only needs on/off since @mention gating is handled separately by
468+
/// `bot_username` + `should_skip_event`. Discord/Slack use `AllowBots` because
469+
/// their adapters embed mention-mode logic internally.
470+
#[serde(default)]
471+
pub allow_bot_messages: bool,
472+
/// Bot IDs that bypass the bot filter even when allow_bot_messages is false.
473+
#[serde(default)]
474+
pub trusted_bot_ids: Vec<String>,
465475
/// Enable streaming (typewriter) mode — requires gateway platform to support message editing.
466476
/// Defaults to `false`, so gateway platforms (Telegram / LINE / Google Chat) are **send-once
467477
/// by default**. By default send-once delivers **only the final answer block** — the text after

0 commit comments

Comments
 (0)