Skip to content

fix(discord): keep slash follow-ups ephemeral - #69869

Merged
gumadeiras merged 4 commits into
mainfrom
codex/discord-status-ephemeral
Apr 22, 2026
Merged

gumadeiras merged 4 commits into
mainfrom
codex/discord-status-ephemeral

Conversation

@gumadeiras

Copy link
Copy Markdown
Member

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Discord slash command replies can be chunked into multiple follow-ups, but follow-up payloads did not preserve the command's ephemeral visibility.
  • Why it matters: long /status replies could expose fallback model/runtime details publicly after the initial ephemeral response.
  • What changed: thread the native command ephemeral policy through Discord interaction reply delivery, including chunked text and media follow-up chunks.
  • What did NOT change (scope boundary): no Discord gateway startup, doctor, command routing, or model status content changes.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause (if applicable)

  • Root cause: Discord native slash commands set an ephemeral command policy and defer the interaction, but deliverDiscordInteractionReply built subsequent followUp() payloads without the ephemeral flag.
  • Missing detection / guardrail: direct /status coverage asserted the reply text but not visibility across chunked follow-ups.
  • Contributing context (if known): /status can exceed Discord chunk limits when fallback models/runtime details are included.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/discord/src/monitor/native-command.status-direct.test.ts
  • Scenario the test should lock in: long direct /status output sends multiple follow-ups, and every follow-up remains ephemeral.
  • Why this is the smallest reliable guardrail: it exercises the Discord native command delivery helper directly without live Discord.
  • Existing test that already covers this (if any): existing direct /status test covered dispatcher bypass but not chunk visibility.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Discord slash-command follow-up chunks now stay ephemeral when the command is configured for ephemeral replies.

Diagram (if applicable)

Before:
/status -> ephemeral defer -> first follow-up -> later chunks public

After:
/status -> ephemeral defer -> all follow-up chunks ephemeral

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS local dev
  • Runtime/container: Node repo runtime via pnpm
  • Model/provider: N/A
  • Integration/channel (if any): Discord
  • Relevant config (redacted): Discord native slash commands with ephemeral replies enabled

Steps

  1. Configure Discord slash commands for ephemeral replies.
  2. Run /status with enough status content to require multiple Discord follow-up messages.
  3. Inspect follow-up payload visibility.

Expected

  • Every /status follow-up remains ephemeral.

Actual

  • Before this fix, later follow-up chunks could be sent without ephemeral and become public.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Regression coverage added in native-command.status-direct.test.ts; local changed gate passes.

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: long direct /status output produces multiple follow-ups and all follow-up payloads contain ephemeral: true.
  • Edge cases checked: shared Discord changed-surface gate, including extension typecheck, lint, import cycles, and 54 Discord extension test files.
  • What you did not verify: live Discord API behavior.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: Some non-status slash-command follow-ups now explicitly inherit the configured ephemeral policy.
    • Mitigation: this matches the existing command-level ephemeralDefault and preserves explicit overrides where call sites pass one.

Copilot AI review requested due to automatic review settings April 21, 2026 23:16
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS maintainer Maintainer-authored PR labels Apr 21, 2026
@greptile-apps

greptile-apps Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug where Discord slash command follow-up chunks (e.g. long /status replies split across multiple messages) were sent without the ephemeral flag, making them publicly visible even when the command was configured for ephemeral replies. The fix threads responseEphemeral through dispatchDiscordCommandInteraction → deliverDiscordInteractionReply and applies it consistently across text chunks, file attachment chunks, and the sendMessage helper, with regression coverage added for the multi-chunk case.

Confidence Score: 5/5

Safe to merge — the fix is minimal, well-targeted, and all delivery paths now propagate the ephemeral flag consistently.

All remaining notes are P2 or lower. The core logic change is correct: responseEphemeral is threaded through every followUp/reply code path in deliverDiscordInteractionReply, and the new test exercises the multi-chunk scenario directly. No regressions are introduced.

No files require special attention.

Reviews (1): Last reviewed commit: "docs(changelog): note Discord ephemeral ..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Discord slash-command interaction delivery so chunked follow-up messages inherit the command’s ephemeral visibility policy, preventing long /status replies from leaking into public channels.

Changes:

  • Thread responseEphemeral through dispatchDiscordCommandInteraction and into deliverDiscordInteractionReply for follow-ups.
  • Ensure follow-up chunks (including chunked text) include the resolved ephemeral flag.
  • Add a regression unit test asserting multi-chunk direct /status follow-ups remain ephemeral.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
extensions/discord/src/monitor/native-command.ts Propagates an interaction-level ephemeral policy into follow-up delivery, including chunked follow-ups.
extensions/discord/src/monitor/native-command.status-direct.test.ts Adds a unit test ensuring multi-chunk direct /status follow-ups remain ephemeral.
extensions/discord/src/monitor/native-command-ui.ts Extends dispatch params to carry ephemeral policy for UI-triggered command arg interactions.
CHANGELOG.md Documents the Discord ephemeral follow-up fix in Unreleased.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e61abcc32b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gumadeiras gumadeiras self-assigned this Apr 21, 2026
@gumadeiras
gumadeiras force-pushed the codex/discord-status-ephemeral branch from 8a4bec5 to fbe6595 Compare April 21, 2026 23:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbe6595266

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gumadeiras
gumadeiras merged commit 19354c9 into main Apr 22, 2026
92 checks passed
@gumadeiras
gumadeiras deleted the codex/discord-status-ephemeral branch April 22, 2026 00:03
@gumadeiras

Copy link
Copy Markdown
Member Author

Merged via squash.

Thanks @gumadeiras!

medikoo pushed a commit to medikoo/openclaw that referenced this pull request Apr 24, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
zhonghe0615 pushed a commit to zhonghe0615/openclaw that referenced this pull request May 7, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Heetisk pushed a commit to Heetisk/openclaw that referenced this pull request Sep 28, 2026
Merged via squash.

Prepared head SHA: 0f5ab77
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants