Skip to content

test(discord): cover durable chunk retry delivery#82898

Merged
steipete merged 4 commits into
mainfrom
fix/discord-durable-chunk-retry
May 17, 2026
Merged

test(discord): cover durable chunk retry delivery#82898
steipete merged 4 commits into
mainfrom
fix/discord-durable-chunk-retry

Conversation

@steipete

@steipete steipete commented May 17, 2026

Copy link
Copy Markdown
Contributor

"## Summary\n- Add a Discord durable delivery regression for multi-chunk final text.\n- Prove a transient 500 on the second planned chunk is retried and both Discord message ids are preserved in the durable receipt.\n\n## Verification\n- ./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts\n- node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts\n- codex-review --parallel-tests "./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts && node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts"\n\n## Real behavior proof\nBehavior addressed: Discord durable final delivery now has regression coverage for planned multi-chunk fan-out where a later chunk hits a transient Discord 500 and must retry instead of silently disappearing.\nReal environment tested: Local OpenClaw Discord plugin durable delivery path with the Discord send seam mocked at the network boundary.\nExact steps or command run after this patch: node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts\nEvidence after fix: The test sends two newline-planned chunks through sendDurableMessageBatch, makes chunk two fail once with status 500, then observes three send attempts and a sent durable result.\nObserved result after fix: Durable receipt platformMessageIds contains msg-chunk-1 and msg-chunk-2; payloadOutcomes records one sent payload with both delivered results.\nWhat was not tested: Live Discord API delivery was not exercised in this PR; the network boundary is mocked to deterministically trigger the transient later-chunk failure.\n\nRefs #82858\n"

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels May 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Verification before merge:

  • ./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts
  • node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts
  • codex-review --parallel-tests "./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts && node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts"

Known proof gap: live Discord API delivery was not run; the test mocks the Discord send seam to deterministically cover later-chunk transient retry behavior.

@clawsweeper

clawsweeper Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR adds a Discord durable-delivery regression test for two planned text chunks with a transient 500 on the later chunk, updates changed-test routing, and makes a small Telegram message-cache strictness cleanup.

Reproducibility: yes. for the PR's focused mocked path: the diff drives sendDurableMessageBatch through the Discord plugin registry, fails the second planned chunk once with status 500, and asserts retry plus both message IDs. I did not run the test or reproduce the live Discord report.

Real behavior proof
Override: A maintainer applied proof: override for this PR.

Next step before merge
No automated repair is indicated; the remaining action is maintainer verification and landing with proof override, protected-label handling, and CI completion.

Security
Cleared: The diff adds tests and a small internal Telegram cleanup only; it does not change dependencies, workflows, package metadata, install scripts, secrets handling, or external code execution paths.

Review details

Best possible solution:

Land the focused regression test after required CI and maintainer verification, while keeping the linked Discord message-loss issue open until the live runtime behavior is fixed or proven on current main.

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

Yes for the PR's focused mocked path: the diff drives sendDurableMessageBatch through the Discord plugin registry, fails the second planned chunk once with status 500, and asserts retry plus both message IDs. I did not run the test or reproduce the live Discord report.

Is this the best way to solve the issue?

Yes for regression coverage: it exercises the existing durable-send, chunking, retry, and receipt contracts without adding product surface. It is not a complete runtime fix or live proof for the linked Discord message-loss report.

Acceptance criteria:

  • ./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts
  • node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts
  • codex-review --parallel-tests "./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts && node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts"

What I checked:

  • Live PR state: The GitHub API reports this PR open, unmerged, mergeable, and at head 415bfca with labels including maintainer, proof: override, P1, and impact:message-loss. (415bfcad205b)
  • PR diff: The patch adds a durable Discord delivery test that registers the Discord plugin through the SDK test registry, sends newline-planned text through sendDurableMessageBatch, makes the second planned chunk fail once with status 500, and asserts both retried delivery and durable receipt ids. (extensions/discord/src/durable-delivery.test.ts:39, 415bfcad205b)
  • Current durable fan-out path: Current main plans outbound text units using the channel chunker and sends every text unit through handler.sendText, appending each result before durable receipt construction. (src/infra/outbound/deliver.ts:1395, 422a1374e02b)
  • Discord retry contract: Current main wraps Discord text sends in withDiscordDeliveryRetry, whose helper retries raw 429 and 5xx status values. (extensions/discord/src/outbound-adapter.ts:177, 422a1374e02b)
  • Retry helper source: isRetryableDiscordDeliveryError returns true for status 429 and any status >= 500 except DiscordError, matching the PR's transient 500 scenario. (extensions/discord/src/delivery-retry.ts:17, 422a1374e02b)
  • Coverage gap on current main: Current main has sendDurableMessageBatch tests and Discord outbound retry tests, but no Discord durable-delivery test for multi-chunk fan-out through the plugin registry. (422a1374e02b)

Likely related people:

  • steipete: Path history shows steipete authored the Discord transient outbound retry helper and the channel message lifecycle/durable delivery API work that this test exercises. (role: recent feature owner and PR author with prior merged area history; confidence: high; commits: a6ccb5f698df, 8bfabd6bb139, a4b17d65a8ff; files: extensions/discord/src/delivery-retry.ts, extensions/discord/src/outbound-adapter.ts, src/channels/message/send.ts)
  • obviyus: Recent path history shows obviyus working on Discord outbound delivery context and Telegram reply-cache behavior adjacent to both surfaces touched by this PR. (role: recent adjacent Discord and Telegram contributor; confidence: medium; commits: d1280a3de939, 741eafea5fc7, 440e7d2a8752; files: extensions/discord/src/outbound-adapter.ts, extensions/telegram/src/message-cache.ts)
  • joshavant: The current main commit touching extensions/telegram/src/message-cache.ts includes type alignment work in the same file as the PR's Telegram strictness cleanup. (role: recent adjacent Telegram cache contributor; confidence: low; commits: 422a1374e02b; files: extensions/telegram/src/message-cache.ts)

Remaining risk / open question:

  • The focused test was not executed in this read-only review.
  • Live Discord API delivery remains untested; the real behavior proof gate is satisfied by proof: override rather than live Discord evidence.
  • Two public checks were still in progress at the latest check-run query.
  • The linked Discord message-loss issue remains open, so this PR is coverage rather than proof that the reported live runtime behavior is fixed.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 422a1374e02b.

@steipete steipete added the proof: override Maintainer override for the external PR real behavior proof gate. label May 17, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. labels May 17, 2026
@steipete
steipete force-pushed the fix/discord-durable-chunk-retry branch from 076fbb1 to 639b442 Compare May 17, 2026 04:40
@openclaw-barnacle openclaw-barnacle Bot added the channel: telegram Channel integration: telegram label May 17, 2026
@steipete
steipete force-pushed the fix/discord-durable-chunk-retry branch from 7131d42 to 415bfca Compare May 17, 2026 05:04
@steipete

Copy link
Copy Markdown
Contributor Author

Verification for 415bfca:

Behavior addressed: Discord durable chunk fan-out now has a regression test covering a later chunk transient 500 and retry delivery; PR also carries a narrow Telegram/test-lane CI blocker repair required after rebasing onto latest main.
Real environment tested: local OpenClaw checkout plus GitHub Actions PR CI.
Exact steps or command run after this patch:

  • ./node_modules/.bin/oxfmt --check --threads=1 extensions/discord/src/durable-delivery.test.ts extensions/telegram/src/message-cache.ts src/scripts/test-projects.test.ts
  • node --import tsx scripts/check-no-extension-test-core-imports.ts
  • node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo
  • node scripts/run-vitest.mjs extensions/discord/src/durable-delivery.test.ts extensions/telegram/src/message-cache.test.ts
  • node scripts/run-vitest.mjs src/scripts/test-projects.test.ts -t 'keeps extension production changes on the owning extension lane'
  • codex-review focused runs on the Discord test/runtime import, Telegram strict-check repair, and test-projects fixture update
    Evidence after fix: CI run 25981945277 green for check, check-additional, build-artifacts, core-support-boundary, lint, prod types, test types, extension bundled/package-boundary, and node shards; Critical Quality/Security High checks passed or skipped as designed; Real behavior proof passed with maintainer proof override label.
    Observed result after fix: no failing or pending PR checks for head 415bfca.
    What was not tested: live Discord API delivery was not replayed; this is deterministic send-seam regression coverage for the durable fan-out/retry path.

@steipete
steipete merged commit 6a8a655 into main May 17, 2026
114 checks passed
@steipete
steipete deleted the fix/discord-durable-chunk-retry branch May 17, 2026 05:12
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 20, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* test(discord): cover durable chunk retry delivery

* test(discord): use plugin sdk test runtime

* fix(telegram): satisfy message cache strict checks

* test(discord): include durable delivery in changed lane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: telegram Channel integration: telegram impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: override Maintainer override for the external PR real behavior proof gate. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant