From 1bb30fc4c732d1335a93f4e71b4ab255a4293de7 Mon Sep 17 00:00:00 2001 From: Brett Chien <1193046+brettchien@users.noreply.github.com> Date: Sun, 19 Apr 2026 22:17:10 +0800 Subject: [PATCH 1/3] fix(helm): accept "multibot-mentions" in allowUserMessages validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The openab binary added the `MultibotMentions` variant to `AllowUsers` in #464, but the Helm chart's validation block was not updated. Any user who follows docs/discord.md § Multi-Bot Setup and sets `allowUserMessages: "multibot-mentions"` is blocked by a template fail before the pod ever starts. Fix: - Add `"multibot-mentions"` to the `has ... (list ...)` check for both Discord and Slack in `charts/openab/templates/configmap.yaml`. - Update the trailing documentation comment describing the mode. - Document the new option (and its semantics) in `charts/openab/values.yaml`. - Add helm-unittest cases covering renders + invalid-value rejection for `allowUserMessages` (the test file previously only covered `allowBotMessages`). Verified: $ helm template openab ./charts/openab \ --set agents.kiro.discord.allowUserMessages=multibot-mentions \ ... | grep allow_user_messages allow_user_messages = "multibot-mentions" $ helm unittest charts/openab Charts: 1 passed, 1 total Test Suites: 2 passed, 2 total Tests: 18 passed, 18 total Fixes #471 Refs #464 Co-Authored-By: Claude Opus 4.7 (1M context) --- charts/openab/templates/configmap.yaml | 12 +++++----- charts/openab/tests/configmap_test.yaml | 31 +++++++++++++++++++++++++ charts/openab/values.yaml | 5 +++- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/charts/openab/templates/configmap.yaml b/charts/openab/templates/configmap.yaml index ed729a0c..2bf8d40e 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 — 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 — 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 3735caa6..86fad9f0 100644 --- a/charts/openab/tests/configmap_test.yaml +++ b/charts/openab/tests/configmap_test.yaml @@ -57,3 +57,34 @@ 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" diff --git a/charts/openab/values.yaml b/charts/openab/values.yaml index 7488535f..c7468a44 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: {} From ad138de1e4fe68f389f8e2d981a91b7ca01c7ba2 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Sun, 19 Apr 2026 14:33:49 +0000 Subject: [PATCH 2/3] fix(helm): add hyphen-form hint to error messages + Slack-side test - Error messages now include '(use hyphen form, not underscore)' to help users who copy from Rust config (which accepts both forms) - Add Slack-side allowUserMessages test for multibot-mentions Co-authored-by: thepagent --- charts/openab/templates/configmap.yaml | 4 ++-- charts/openab/tests/configmap_test.yaml | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/openab/templates/configmap.yaml b/charts/openab/templates/configmap.yaml index 2bf8d40e..fdd55f68 100644 --- a/charts/openab/templates/configmap.yaml +++ b/charts/openab/templates/configmap.yaml @@ -45,7 +45,7 @@ data: {{- /* allowUserMessages: controls whether the bot requires @mention in threads (Discord) */ -}} {{- if $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 — got: %s" $name $cfg.discord.allowUserMessages) }} + {{- 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 | multibot-mentions: require @mention only when another bot has posted in the thread */ -}} {{- end }} @@ -78,7 +78,7 @@ data: {{- end }} {{- if ($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 — got: %s" $name ($cfg.slack).allowUserMessages) }} + {{- 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 | multibot-mentions: require @mention only when another bot has posted in the thread */ -}} {{- end }} diff --git a/charts/openab/tests/configmap_test.yaml b/charts/openab/tests/configmap_test.yaml index 86fad9f0..6af17959 100644 --- a/charts/openab/tests/configmap_test.yaml +++ b/charts/openab/tests/configmap_test.yaml @@ -88,3 +88,12 @@ tests: 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"' \ No newline at end of file From 6c51cddc21bfaeca85db95483bfb88adc076306f Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Sun, 19 Apr 2026 14:56:31 +0000 Subject: [PATCH 3/3] chore: add missing newline at end of test file --- charts/openab/tests/configmap_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/openab/tests/configmap_test.yaml b/charts/openab/tests/configmap_test.yaml index 6af17959..6af408c8 100644 --- a/charts/openab/tests/configmap_test.yaml +++ b/charts/openab/tests/configmap_test.yaml @@ -96,4 +96,4 @@ tests: asserts: - matchRegex: path: data["config.toml"] - pattern: 'allow_user_messages = "multibot-mentions"' \ No newline at end of file + pattern: 'allow_user_messages = "multibot-mentions"'