Skip to content

fix(discord): preserve webhook timeout errors on stalled responses - #116155

Merged
vincentkoc merged 1 commit into
mainfrom
fix/discord-webhook-timeout-test-20260730
Jul 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/discord-webhook-timeout-test-20260730

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Discord webhook sends could report a generic Discord response error instead of the request timeout when an error response body stalled.

Why This Change Was Made

The webhook request deadline now also bounds error-body idle reads, so the shared shorter body-reader default cannot preempt Discord's operation-level timeout contract. The timeout test observes timer advancement and rejection concurrently to keep failures deterministic.

User Impact

Operators now receive the correct timeout error when Discord returns headers but stalls while streaming an error body.

Evidence

  • Reproduced on current main: send.webhook.timeout.test.ts returned DiscordError and emitted PromiseRejectionHandledWarning.
  • node scripts/run-vitest.mjs extensions/discord/src/send.webhook.timeout.test.ts extensions/discord/src/send.webhook-activity.test.ts extensions/discord/src/send.webhook.chunk-limit.test.ts (3 files, 7 tests passed).
  • ./node_modules/.bin/oxfmt --check extensions/discord/src/send.webhook.ts extensions/discord/src/send.webhook.timeout.test.ts passed.
  • git diff --check origin/main...HEAD passed.
  • Autoreview clean with no accepted/actionable findings (0.91 confidence).

AI-assisted: yes. I understand and verified the change.

@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 30, 2026 01:11
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS maintainer Maintainer-authored PR labels Jul 30, 2026
@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 10:08 PM ET / July 30, 2026, 02:08 UTC.

ClawSweeper review

What this changes

The PR makes Discord webhook error-body reads use the webhook request timeout so a stalled non-success response preserves the request-timeout error instead of reporting a generic Discord response error.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for ordinary maintainer review. The supplied current-main reproduction, focused Discord webhook change, and prior ClawSweeper cycles support the bug premise; the member-authored PR also carries the protected maintainer label, so it should not be auto-closed or auto-repaired. Likely related people: vincentkoc is the available recent Discord-webhook contributor signal, though current-main ownership history could not be established from the supplied review evidence.

Priority: P1
Reviewed head: 2fba70b11e7d0489b1f3cf5d87464a19f9cf84cc
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, plausibly correct bug fix with targeted validation; remaining review work is ordinary maintainer approval after the current-base checks complete.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR is exempt from the external-contributor proof gate; it nevertheless includes a focused after-fix regression run and current-main reproduction record.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR is exempt from the external-contributor proof gate; it nevertheless includes a focused after-fix regression run and current-main reproduction record.
Evidence reviewed 4 items Focused implementation: The proposed change passes DISCORD_WEBHOOK_TIMEOUT_MS as the error-body reader's chunk timeout, then retains the existing deadline-expiry check before falling back to an empty response body.
Regression test synchronization: The timeout helper awaits timer advancement and promise rejection together, matching the stated goal of avoiding a late handled-rejection warning while asserting the timeout outcome.
Reported real reproduction and focused validation: The PR body records a current-main reproduction where the timeout test produced DiscordError, plus a focused seven-test run covering timeout, activity, and chunk-limit paths.
Findings None None.
Security None None.

How this fits together

The Discord channel plugin sends outbound webhook messages and parses non-success HTTP responses before returning an error to the operator. This change controls the response-body read timeout so the final reported error reflects the webhook operation deadline.

flowchart LR
  A[Discord webhook send] --> B[HTTP response]
  B --> C{Success status?}
  C -->|No| D[Read limited error body]
  D --> E[Apply webhook deadline]
  E --> F[Classify Discord error]
  F --> G[Operator-visible timeout or API error]
Loading

Decision needed

Question Recommendation
Should this member-authored Discord webhook error-classification fix be approved once its current-base merge result and running checks are complete? Approve after refreshed checks: Approve the focused fix after confirming the current-base merge result and required checks preserve the timeout behavior.

Why: The protected maintainer label requires explicit human handling even though the patch is focused and no concrete correctness defect is visible in the provided review evidence.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and several checks remain in progress, so the approving maintainer should use the refreshed merge result and completed checks rather than the stale-base diff alone.
  • Complete next step (P2) - The member-authored PR has a protected maintainer label and needs ordinary human approval after its current-base checks finish; there is no discrete automated repair to queue.
Agent review details

Security

None.

PR surface

Source +2, Tests -1. Total +1 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 6 +2
Tests 1 1 2 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 9 8 +1

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow Discord-plugin timeout fix if the refreshed merge result still preserves the operation-level timeout and the focused regression coverage remains green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the narrow Discord-plugin timeout fix if the refreshed merge result still preserves the operation-level timeout and the focused regression coverage remains green.

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

Yes, with medium confidence: the PR records a focused current-main reproduction in send.webhook.timeout.test.ts where a stalled error-body read returns DiscordError instead of the request timeout, but this review did not independently execute it.

Is this the best way to solve the issue?

Yes, with medium confidence: applying the existing Discord webhook deadline to the existing limited error-body reader is narrower than changing the shared reader default and retains the plugin's timeout contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A stalled Discord webhook error response currently reports the wrong error class to operators, impairing diagnosis of a live channel-send failure.
  • 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: This member-authored PR is exempt from the external-contributor proof gate; it nevertheless includes a focused after-fix regression run and current-main reproduction record.

Evidence

What I checked:

Likely related people:

  • vincentkoc: The available review context identifies this member as the author of the latest focused Discord webhook timeout repair and its associated regression update; no independent current-main history signal was available in the supplied evidence. (role: recent area contributor; confidence: low; commits: 2fba70b11e7d; files: extensions/discord/src/send.webhook.ts, extensions/discord/src/send.webhook.timeout.test.ts)

Rank-up moves

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

  • Confirm the refreshed current-base merge result and required checks before approval.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-30T01:15:19.310Z sha a0784a8eb62d5471ed0f05701f4e77491244fc08 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T01:31:09.180Z sha 4b6ec5f6a9c5919791d027181d580cabb60f9a08 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T01:45:34.822Z sha 0ccc7a4375d536950e8bedc58f0b4c4712de0202 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/discord-webhook-timeout-test-20260730 branch 2 times, most recently from 4b6ec5f to 0ccc7a4 Compare July 30, 2026 01:41
@vincentkoc
vincentkoc force-pushed the fix/discord-webhook-timeout-test-20260730 branch from 0ccc7a4 to 2fba70b Compare July 30, 2026 02:04
@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper rank-up move handled: the refreshed head has a successful exact openclaw/ci-gate. Current main drift is limited to the merged Google test isolation and unrelated cron implementation/tests; it does not overlap the Discord webhook files or merge-critical infrastructure. The repo-native prepare/merge flow will verify the final merge result before landing.

@vincentkoc
vincentkoc merged commit b660662 into main Jul 30, 2026
110 checks passed
@vincentkoc
vincentkoc deleted the fix/discord-webhook-timeout-test-20260730 branch July 30, 2026 02:17
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to zhangguiping-xydt/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  fix(macos): stop canceled voice wake timers (openclaw#116189)
  fix(macos): coalesce location permission requests (openclaw#116183)
  fix(macos): guard remote tunnel restart ownership (openclaw#116172)
  fix(agents): throw CompactionError when summarization fails (openclaw#115500)
  fix(test): isolate ACP startup output stream (openclaw#116076)
  fix(agents): deny all tools when scheduled authority names a removed account (openclaw#115932)
  fix(test): stop collecting Vydra test helpers (openclaw#116139)
  fix(discord): preserve webhook deadline errors (openclaw#116155)
  fix(test): isolate Google embedding batch timeout (openclaw#116161)
  fix(cron): stop replaying old schedule slots after a cron job is edited (openclaw#115779)
  fix(plugins): report request timeouts for stalled response bodies (openclaw#116166)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
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 P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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