Skip to content

Commit 41a8a04

Browse files
committed
fix(discord): cap component ttl at one day
1 parent b011c34 commit 41a8a04

6 files changed

Lines changed: 22 additions & 22 deletions

File tree

docs/channels/discord.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ By default, components are single use. Set `components.reusable=true` to allow b
352352

353353
To restrict who can click a button, set `allowedUsers` on that button (Discord user IDs, tags, or `*`). When configured, unmatched users receive an ephemeral denial.
354354

355-
Component callbacks expire after 30 minutes by default. Set `channels.discord.agentComponents.ttlMs` to change that callback registry lifetime for the default Discord account, or `channels.discord.accounts.<accountId>.agentComponents.ttlMs` to override one account in a multi-account setup. The value is milliseconds, must be a positive integer, and is capped at `604800000` (7 days). Longer TTLs are useful for review or approval workflows that need buttons to remain usable, but they also extend the window where an old Discord message can still trigger an action. Prefer the shortest TTL that fits the workflow, and keep the default when stale callbacks would be surprising.
355+
Component callbacks expire after 30 minutes by default. Set `channels.discord.agentComponents.ttlMs` to change that callback registry lifetime for the default Discord account, or `channels.discord.accounts.<accountId>.agentComponents.ttlMs` to override one account in a multi-account setup. The value is milliseconds, must be a positive integer, and is capped at `86400000` (24 hours). Longer TTLs are useful for review or approval workflows that need buttons to remain usable, but they also extend the window where an old Discord message can still trigger an action. Prefer the shortest TTL that fits the workflow, and keep the default when stale callbacks would be surprising.
356356

357357
The `/model` and `/models` slash commands open an interactive model picker with provider, model, and compatible runtime dropdowns plus a Submit step. `/models add` is deprecated and now returns a deprecation message instead of registering models from chat. The picker reply is ephemeral and only the invoking user can use it. Discord select menus are limited to 25 options, so add `provider/*` entries to `agents.defaults.models` when you want the picker to show dynamically discovered models only for selected providers such as `openai-codex` or `vllm`.
358358

@@ -1138,7 +1138,7 @@ OpenClaw uses Discord components v2 for exec approvals and cross-context markers
11381138

11391139
- `channels.discord.ui.components.accentColor` sets the accent color used by Discord component containers (hex).
11401140
- Set per account with `channels.discord.accounts.<id>.ui.components.accentColor`.
1141-
- `channels.discord.agentComponents.ttlMs` controls how long sent Discord component callbacks remain registered (default `1800000`, maximum `604800000`). Set per account with `channels.discord.accounts.<id>.agentComponents.ttlMs`.
1141+
- `channels.discord.agentComponents.ttlMs` controls how long sent Discord component callbacks remain registered (default `1800000`, maximum `86400000`). Set per account with `channels.discord.accounts.<id>.agentComponents.ttlMs`.
11421142
- `embeds` are ignored when components v2 are present.
11431143
- Plain URL previews are suppressed by default. Set `suppressEmbeds: false` on a message action when a single outbound link should expand.
11441144

docs/gateway/config-channels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ WhatsApp runs through the gateway's web channel (Baileys Web). It starts automat
350350
- `defaultSpawnContext`: native subagent context for thread-bound spawns (`"fork"` by default)
351351
- Top-level `bindings[]` entries with `type: "acp"` configure persistent ACP bindings for channels and threads (use channel/thread id in `match.peer.id`). Field semantics are shared in [ACP Agents](/tools/acp-agents#persistent-channel-bindings).
352352
- `channels.discord.ui.components.accentColor` sets the accent color for Discord components v2 containers.
353-
- `channels.discord.agentComponents.ttlMs` controls how long sent Discord component callbacks remain registered. The default is `1800000` (30 minutes), the maximum is `604800000` (7 days), and per-account overrides live under `channels.discord.accounts.<accountId>.agentComponents.ttlMs`. Longer values keep old buttons/selects/forms usable longer, so prefer the shortest TTL that fits the workflow.
353+
- `channels.discord.agentComponents.ttlMs` controls how long sent Discord component callbacks remain registered. The default is `1800000` (30 minutes), the maximum is `86400000` (24 hours), and per-account overrides live under `channels.discord.accounts.<accountId>.agentComponents.ttlMs`. Longer values keep old buttons/selects/forms usable longer, so prefer the shortest TTL that fits the workflow.
354354
- `channels.discord.voice` enables Discord voice channel conversations and optional auto-join + LLM + TTS overrides. Text-only Discord configs leave voice off by default; set `channels.discord.voice.enabled=true` to opt in.
355355
- `channels.discord.voice.model` optionally overrides the LLM model used for Discord voice channel responses.
356356
- `channels.discord.voice.daveEncryption` and `channels.discord.voice.decryptionFailureTolerance` pass through to `@discordjs/voice` DAVE options (`true` and `24` by default).

extensions/discord/src/config-schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe("discord config schema", () => {
397397
});
398398

399399
it("rejects invalid agentComponents.ttlMs values", () => {
400-
for (const ttlMs of [0, -1, 1.5, 604_800_001]) {
400+
for (const ttlMs of [0, -1, 1.5, 86_400_001]) {
401401
const res = DiscordConfigSchema.safeParse({
402402
agentComponents: {
403403
ttlMs,

extensions/discord/src/config-ui-hints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export const discordChannelConfigUiHints = {
159159
},
160160
"agentComponents.ttlMs": {
161161
label: "Discord Component TTL (ms)",
162-
help: "How long sent Discord component callbacks remain registered. Default is 1800000 (30 minutes); maximum is 604800000 (7 days).",
162+
help: "How long sent Discord component callbacks remain registered. Default is 1800000 (30 minutes); maximum is 86400000 (24 hours).",
163163
},
164164
"intents.presence": {
165165
label: "Discord Presence Intent",

0 commit comments

Comments
 (0)