openclaw - ✅(Solved) Fix Discord component callback TTL should be configurable [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#84184Fetched 2026-05-20 03:43:02
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

Discord component callback registry entries currently use a fixed 30-minute TTL with no account-level configuration escape hatch.

Root Cause

Some action-card workflows are intentionally asynchronous and may be reviewed well after the first 30 minutes. A bounded configuration field gives operators an explicit, documented choice without changing defaults.

Fix Action

Fixed

PR fix notes

PR #84189: Allow Discord component registry TTL override

Description (problem / solution / changelog)

Summary

Adds a bounded Discord agentComponents.ttlMs config option, regenerates bundled channel metadata, validates the generated config contract, preserves inherited agentComponents.enabled settings across account overrides, and passes the TTL into component registry registration for component sends and edits.

Motivation

Closes #84184.

Discord component registry registration already accepts a TTL, but normal sends and edits always used the fixed default. Long-running review workflows need an explicit, bounded way to keep callbacks available longer without changing the default for everyone.

Change Type

  • Bug fix
  • Configuration

Scope

  • Adds agentComponents.ttlMs to Discord config types and schema.
  • Bounds TTL values to positive integers up to 24 hours.
  • Adds a UI hint for the setting.
  • Regenerates src/config/bundled-channel-config-metadata.generated.ts.
  • Validates channels.discord.agentComponents.ttlMs through generated bundled channel metadata.
  • Passes the resolved account TTL into sent and edited component registration.
  • Adds config validation and send-path propagation coverage.
  • Deep-merges agentComponents account overrides so ttlMs does not accidentally re-enable disabled component controls.
  • Documents the public TTL field in the Discord guide and channel config reference, including default, 24-hour maximum, account override path, and stale-callback tradeoff.

Linked Issue/PR

Closes #84184.

Real Behavior Proof

Behavior or issue addressed: channels.discord.agentComponents.ttlMs must be accepted by generated bundled channel metadata and must reach Discord component registration as the active registry TTL.

Real environment tested: Redacted OpenClaw development checkout on this PR branch, using generated bundled channel metadata validation and the Discord component registration runtime.

Exact steps or command run after this patch: Regenerated bundled channel metadata, ran generated-metadata validation for a Discord config containing agentComponents.ttlMs, registered a component message through the Discord registry path, and resolved a multi-account config where the channel default has agentComponents.enabled:false and the account only overrides ttlMs.

Evidence after fix: Redacted runtime output:

{
  "bundledValidationOk": true,
  "validatedChannelTtlMs": 120000,
  "validatedAccountTtlMs": 60000,
  "registeredEntryTtlMs": 120000
}

Additional redacted runtime output after addressing review feedback:

{
  "maxTtlAccepted": true,
  "overMaxRejected": true,
  "accountId": "work",
  "inheritedAgentComponents": {
    "enabled": false,
    "ttlMs": 120000
  },
  "wouldRegisterAgentComponents": false
}

Observed result after fix: Bundled metadata validation accepted the configured TTL, the validated channel/account TTLs were present, the registered component entry used the configured 120000 millisecond TTL, a 24-hour TTL was accepted, an over-limit TTL was rejected, and an account ttlMs override preserved inherited enabled:false.

Not tested: No live Discord provider send was needed for this generated-config and component-registry registration path.

Root Cause

The registry layer had TTL support, but the Discord account config, generated bundled channel metadata, and send/edit paths did not expose or forward a configured TTL.

Regression Test Plan

  • pnpm exec vitest run extensions/discord/src/accounts.test.ts extensions/discord/src/config-schema.test.ts extensions/discord/src/send.components.test.ts src/config/validation.channel-metadata.test.ts
  • pnpm config:channels:check

Result: 4 files passed, 69 tests passed; generated channel metadata check passed.

User-visible / Behavior Changes

Discord users can configure agentComponents.ttlMs up to 24 hours; unset configurations keep the existing 30-minute default.

Diagram

N/A. This is a generated-config-to-registration plumbing change.

Security Impact

No new secrets or permissions. Longer TTLs are explicit and bounded to 24 hours.

Repro + Verification

Before this change, there was no supported generated config field to override the registry TTL. The new tests verify accepted/rejected config values, generated metadata validation, and propagation of a configured value to component registration.

Evidence

  • Focused regression command passed.
  • pnpm config:channels:check passed after regenerating bundled channel metadata.
  • Redacted runtime diagnostic above confirms generated metadata validation and registry TTL propagation.
  • Redacted runtime diagnostic above confirms account ttlMs overrides preserve inherited agentComponents.enabled:false.
  • Public docs now describe the TTL default, 24-hour maximum, per-account override, and stale-callback tradeoff.

Human Verification

No live Discord service is required for this config-validation and registry-registration path.

Compatibility / Migration

Backward compatible. Defaults are unchanged when agentComponents.ttlMs is unset.

Risks

Low to medium. Longer callback windows can be useful but should be chosen deliberately, so the schema enforces a bounded positive integer.

Changed files

  • docs/channels/discord.md (modified, +4/-1)
  • docs/gateway/config-channels.md (modified, +1/-0)
  • extensions/discord/src/accounts.test.ts (modified, +59/-0)
  • extensions/discord/src/accounts.ts (modified, +1/-1)
  • extensions/discord/src/config-schema.test.ts (modified, +29/-0)
  • extensions/discord/src/config-ui-hints.ts (modified, +4/-0)
  • extensions/discord/src/send.components.test.ts (modified, +38/-0)
  • extensions/discord/src/send.components.ts (modified, +13/-0)
  • src/config/bundled-channel-config-metadata.generated.ts (modified, +16/-16)
  • src/config/types.discord.ts (modified, +2/-0)
  • src/config/validation.channel-metadata.test.ts (modified, +25/-0)
  • src/config/zod-schema.providers-core.ts (modified, +6/-0)
RAW_BUFFERClick to expand / collapse

Summary

Discord component callback registry entries currently use a fixed 30-minute TTL with no account-level configuration escape hatch.

Current behavior

The component registry accepts a TTL parameter internally, but normal Discord component sends do not expose a supported configuration field to change it. Workflows that need longer-lived review buttons must fit into the hard-coded default.

Expected behavior

Discord config should support a bounded agentComponents.ttlMs value, preserve the current 30-minute default when unset, and pass the configured TTL into component registry registration for sends and edits.

Why this matters

Some action-card workflows are intentionally asynchronous and may be reviewed well after the first 30 minutes. A bounded configuration field gives operators an explicit, documented choice without changing defaults.

Suggested scope

Keep this focused:

  • Add config type/schema support for a bounded TTL.
  • Add a UI hint for the setting.
  • Pass the resolved account TTL into component registration.
  • Cover config validation and send-path propagation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Discord config should support a bounded agentComponents.ttlMs value, preserve the current 30-minute default when unset, and pass the configured TTL into component registry registration for sends and edits.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Discord component callback TTL should be configurable [1 pull requests, 1 comments, 2 participants]