Skip to content

refactor(discord): reuse canonical interactive component renderer - #129031

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup4-discord-interactive-owner-20260824
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup4-discord-interactive-owner-20260824

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Route Discord's shipped deprecated interactive-component entry point through its canonical presentation renderer while preserving the existing public function, signature, exports, and typed security behavior.
  • Remove the redundant renderer and its obsolete unsafe assertion, shrinking production code by 19 lines and tightening the assertion-safety baseline.
  • Extend the existing owner-level coverage for legacy and canonical component behavior.

Verification

  • Eleven focused real Discord interactive, security, action, and transport suites passed: 179 tests.
  • Assertion-safety ratchet, formatting, diff, and changed-file checks passed.
  • Fresh structured autoreview and independent source review found no actionable issues.

@clawsweeper

clawsweeper Bot commented Aug 25, 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 25, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 2:01 AM ET / 06:01 UTC.

ClawSweeper review

What this changes

The PR replaces Discord’s duplicate legacy interactive-reply renderer with conversion to the canonical presentation renderer and adds typed-action compatibility coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The member-authored, maintainer-labelled refactor has no actionable correctness or security finding: the legacy adapter preserves its three supported block variants before using the same canonical Discord renderer. Exact-head CI and merge refresh remain pending.

Priority: P3
Reviewed head: 47072b8dd9646121137c66137844b5f65f68e502

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with direct compatibility coverage and no identified patch defect; CI completion remains a normal landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository context identifies this as a member-authored PR, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Discord suites.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository context identifies this as a member-authored PR, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Discord suites.
Evidence reviewed 6 items Canonical owner path: The deprecated legacy entry point converts only legacy input, then delegates to the canonical renderer; the renderer remains the sole place that maps presentation blocks into Discord components.
Bridge contract: Legacy replies contain only text, buttons, and select blocks; the SDK bridge preserves those shapes when producing a MessagePresentation.
Callers: Both outbound reply delivery and the Discord send action still enter the deprecated adapter only for legacy interactive payloads, while presentation input already uses the canonical renderer.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/discord/src/shared-interactive.test.ts

Result: PASS (completed)

pnpm test extensions/discord/src/shared-interactive.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129031-WStYdx/target$ pnpm test extensions/discord/src/shared-interactive.test.ts
$ node --import tsx scripts/test-projects.mts extensions/discord/src/shared-interactive.test.ts
pnpm test extensions/discord/src/shared-interactive.test.ts
[test] starting test/vitest/vitest.extension-discord.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129031-WStYdx/target

 ✓  extension-discord  extensions/discord/src/shared-interactive.test.ts (25 tests) 28ms

 Test Files  1 passed (1)
      Tests  25 passed (25)
   Start at  06:02:31
   Duration  5.92s (transform 4.63s, setup 748ms, import 4.87s, tests 28ms, environment 0ms)

[test] passed 1 Vitest shard in 10.32s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129031-WStYdx/target$ pnpm test extensions/discord/src/shared-interactive.test.ts


































Assertions:

  • PASS expect_output: shared-interactive.test.ts

How this fits together

Discord converts legacy interactive replies and newer message presentations into native component blocks before outbound delivery. Both inputs should preserve action type and ordering while sharing one renderer.

flowchart LR
  A[Legacy interactive reply] --> B[Legacy-to-presentation bridge]
  C[Message presentation] --> D[Canonical Discord renderer]
  B --> D
  D --> E[Discord component blocks]
  E --> F[Outbound Discord delivery]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports this clean PR as behind main and its required checks are still in progress; refresh the merge result and exact-head CI before landing.
  • Complete next step (P2) - No concrete repair is needed; this maintainer-labelled PR awaits ordinary exact-head CI and merge review.
Agent review details

Security

None.

PR surface

Source -19, Tests +53, Other -1. Total +33 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 22 -19
Tests 1 53 0 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 3 56 23 +33

Review metrics

Metric Value Why it matters
Production versus test delta production +3/-22 (net -19); tests +53; assertion baseline -1 The refactor removes a duplicate production renderer while adding focused legacy-compatibility coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one Discord component-rendering path, then rebase or refresh the clean merge result and land only after exact-head checks pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one Discord component-rendering path, then rebase or refresh the clean merge result and land only after exact-head checks pass.

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

Not applicable: this is a behavior-preserving refactor; source inspection traces legacy calls through the adapter into the existing canonical renderer.

Is this the best way to solve the issue?

Yes. Reusing the established presentation renderer removes duplicate policy while the SDK bridge preserves the legacy reply’s supported block shapes.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small internal Discord renderer cleanup with no demonstrated user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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: Repository context identifies this as a member-authored PR, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Discord suites.

Label justifications:

  • P3: This is a small internal Discord renderer cleanup with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository context identifies this as a member-authored PR, so the external-contributor real-behavior-proof gate does not apply; the PR body additionally reports focused Discord suites.

Evidence

What I checked:

Likely related people:

  • steipete: History shows Peter Steinberger authored the interactive-response consolidation and most recent shared-renderer work. (role: feature owner and recent area contributor; confidence: high; commits: 9214e6381d49, 47072b8dd964; files: extensions/discord/src/shared-interactive.ts, extensions/discord/src/shared-interactive.test.ts)
  • wanyongstar: Authored the prior fix preserving authored block order in the canonical Discord presentation renderer. (role: adjacent behavior contributor; confidence: medium; commits: 57a237ab13cc; files: extensions/discord/src/shared-interactive.ts, extensions/discord/src/shared-interactive.test.ts)

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 0a79ae5 into main Aug 25, 2026
171 checks passed
@steipete
steipete deleted the codex/cleanup4-discord-interactive-owner-20260824 branch August 25, 2026 06:30
@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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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