diff --git a/charts/openab/templates/configmap.yaml b/charts/openab/templates/configmap.yaml index ed729a0..fdd55f6 100644 --- a/charts/openab/templates/configmap.yaml +++ b/charts/openab/templates/configmap.yaml @@ -44,10 +44,10 @@ data: {{- end }} {{- /* allowUserMessages: controls whether the bot requires @mention in threads (Discord) */ -}} {{- if $cfg.discord.allowUserMessages }} - {{- if not (has $cfg.discord.allowUserMessages (list "involved" "mentions")) }} - {{- fail (printf "agents.%s.discord.allowUserMessages must be one of: involved, mentions — got: %s" $name $cfg.discord.allowUserMessages) }} + {{- if not (has $cfg.discord.allowUserMessages (list "involved" "mentions" "multibot-mentions")) }} + {{- fail (printf "agents.%s.discord.allowUserMessages must be one of: involved, mentions, multibot-mentions (use hyphen form, not underscore) — got: %s" $name $cfg.discord.allowUserMessages) }} {{- end }} - allow_user_messages = {{ $cfg.discord.allowUserMessages | toJson }} {{- /* involved (default): respond in bot's threads without @mention | mentions: always require @mention */ -}} + allow_user_messages = {{ $cfg.discord.allowUserMessages | toJson }} {{- /* involved (default): respond in bot's threads without @mention | mentions: always require @mention | multibot-mentions: require @mention only when another bot has posted in the thread */ -}} {{- end }} {{- end }} @@ -77,10 +77,10 @@ data: trusted_bot_ids = {{ ($cfg.slack).trustedBotIds | toJson }} {{- end }} {{- if ($cfg.slack).allowUserMessages }} - {{- if not (has ($cfg.slack).allowUserMessages (list "involved" "mentions")) }} - {{- fail (printf "agents.%s.slack.allowUserMessages must be one of: involved, mentions — got: %s" $name ($cfg.slack).allowUserMessages) }} + {{- if not (has ($cfg.slack).allowUserMessages (list "involved" "mentions" "multibot-mentions")) }} + {{- fail (printf "agents.%s.slack.allowUserMessages must be one of: involved, mentions, multibot-mentions (use hyphen form, not underscore) — got: %s" $name ($cfg.slack).allowUserMessages) }} {{- end }} - allow_user_messages = {{ ($cfg.slack).allowUserMessages | toJson }} {{- /* involved (default): respond in bot's threads without @mention | mentions: always require @mention */ -}} + allow_user_messages = {{ ($cfg.slack).allowUserMessages | toJson }} {{- /* involved (default): respond in bot's threads without @mention | mentions: always require @mention | multibot-mentions: require @mention only when another bot has posted in the thread */ -}} {{- end }} {{- end }} diff --git a/charts/openab/tests/configmap_test.yaml b/charts/openab/tests/configmap_test.yaml index 3735caa..6af408c 100644 --- a/charts/openab/tests/configmap_test.yaml +++ b/charts/openab/tests/configmap_test.yaml @@ -57,3 +57,43 @@ tests: - matchRegex: path: data["config.toml"] pattern: 'allow_bot_messages = "off"' + + - it: renders allow_user_messages = "involved" + set: + agents.kiro.discord.allowUserMessages: involved + asserts: + - matchRegex: + path: data["config.toml"] + pattern: 'allow_user_messages = "involved"' + + - it: renders allow_user_messages = "mentions" + set: + agents.kiro.discord.allowUserMessages: mentions + asserts: + - matchRegex: + path: data["config.toml"] + pattern: 'allow_user_messages = "mentions"' + + - it: renders allow_user_messages = "multibot-mentions" + set: + agents.kiro.discord.allowUserMessages: multibot-mentions + asserts: + - matchRegex: + path: data["config.toml"] + pattern: 'allow_user_messages = "multibot-mentions"' + + - it: rejects invalid allowUserMessages value + set: + agents.kiro.discord.allowUserMessages: yolo + asserts: + - failedTemplate: + errorPattern: "must be one of: involved, mentions, multibot-mentions" + + - it: renders slack allow_user_messages = "multibot-mentions" + set: + agents.kiro.slack.enabled: true + agents.kiro.slack.allowUserMessages: multibot-mentions + asserts: + - matchRegex: + path: data["config.toml"] + pattern: 'allow_user_messages = "multibot-mentions"' diff --git a/charts/openab/values.yaml b/charts/openab/values.yaml index 7488535..c7468a4 100644 --- a/charts/openab/values.yaml +++ b/charts/openab/values.yaml @@ -141,9 +141,12 @@ agents: allowBotMessages: "off" # trustedBotIds: Bot User IDs (U...) — find via Slack UI: click bot profile → Copy member ID trustedBotIds: [] - # allowUserMessages: "involved" (default) | "mentions" + # allowUserMessages: "involved" (default) | "mentions" | "multibot-mentions" # "involved" = respond to thread follow-ups without @mention if bot has participated # "mentions" = always require @mention + # "multibot-mentions" = same as "involved" in single-bot threads; require @mention + # only when another bot has also posted in the thread + # (recommended for multi-bot deployments) allowUserMessages: "involved" workingDir: /home/agent env: {}