Skip to content

fix(discord): restore question receipts after rejected acknowledgements - #128293

Merged
steipete merged 1 commit into
mainfrom
codex/discord-question-ack-feedback-20260823
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/discord-question-ack-feedback-20260823

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users answering a Discord question would receive no visible confirmation or failure explanation when Discord rejected the initial component acknowledgement, even though the answer could already have been accepted by OpenClaw.

Why This Change Was Made

Discord only accepts an interaction follow-up after its initial callback succeeds. The private question-feedback owner now reads the authoritative interaction response state and uses an ephemeral initial reply when acknowledgement failed, while retaining the existing ephemeral follow-up after an accepted acknowledgement. Successful answers, already-answered questions, and question-resolution failures share one canonical feedback path; authorization, answer ownership, public APIs, and provider configuration are unchanged.

Security-sensitive execution-approval and plugin-binding approval interaction owners share related acknowledgement lifecycle patterns and require separate owner/security review. They are intentionally out of scope and were not modified.

User Impact

Discord users reliably see whether their answer was submitted, already handled, or could not be submitted after a transient acknowledgement failure. Existing private response visibility and one-time answer resolution stay unchanged.

Evidence

  • Exact reviewed head: 7ed5bf34ee15a16a5da1aa192759b277a2d29e02.
  • Authentic owner-boundary RED before the fix: all three resolution outcomes attempted /webhooks/... after the initial acknowledgement was rejected instead of using the still-available interaction callback.
  • Actual Discord interaction/REST lifecycle GREEN after the fix: six table cases cover submitted, already-answered, and failed-resolution outcomes crossed with accepted and rejected acknowledgements, verifying callback types 6/4, exact callback versus webhook routes, ephemeral flags, final response state, and exactly one resolution.
  • 86 Discord owner, native interaction, component, provider-registration, question-envelope, and activity tests passed; seven Slack and Telegram sibling question-feedback tests passed separately.
  • Independent reviewer reran five owner/sibling suites: 64 tests passed; final full-diff review CLEAN. Fresh authenticated complete committed-branch review CLEAN.
  • Targeted typed lint, formatting, whitespace, plugin boundaries, dependency pins, export scans, and changed-file guards passed. Repository-wide extension production/test typechecks encounter only pre-existing unchanged ACPX promptStarted/elicitationModes diagnostics; no changed Discord file emits a diagnostic.
  • Production delta: 11 additions, 14 deletions (net -3); regression tests are counted separately. Authenticated live Discord delivery was not run; exact provider-request behavior was exercised through the real interaction owner and REST request boundary.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 16:53
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 1:30 PM ET / 17:30 UTC.

ClawSweeper review

What this changes

The PR restores ephemeral Discord question receipts after a rejected component acknowledgement by replying through the still-available initial callback instead of a follow-up webhook.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer proof-sufficiency review: the branch correctly selects Discord’s initial response when the interaction controller remains unacknowledged, but no authenticated Discord trace confirms the external callback/follow-up lifecycle.

Priority: P2
Reviewed head: 7ed5bf34ee15a16a5da1aa192759b277a2d29e02
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused, net-negative owner repair and route assertions are solid; a redacted authenticated Discord trace would remove the remaining provider-contract uncertainty.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its owner-boundary REST evidence is strong but does not replace the repository’s requested authenticated Discord confirmation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its owner-boundary REST evidence is strong but does not replace the repository’s requested authenticated Discord confirmation.
Evidence reviewed 6 items Current-main failure path: Current main catches an acknowledgement failure but still sends every success and failure receipt through followUp; an unacknowledged interaction therefore cannot use its remaining initial callback.
Response-owner contract: The interaction controller maps unacknowledged state to an initial reply, and records acknowledgement only after the callback REST request resolves.
Changed owner boundary: The branch preserves authorization and question resolution, then uses reply only while responseState is unacknowledged and retains followUp otherwise.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/discord/src/monitor/questions.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/discord/src/monitor/questions.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128293-HA8sdr/target$ node scripts/run-vitest.mjs extensions/discord/src/monitor/questions.test.ts
node scripts/run-vitest.mjs extensions/discord/src/monitor/questions.test.ts
[test] starting test/vitest/vitest.extension-discord.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128293-HA8sdr/target

 ✓  extension-discord  extensions/discord/src/monitor/questions.test.ts (10 tests) 41ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  17:31:43
   Duration  13.98s (transform 11.12s, setup 1.09s, import 12.47s, tests 41ms, environment 0ms)






































Assertions:

  • PASS expect_output: questions.test.ts

How this fits together

A Discord question-button click is authorized and resolved by the Discord plugin, then receives an ephemeral receipt. The interaction response controller decides whether that receipt must use the initial callback or a follow-up webhook.

flowchart LR
  A[Discord question click] --> B[Authorization]
  B --> C[Question resolution]
  C --> D[Interaction response state]
  D -->|Unacknowledged| E[Ephemeral initial reply]
  D -->|Acknowledged| F[Ephemeral follow-up]
  E --> G[Visible question receipt]
  F --> G
Loading

Decision needed

Question Recommendation
Is the owner-boundary REST proof sufficient for this Discord lifecycle repair, or should merge wait for a redacted authenticated Discord recovery trace? Capture live recovery proof: Record a redacted real Discord interaction showing the initial callback recovery path and visible ephemeral receipt after the acknowledgement fault.

Why: The patch’s route decision depends on Discord’s externally enforced interaction lifecycle, which the local table test models but does not authenticate against Discord.

Before merge

  • Resolve merge risk (P1) - The route selection is covered through the plugin’s REST boundary, but the PR body confirms that no authenticated Discord interaction was exercised; merge would rely on the unverified external callback/follow-up lifecycle.
  • Complete next step (P2) - A maintainer must decide whether the existing owner-boundary evidence is sufficient or obtain authenticated Discord lifecycle proof before merge.
Agent review details

Security

None.

PR surface

Source -3, Tests +104. Total +101 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 14 -3
Tests 1 105 1 +104
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 116 15 +101

Review metrics

Metric Value Why it matters
Production vs regression-test LOC production -3, tests +104 The repair consolidates receipt delivery in production while adding six route-and-outcome regression cases.

Merge-risk options

Maintainer options:

  1. Prove the Discord recovery path before merge (recommended)
    Add a redacted authenticated Discord trace confirming that a rejected acknowledgement can still receive the ephemeral initial receipt.
  2. Accept the provider-proof gap
    Merge based on the owner-boundary route tests while accepting that Discord itself was not exercised for this failure mode.

Technical review

Best possible solution:

Keep the single state-based receipt path and add a redacted authenticated Discord trace that demonstrates the rejected-acknowledgement recovery before merging.

Do we have a high-confidence way to reproduce the issue?

Yes, in source: reject the acknowledgement REST call, resolve a question outcome, and observe current main attempt an unusable webhook follow-up; the branch test covers this path but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, the state-based selection is the narrowest owner-boundary repair because it leaves authorization and one-time question resolution unchanged while using the controller’s canonical reply action.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b0dafb2551a4.

Labels

Label changes:

  • add P2: A limited Discord question-feedback failure can leave users without a receipt after an acknowledgement fault.
  • add merge-risk: 🚨 message-delivery: The change selects between Discord callback and webhook delivery paths, whose provider lifecycle has not been authenticated live.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its owner-boundary REST evidence is strong but does not replace the repository’s requested authenticated Discord confirmation.

Label justifications:

  • P2: A limited Discord question-feedback failure can leave users without a receipt after an acknowledgement fault.
  • merge-risk: 🚨 message-delivery: The change selects between Discord callback and webhook delivery paths, whose provider lifecycle has not been authenticated live.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its owner-boundary REST evidence is strong but does not replace the repository’s requested authenticated Discord confirmation.

Evidence

What I checked:

Likely related people:

  • steipete: History attributes the original ask_user follow-up feature to steipete, and this PR changes its Discord question receipt path. (role: feature owner and recent area contributor; confidence: high; commits: d7de67ae027d, 7ed5bf34ee15; files: extensions/discord/src/monitor/questions.ts, extensions/discord/src/internal/interactions.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a redacted authenticated Discord interaction showing the rejected-acknowledgement recovery and visible ephemeral receipt.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 663a9d2 into main Aug 23, 2026
180 checks passed
@steipete
steipete deleted the codex/discord-question-ack-feedback-20260823 branch August 23, 2026 17:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant