Skip to content

fix(discord): list all pinned messages - #117464

Merged
steipete merged 4 commits into
mainfrom
codex/qa402-discord-pins-opaque-pagination
Oct 21, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/qa402-discord-pins-opaque-pagination

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes incomplete Discord pin lists when a channel has more than 50 pinned messages.

User Impact

Pin listing returns every page, and pin/unpin use Discord's supported message-pin endpoints. Existing message-ID normalization and mutation authority remain intact.

Why This Change Was Made

Current main's extensions/discord/src/send.messages.ts:220 uses the deprecated first-page-only pin endpoint. Pagination belongs in this existing transport owner. Follow has_more and pass the last pinned_at timestamp verbatim, preserving its precision and offset. Use the installed API dependency's current routes for all pin operations.

The earlier patch's arbitrary pin/page caps and extensive response validation are removed. A missing or nonadvancing cursor fails visibly instead of looping.

Evidence

The three transport regressions fail on current main (f29ecf310b2c), including first-50 truncation and deprecated request paths. With the fix, both touched suites pass all 62 tests. Tests cover 250 pins, sparse pages extending beyond five requests, exact timestamp advancement, and normalized pin/unpin routes. No live Discord API was used; localhost HTTP transport proof and PR CI are the validation scope for this repair lane.

Production +28/-6 (net +22); tests +62/-4 (net +58); docs +2/-0. Growth is confined to the page loop and three transport regressions. Targeted formatting passes, and isolated Codex review is scoped-clean with no actionable P0–P2 findings. Type-aware lint passes.

The first CI run (39564575141, job 119104324826) found the multiline assertion’s safety comment too far from its cast. The response is now bound before the documented cast; the failed assertion-safety ratchet passes locally. This formatting/placement repair leaves the reviewed transport behavior unchanged. Final exact-head CI 39570302654 is green on 3d3e4be2d165b71dc0795fec53f2dde4b3e261be, including both repaired jobs. There are no inherited failures.

The second CI run (39566991244, job 119112278663) caught an old /pins/ URL in the scheduled-send Gateway fake. The fixture now accepts the supported /messages/pins/ route. Both affected cases fail before this repair; the full 11-test file passes afterward. Core lint, formatting, and an isolated review of this one-line test change pass. No production change was needed.

Fresh ClawSweeper review on 3d3e4be2d165b71dc0795fec53f2dde4b3e261be reports zero findings and ready for maintainer review.

Landing conflict resolution

Merged current main into f1d2e9280ff68ebb79f2970de4638c7f6d92e6fc. Resolved extensions/discord/src/internal/api.test.ts by preserving main's fixture refactor and setting its independent expected pin path to the reviewed /messages/pins/ endpoint. Production files merged without conflicts. All 73 tests passed across the pin/API suites (62) and scheduled-send integration suite (11), in 52.87 seconds total. Scoped type-aware lint, formatting, and git diff --check also pass. Prior-head CI remains historical; current-head CI must finish separately.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: M maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR retrieves every Discord pin page and switches pin/unpin requests to the supported endpoints.

Example: List pins in a Discord channel containing 250 pinned messages.

  • Before: Only the first 50 pinned messages are returned.
  • After: All 250 pinned messages are returned across five pages.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is correct and exact-head CI passes; confidence in real behavior rests on reported transport-harness coverage rather than a shipped-entry-point demonstration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its reported localhost runs exercise the changed production helpers and real REST client, while live Discord behavior remains unverified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Discord pin listing silently omits pinned messages after the first 50.
Reason: The maintainer-approved direction restores complete results with one transport loop and no new public option or competing owner.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current Discord pin-list truncation bug with a focused transport change; no actionable defects remain, and the exact-head CI gate passes.

Priority: P2
Reviewed head: 3d3e4be2d165b71dc0795fec53f2dde4b3e261be

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped list-pins run against Discord with more than 50 pins is supplied; coverage is reported through the production HTTP client on localhost.
Agent review details

How this fits together

Discord message actions call the plugin’s transport helpers, which send authorized REST requests and return message arrays for normalization and presentation.

flowchart LR
  A[Message action] --> B[Discord action handler]
  B --> C[Pin transport helpers]
  C --> D[Authorized REST client]
  D --> E[Discord pin endpoints]
  E --> F[Normalized message results]
Loading

Technical review

Best possible solution:

Merge the focused pagination loop and supported routes through the existing Discord transport owners.

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

Current main makes one request to the deprecated first-50 endpoint; the supplied regressions report failure on the base and success after the fix, without tests being rerun during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete fix: paginate in listPinsDiscord, retain its message-array result, and update the existing shared mutation routes and affected fixtures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 74201376f97d.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 7e16a22 adds extensions/discord/src/internal/api.messages.ts:54 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7e16a229e3ea; files: extensions/discord/src/internal/api.messages.ts)
  • Eric Curtin: Raw commit 37aefbf adds extensions/discord/src/send.messages.ts:185 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 37aefbf936a9; files: extensions/discord/src/send.messages.ts)
  • Shakker: Raw commit 7aee0c0 adds extensions/discord/src/internal/api.messages.ts:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7aee0c0b730b; files: extensions/discord/src/internal/api.messages.ts)

PR surface

Source +22, Tests +58, Docs +2. Total +82 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 28 6 +22
Tests 3 62 4 +58
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 92 10 +82

Review metrics

Metric Value Why it matters
Production versus tests Production +28/-6; tests +62/-4 Production growth is the page loop; test growth protects pagination, cursor preservation, and supported transport paths.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Pin listing silently omits results beyond 50, with impact limited to Discord channels containing larger pin collections.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (19 earlier review cycles; latest 8 shown)
  • reviewed August 7, 2026, 4:48 AM ET / 08:48 UTC sha unknown :: found issues before merge. :: [P2] Preserve the returned pin cursor verbatim
  • reviewed August 16, 2026, 4:10 PM ET / 20:10 UTC sha unknown :: needs changes before merge. :: [P2] Preserve the returned pin cursor verbatim
  • reviewed 2026-08-19T10:33:26.155Z sha ff1d62d :: needs changes before merge. :: [P2] Preserve the returned cursor verbatim
  • reviewed 2026-08-25T08:19:26.507Z sha ff1d62d :: needs changes before merge. :: [P2] Preserve the pin cursor byte-for-byte
  • reviewed 2026-09-02T05:00:54.768Z sha ff1d62d :: found issues before merge. :: [P2] Preserve the pin cursor byte-for-byte
  • reviewed 2026-10-02T12:35:46.040Z sha ff1d62d :: blocked before merge. :: none
  • reviewed 2026-10-21T08:05:41.674Z sha e495126 :: needs changes before merge. :: [P2] Keep the safety explanation adjacent to the assertion operator
  • reviewed 2026-10-21T08:15:01.604Z sha 012154b :: needs maintainer review before merge. :: none

Reviewed October 21, 2026, 4:47 AM ET / 08:47 UTC (Revision 20).

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 7, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 19, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 17, 2026
@clawsweeper clawsweeper Bot added 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. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
Use the supported message-pin endpoints and follow has_more with the
last pinned_at timestamp unchanged. Keep pagination in listPinsDiscord
and preserve message-ID normalization and request authority.

Release-note context: Discord pin listing now returns every page instead
of silently truncating at 50 pinned messages.
@steipete
steipete force-pushed the codex/qa402-discord-pins-opaque-pagination branch from ff1d62d to e495126 Compare October 21, 2026 07:48
@steipete steipete changed the title fix(discord): preserve opaque cursors when listing channel pins fix(discord): list all pinned messages Oct 21, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
Retain main API fixture refactor and preserve the reviewed current pin endpoint as its independent expected path. Production files merge without conflicts.
@steipete
steipete enabled auto-merge (squash) October 21, 2026 19:09
@steipete
steipete merged commit 4db1758 into main Oct 21, 2026
112 checks passed
@steipete
steipete deleted the codex/qa402-discord-pins-opaque-pagination branch October 21, 2026 19:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
* fix(discord): list all pinned messages

Use the supported message-pin endpoints and follow has_more with the
last pinned_at timestamp unchanged. Keep pagination in listPinsDiscord
and preserve message-ID normalization and request authority.

Release-note context: Discord pin listing now returns every page instead
of silently truncating at 50 pinned messages.

* fix(discord): place pin response invariant beside its assertion

* test(discord): update scheduled pin transport fixture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants