Skip to content

Show assistant commentary in Discord progress drafts#85164

Closed
bryanpearson wants to merge 1 commit into
openclaw:mainfrom
bryanpearson:fix/discord-commentary-progress
Closed

Show assistant commentary in Discord progress drafts#85164
bryanpearson wants to merge 1 commit into
openclaw:mainfrom
bryanpearson:fix/discord-commentary-progress

Conversation

@bryanpearson

@bryanpearson bryanpearson commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #83307.

Adds an opt-in Discord progress-streaming path for assistant commentary/preamble text. When channels.discord.streaming.mode is "progress" and channels.discord.streaming.progress.commentary is true, Discord renders Codex preamble/commentary item events in the temporary progress draft while keeping final answer delivery unchanged.

Behavior

  • Adds streaming.progress.commentary to the shared channel streaming config schema, defaulting off.
  • Consumes existing kind: "preamble" item events in the Discord progress draft path.
  • Keeps commentary independent from toolProgress, so tool rows can stay hidden while commentary remains visible.
  • Renders commentary as italic transient prose without the normal progress bullet prefix.
  • Uses stable item ids so repeated preamble updates replace the prior line instead of duplicating it.
  • Cleans commentary before rendering by stripping inline delivery directives and suppressing silent-only NO_REPLY commentary.
  • Stops commentary progress updates after final delivery has started, matching the existing tool-progress guard.
  • Does not route commentary into normal partial/final replies.

Docs

  • Documents streaming.progress.commentary in docs/channels/discord.md.

Real behavior proof

  • Behavior or issue addressed: Discord progress mode can now show assistant commentary/preamble text as transient progress draft text while keeping tool rows hidden when toolProgress: false; final answer delivery remains the normal durable Discord reply.
  • Real environment tested: Local OpenClaw gateway on macOS with the real Discord plugin connected as the Scout bot to a private Discord server/channel. The local runtime was configured with channels.discord.streaming.mode: "progress", progress.commentary: true, progress.toolProgress: false, and progress.label: false.
  • Exact steps or command run after this patch: Applied the patch to the live local OpenClaw install, restarted the gateway, sent a prompt from Discord, watched the temporary Discord progress draft update during the turn, then let the final answer complete. Also checked the active runtime config and installed formatter path from the same local setup.
  • Evidence after fix: Copied live output and terminal capture from the local setup:
$ node -e 'const fs=require("fs"); const c=JSON.parse(fs.readFileSync("/Users/bryanpearson/.openclaw/openclaw.json","utf8")); console.log(JSON.stringify(c.channels.discord.streaming,null,2));'
{
  "mode": "progress",
  "preview": {
    "toolProgress": false,
    "commandText": "status"
  },
  "progress": {
    "toolProgress": false,
    "commandText": "status",
    "label": false,
    "maxLines": 12,
    "commentary": true
  },
  "block": {
    "enabled": false
  }
}

Live Discord observation after gateway restart:
- transient draft showed italic commentary text only, with no leading bullet and no tool rows while toolProgress=false
- final answer was delivered as the normal Discord reply and the temporary progress draft was no longer the durable answer
- repeated commentary did not duplicate after the stable commentary item id change
  • Observed result after fix: Discord displayed transient italic commentary progress during the run, tool rows stayed hidden with toolProgress: false, NO_REPLY/inline directive text did not appear in commentary tests, late commentary after final delivery start did not edit the progress draft, and the final answer was delivered normally.
  • What was not tested: No maintainer-owned Discord environment or automated Discord screenshot artifact was run here; the live check was a contributor local smoke test, supplemented by focused unit/config validation below.

Validation

  • pnpm vitest run --config test/vitest/vitest.plugin-sdk.config.ts src/plugin-sdk/channel-streaming.test.ts
  • pnpm vitest run --config test/vitest/vitest.extension-discord.config.ts extensions/discord/src/monitor/message-handler.process.test.ts
  • pnpm config:schema:check
  • pnpm config:channels:check
  • pnpm check:changed

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR adds an opt-in Discord progress commentary setting, renders Codex preamble item events into transient progress drafts, updates shared streaming config/schema support, docs, UI hints, and focused tests.

Reproducibility: not applicable. as a feature/config PR. Source inspection shows current main already emits preamble item events, and the branch wires those events into Discord progress drafts behind the new opt-in setting.

PR rating
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Summary: Good normal mergeable-quality signal: the implementation is focused and covered by tests/docs, with contributor live proof supplied and the remaining blocker being maintainer product approval.

Rank-up moves:

  • none
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.

Real behavior proof
Sufficient (live_output): The PR body includes after-fix proof from a real local gateway connected to Discord, with config output and observed transient commentary plus unchanged final delivery.

Mantis proof suggestion
A real Discord progress draft is visible transport behavior, and a short capture would materially improve maintainer confidence even though contributor proof is supplied. 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 Discord progress mode with commentary=true shows temporary commentary, hides tool rows when toolProgress=false, and final answer stays unchanged.

Risk before merge

  • This intentionally exposes assistant commentary in a user-visible Discord progress draft when explicitly enabled, so maintainers need to approve the opt-in UX and message-delivery boundary.
  • The supplied real behavior proof is a contributor local Discord smoke rather than maintainer-owned visual proof; it satisfies the contributor proof gate, but a redacted Discord capture would reduce transport confidence before merge.

Maintainer options:

  1. Approve The Opt-In Commentary Draft UX
    Maintainers can accept that commentary becomes visible only for explicit progress.commentary: true configs once CI and normal review are satisfactory.
  2. Request Maintainer-Owned Visual Proof
    A maintainer can ask for a short redacted Discord capture showing transient commentary, hidden tool rows with toolProgress: false, and unchanged final delivery.
  3. Pause For Product Direction
    If surfacing assistant commentary in Discord progress drafts is not an approved channel UX, pause this PR and settle the linked feature request first.

Next step before merge
Maintainer review should decide the new opt-in Discord commentary UX and whether contributor local Discord proof is enough; no narrow automation repair remains.

Security
Cleared: No supply-chain, permissions, secrets, auth, dependency, sandbox, or code-execution expansion was found in the diff.

Review details

Best possible solution:

Land the narrow opt-in Discord progress-commentary path after maintainer approval and normal checks, keeping default behavior off and final replies unchanged.

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

Not applicable as a feature/config PR. Source inspection shows current main already emits preamble item events, and the branch wires those events into Discord progress drafts behind the new opt-in setting.

Is this the best way to solve the issue?

Yes, pending maintainer product approval. The patch uses the existing preamble item event contract, defaults the new behavior off, keeps final replies unchanged, and covers the key delivery guards with focused tests.

Label justifications:

  • P2: This is a normal-priority Discord feature/config improvement with limited blast radius because it defaults off and is scoped to progress mode.
  • merge-risk: 🚨 message-delivery: Merging changes what Discord can show during an in-flight turn, so maintainers should explicitly approve the opt-in delivery boundary.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🐚 platinum hermit, and Good normal mergeable-quality signal: the implementation is focused and covered by tests/docs, with contributor live proof supplied and the remaining blocker being maintainer product approval.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix proof from a real local gateway connected to Discord, with config output and observed transient commentary plus unchanged final delivery.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix proof from a real local gateway connected to Discord, with config output and observed transient commentary plus unchanged final delivery.

What I checked:

Likely related people:

  • steipete: Authored multiple recent Discord progress draft and shared progress formatter commits, including reasoning text in progress drafts and progress draft rendering/truncation work. (role: recent area contributor; confidence: high; commits: d94e7f5114dc, ef29c85a48c9, accf774591cf; files: extensions/discord/src/monitor/message-handler.draft-preview.ts, extensions/discord/src/monitor/message-handler.process.ts, src/plugin-sdk/channel-streaming.ts)
  • Patrick-Erichsen: Added Telegram progress preview flow tooling that touched the shared channel progress draft surface used by this PR. (role: adjacent progress-preview contributor; confidence: medium; commits: d60ab485114a; files: src/plugin-sdk/channel-streaming.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • compoodment: Recently fixed Discord progress mode final reply delivery, which is adjacent to the final-delivery boundary this PR preserves. (role: recent Discord progress contributor; confidence: medium; commits: a9407d2f65ce; files: extensions/discord/src/monitor/message-handler.process.ts, extensions/discord/src/monitor/message-handler.process.test.ts)

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

@bryanpearson bryanpearson force-pushed the fix/discord-commentary-progress branch from 7a412ee to 631cfd8 Compare May 22, 2026 01:48
@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 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Frosted Review Wisp

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: collects tiny proofs.
Image traits: location artifact grotto; accessory shell-shaped keyboard; palette sunrise gold and clean white; mood watchful; pose nestled inside a glowing shell; shell soft velvet shell; lighting moonlit rim light; background miniature CI buoys.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Frosted Review Wisp in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@bryanpearson bryanpearson force-pushed the fix/discord-commentary-progress branch from 631cfd8 to b2abdbd Compare May 22, 2026 02:23
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M proof: supplied External PR includes structured after-fix real behavior proof. and removed size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 22, 2026
@bryanpearson

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the review feedback on the current head:

  • Added directive stripping and silent-only NO_REPLY suppression before commentary draft rendering.
  • Added the final-delivery guard to commentary progress updates.
  • Added focused Discord process tests for cleaned commentary, toolProgress independence, and late commentary after final delivery starts.
  • Documented streaming.progress.commentary in docs/channels/discord.md.
  • Updated the PR body with the required Real behavior proof fields and local live Discord smoke evidence.

Local validation remains:
pnpm vitest run --config test/vitest/vitest.plugin-sdk.config.ts src/plugin-sdk/channel-streaming.test.ts
pnpm vitest run --config test/vitest/vitest.extension-discord.config.ts extensions/discord/src/monitor/message-handler.process.test.ts
pnpm config:schema:check && pnpm config:channels:check
pnpm check:changed

@bryanpearson bryanpearson force-pushed the fix/discord-commentary-progress branch from b2abdbd to 95c6b01 Compare May 22, 2026 02:29
@bryanpearson

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fresh head after no-op amend is 95c6b01edba4d29c049dfbd5f89c8ca8e994cbf1. The Real behavior proof check is now passing on this head; please re-review the current patch state.

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 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. labels May 22, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper ask demo feature using ascii

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: demo feature using ascii

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: ASCII demo of the feature behavior:

Discord user:
> run a long task

Temporary progress draft, while running:
_Checking the current weather source before summarizing clearly._
_Checking route impacts._

Final durable reply:
Here is the final answer...

With this PR’s config, commentary can show in the temporary Discord draft while tool rows stay hidden:

{
  "streaming": {
    "mode": "progress",
    "progress": {
      "commentary": true,
      "toolProgress": false,
      "label": false
    }
  }
}

Evidence:

  • PR: Show assistant commentary in Discord progress drafts #85164
  • Head SHA: 95c6b01edba4d29c049dfbd5f89c8ca8e994cbf1
  • The PR says commentary is opt-in via streaming.progress.commentary, defaults off, stays transient, and final answer delivery is unchanged.
  • Contributor local proof says the Discord draft showed italic commentary only, with no tool rows when toolProgress=false, and final answer delivery remained normal.

Suggested next action: For a real visual proof demo, ask for a short redacted Discord capture showing the temporary commentary draft and the normal final reply.


Source: #85164 (comment)
Assist model: gpt-5.5, reasoning low.

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper automerge is enabled.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-05-22 03:13:04 UTC review queued 95c6b01edba4 (queued)

@clawsweeper clawsweeper Bot added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label May 22, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: Maintainer review should decide the new opt-in Discord commentary UX and whether contributor local Discord proof is enough; no narrow automation repair remains.; Cleared: No supply-chain, permissions, secrets, auth, dependency, sandbox, or code-execution expansion was found in the diff. (sha=95c6b01edba4d29c049dfbd5f89c8ca8e994cbf1)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the contribution here. ClawSweeper could not safely push to this branch, so it opened a replacement PR from a writable branch and carried the contributor trail along with it.

Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
Replacement PR: #85200
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
This closeout is intentional for this run: the replacement PR is now the active review lane.
Attribution stays attached; the replacement just gives the fix a writable branch.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against d30206a.

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

Labels

channel: discord Channel integration: discord clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper:human-review Needs maintainer review before ClawSweeper can continue docs Improvements or additions to documentation merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

Discord progress drafts should support assistant commentary events

2 participants