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
2 changes: 1 addition & 1 deletion charts/openab/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
{{- include "openab.labels" $d | nindent 4 }}
data:
config.toml: |
{{- if and (ne (toString ($cfg.discord).enabled) "false") ($cfg.discord).botToken }}
{{- if ($cfg.discord).enabled }}
[discord]
bot_token = "${DISCORD_BOT_TOKEN}"
{{- range $cfg.discord.allowedChannels }}
Expand Down
70 changes: 70 additions & 0 deletions charts/openab/tests/adapter-enablement_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
suite: adapter enablement gating
templates:
- templates/configmap.yaml
tests:
- it: renders [discord] with placeholder token when enabled=true without botToken
set:
agents.kiro.discord.enabled: true
agents.kiro.discord.botToken: ""
asserts:
- matchRegex:
path: data["config.toml"]
pattern: "\\[discord\\]"
- matchRegex:
path: data["config.toml"]
pattern: 'bot_token = "\$\{DISCORD_BOT_TOKEN\}"'

- it: omits [discord] when enabled=false
set:
agents.kiro.discord.enabled: false
asserts:
- notMatchRegex:
path: data["config.toml"]
pattern: "\\[discord\\]"

- it: omits [discord] when discord is not set
set:
agents.kiro.discord: null
asserts:
- notMatchRegex:
path: data["config.toml"]
pattern: "\\[discord\\]"

- it: renders [slack] when enabled=true
set:
agents.kiro.slack.enabled: true
asserts:
- matchRegex:
path: data["config.toml"]
pattern: "\\[slack\\]"

- it: omits [slack] when enabled=false
set:
agents.kiro.slack.enabled: false
asserts:
- notMatchRegex:
path: data["config.toml"]
pattern: "\\[slack\\]"

- it: renders [slack] with placeholder tokens when enabled=true
set:
agents.kiro.slack.enabled: true
asserts:
- matchRegex:
path: data["config.toml"]
pattern: 'bot_token = "\$\{SLACK_BOT_TOKEN\}"'
- matchRegex:
path: data["config.toml"]
pattern: 'app_token = "\$\{SLACK_APP_TOKEN\}"'

- it: renders both [discord] and [slack] when both enabled
set:
agents.kiro.discord.enabled: true
agents.kiro.slack.enabled: true
asserts:
- matchRegex:
path: data["config.toml"]
pattern: "\\[discord\\]"
- matchRegex:
path: data["config.toml"]
pattern: "\\[slack\\]"
11 changes: 6 additions & 5 deletions charts/openab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ agents:
# command: claude-agent-acp
# args: []
# discord:
# botToken: ""
# enabled: true
# # ⚠️ Use --set-string for channel IDs to avoid float64 precision loss
# allowedChannels:
# - "YOUR_CHANNEL_ID"
Expand Down Expand Up @@ -60,7 +60,7 @@ agents:
# args:
# - acp
# discord:
# botToken: ""
# enabled: true
# allowedChannels:
# - "YOUR_CHANNEL_ID"
# allowedUsers: []
Expand Down Expand Up @@ -91,7 +91,7 @@ agents:
# - --workspace
# - /home/agent
# discord:
# botToken: ""
# enabled: true
# allowedChannels:
# - "YOUR_CHANNEL_ID"
# allowedUsers: []
Expand All @@ -115,8 +115,9 @@ agents:
- acp
- --trust-all-tools
discord:
enabled: true # set to false to disable; enabled with empty botToken is treated as disabled
botToken: ""
enabled: true # set to false to disable the discord adapter
# botToken is no longer required at render time; the actual token
# is injected at runtime via the DISCORD_BOT_TOKEN env var.
# ⚠️ Use --set-string for channel IDs to avoid float64 precision loss
allowedChannels:
- "YOUR_CHANNEL_ID"
Expand Down
Loading