Skip to content

fix(discord): backport recovered tool warning suppression#87452

Merged
steipete merged 6 commits into
release/2026.5.27from
backport/discord-drop-recovered-tool-warning-2026.5.27
May 28, 2026
Merged

fix(discord): backport recovered tool warning suppression#87452
steipete merged 6 commits into
release/2026.5.27from
backport/discord-drop-recovered-tool-warning-2026.5.27

Conversation

@steipete

@steipete steipete commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Backport fix(discord): suppress recovered tool warnings #87451 to release/2026.5.27.
  • Keep Discord from posting metadata-marked recovered tool-warning finals after a useful final answer.
  • Preserve warning-only fallback delivery and ordinary mutating tool failure warnings.

Verification

  • pnpm test extensions/discord/src/monitor/message-handler.process.test.ts -- --reporter=dot (78 passed on release branch)
  • pnpm check:changed via Blacksmith Testbox tbx_01ksnwp61m86gqtb00r6pffzea, Actions run 26545083807 (passed; release/main comparison widened to all lanes)

Real behavior proof

Behavior addressed: backports the Discord recovered-tool-warning suppression from #87451 to the current release branch.
Real environment tested: local focused Vitest on the release branch plus Blacksmith Testbox changed gate.
Exact steps or command run after this patch: pnpm test extensions/discord/src/monitor/message-handler.process.test.ts -- --reporter=dot; pnpm check:changed.
Evidence after fix: focused Discord shard passed 78 tests on the release branch; Testbox tbx_01ksnwp61m86gqtb00r6pffzea exited 0.
Observed result after fix: metadata-marked recovered warnings are held as fallback only; warning-only and mutating-failure warning behavior remains visible.
What was not tested: live Discord production message send against Hetzner.

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

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 27, 2026, 8:23 PM ET / 00:23 UTC.

Summary
Backports Discord recovered non-terminal tool-warning suppression to the release branch, adds fallback replay/freshness coverage, and aligns a local-only reply-payload testing SDK subpath/package metadata.

PR surface: Source +60, Tests +137, Config +2, Other +2. Total +201 across 10 files.

Reproducibility: no. high-confidence live reproduction/proof is present. The source path and focused tests cover the recovered-warning fallback behavior, but there is no redacted live Discord transcript or runtime log showing after-fix behavior.

Review metrics: 2 noteworthy metrics.

  • Plugin SDK surface: 1 public export, 1 local-only testing subpath added. The branch changes plugin SDK metadata, so maintainers should confirm the release-branch API/package surface is intentional.
  • Dependency delta: 0 dependency version changes, 0 lockfiles changed, 1 package files-array update. The dependency alert is present, but the reviewed diff points to package export contents rather than new third-party code.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Add a redacted live Discord transcript, runtime log, recording, or linked artifact showing the suppression and fallback-warning cases.
  • Confirm the package files-array and local-only SDK testing subpath are intentional for the release branch.

Proof guidance:
Needs real behavior proof before merge: The PR body provides focused Vitest and Testbox checks only; add redacted live Discord output, logs, a recording, or a linked artifact, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.

Mantis proof suggestion
A real visible Discord transcript would materially reduce the remaining message-delivery proof risk. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify on Discord that a useful final answer suppresses the recovered tool warning, while warning-only and failed-final fallback warnings still appear.

Risk before merge

  • Real behavior proof is still unit/Testbox-only; no live Discord transcript, runtime log, recording, or linked artifact proves the visible delivery behavior after this patch.
  • The PR intentionally suppresses and replays Discord warning finals, so a bad edge case could hide a legitimate warning-only or failed-final message in the release branch.

Maintainer options:

  1. Add real Discord proof first (recommended)
    Have the author or maintainer attach a redacted live Discord transcript, runtime log, recording, or linked artifact that shows the suppression and fallback cases on the release branch.
  2. Accept test-only proof for release urgency
    Maintainers can intentionally land with the focused Vitest and Testbox evidence, but they would own the remaining live Discord delivery uncertainty.

Next step before merge
Protected maintainer label plus missing real behavior proof make this a maintainer-handled release-backport review, not an automated repair-lane candidate.

Security
Cleared: No concrete security or supply-chain regression was found; the package.json change updates package file exports and no dependency versions, lockfiles, workflows, permissions, or secret paths change.

Review details

Best possible solution:

Merge the backport only after maintainer approval and real Discord proof showing duplicate recovered warnings are suppressed while warning-only and failed-final fallback warnings still deliver.

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

No high-confidence live reproduction/proof is present. The source path and focused tests cover the recovered-warning fallback behavior, but there is no redacted live Discord transcript or runtime log showing after-fix behavior.

Is this the best way to solve the issue?

Yes on code shape: the branch moves fallback replay into the dispatcher settled path and adds a freshness recheck. The remaining issue is merge readiness, not a clear code defect.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 748510b7a3e1.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority Discord delivery bugfix/backport with limited channel-specific blast radius.
  • merge-risk: 🚨 message-delivery: The patch changes when Discord warning finals are suppressed or replayed, which can affect whether users see fallback warning messages.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides focused Vitest and Testbox checks only; add redacted live Discord output, logs, a recording, or a linked artifact, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +60, Tests +137, Config +2, Other +2. Total +201 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 67 7 +60
Tests 2 175 38 +137
Docs 0 0 0 0
Config 1 2 0 +2
Generated 0 0 0 0
Other 2 2 0 +2
Total 10 246 45 +201

What I checked:

Likely related people:

  • steipete: Merged commit da27904 introduced recovered tool-warning suppression on main, and the current branch commits refine the same Discord fallback behavior for the release branch. (role: current-main feature author and backport owner; confidence: high; commits: da279041aba2, 9d7f57c02ee4, ce4134e13f92; files: extensions/discord/src/monitor/message-handler.process.ts, extensions/discord/src/monitor/message-handler.process.test.ts, src/auto-reply/dispatch.ts)
  • vincentkoc: Commit 21d960 is the recent blamed base for much of the surrounding Discord delivery and auto-reply dispatch code that this branch builds on. (role: adjacent recent area contributor; confidence: medium; commits: 21d96098664d; files: extensions/discord/src/monitor/message-handler.process.ts, src/auto-reply/dispatch.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d7f57c02e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

dispatchAborted = true;
return;
}
await deliverPendingToolWarningFinalIfNeeded();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recheck freshness before replaying pending warnings

When an older Discord turn only has a metadata tool-warning final, deliverDiscordPayload stores it as pendingToolWarningFinal with visibleReplySent: false, and this replay happens only after dispatchChannelInboundReply has returned. The foreground reply fence in src/auto-reply/dispatch.ts performs its second freshness check inside beforeDeliver and is ended before that return, so a newer same-session/channel message that starts and delivers in the gap is no longer able to cancel this fallback; the stale warning can then be posted after the newer answer. Keep this fallback inside the dispatcher/fence path or repeat the same freshness check before sending it.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label May 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Changes Detected

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@socket-security

socket-security Bot commented May 28, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​openai@​6.39.074100100100100
Addednpm/​apache-arrow@​18.1.09810010087100

View full report

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 764dbf08d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +635 to +637
if (
!userFacingFinalDelivered &&
(!finalReplyStartNotified || userFacingFinalDeliveryFailed)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Queue warning fallback after typing start

When a Discord turn has already fired onReplyStart (normal model runs do this for typing/draft start) but the only final that reaches delivery is a metadata non-terminal tool warning, this condition leaves pendingToolWarningFinal unset because finalReplyStartNotified is already true. The new fallback is then dropped instead of being sent on onSettled; the added warning-only test does not catch this because its mock never invokes replyOptions.onReplyStart. Gate this on an actually delivered/recovered final (or failed delivery state) rather than the reply-start notification.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 28, 2026
@steipete steipete merged commit 89e0c80 into release/2026.5.27 May 28, 2026
26 checks passed
@steipete steipete deleted the backport/discord-drop-recovered-tool-warning-2026.5.27 branch May 28, 2026 00:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71af832aa5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +494 to +495
const settledResult = await params.dispatcherOptions.onSettled?.();
if (isExplicitlyVisibleDelivery(settledResult)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve visible partial errors from settled delivery

When onSettled performs the only visible send and then throws an error annotated as sentBeforeError/visibleReplySent (for example the WhatsApp media coalescer marks errors this way after flushing at least one deferred media reply), this inlined call no longer runs the isVisiblePartialDeliveryError catch path that the removed helper had. In a same-session/channel race, an older dispatch waiting in the foreground fence can miss that the newer turn already produced visible output and then continue with its stale fallback; wrap this onSettled call with the same visible-partial-error handling used for normal and fresh-settled deliveries.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord dependencies-changed PR changes dependency-related files 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant