Skip to content

fix(discord): keep tool rows in the progress draft under verbose - #111947

Merged
steipete merged 1 commit into
openclaw:mainfrom
zeroaltitude:fix/discord-progress-verbose-tool-rows
Jul 29, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
zeroaltitude:fix/discord-progress-verbose-tool-rows

Conversation

@zeroaltitude

@zeroaltitude zeroaltitude commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With channels.discord.streaming.mode: progress and session verbose on (agents.defaults.verboseDefault: on), tool progress rendered nowhere on Discord. Users saw thinking messages and the final reply, but zero tool rows in the progress draft — and progress.toolProgress: true changed nothing.

Root cause — mutual deferral between two lanes

The durable verbose lane (added in a397fcabd9e) exposes onVerboseProgressVisibility, a live getter so a draft-rendering channel can yield its ephemeral lines while the durable standalone lane delivers the same content — avoiding double render. Crucially, that durable lane carries only commentary (preamble items) and tool-result summaries — it never emits tool-start rows (shouldSendToolStartStatuses is hard-false), and onCommandOutput/onPatchSummary have no standalone core delivery at all (their only standalone path, maybeSendWorkingStatus, is gated off).

The Discord progress runtime (extensions/discord/src/monitor/message-handler.process-progress.ts) wired that commentary-visibility getter into the tool lane as well:

  • onToolStart
  • non-preamble onItemEvent
  • onCommandOutput
  • onPatchSummary

So when verbose was on, the getter returned true and the draft early-returned on every tool line — deferring to a durable lane that never renders those rows. Meanwhile the standalone verbose messages that do exist (tool-result summaries, commentary) are a different content stream. Net: tool activity appeared in neither lane.

resolveChannelStreamingSuppressDefaultToolProgressMessages returning true in progress mode (src/channels/streaming.ts) is correct and unchanged — that flag only governs quiet channel-owned callback forwarding, not the standalone lane, and is not the defect.

Fix

Scope the yield to the lines that genuinely have a durable-lane counterpart — commentary/preamble (and narration) — and let tool lines always stay in the draft. Implemented as option (a) from the issue: the visibility getter is renamed shouldYieldDraftCommentary and removed from the four tool-lane callbacks.

Guarantees:

  • (i) progress + verbose on → tool rows render in the draft exactly once (tool-start/item/command/patch draft lines have no standalone equivalent, so no double render).
  • (ii) verbose off → draft still renders tool rows (getter is false; unchanged).
  • (iii) streaming.mode: off → standalone verbose tool-result messages still fire (untouched; the draft is inactive there anyway).
  • (iv) thinking and final replies unaffected.

Change Type

Bug fix (channel: Discord).

Regression Test Plan

extensions/discord/src/monitor/message-handler.process.draft-progress.test.ts:

  • Updated the tool-line test to assert the draft keeps tool rows whether or not the durable lane is active (previously asserted an empty draft).
  • Added a mutual-deferral regression test: progress mode + verbose visibility active → tool rows appear in the draft and commentary is yielded to the durable lane (not double-rendered).
  • Commentary-yield test (unchanged) still pins that preamble commentary yields to the durable lane.

Validation

Run from the topic worktree with the pinned [email protected]:

  • vitest message-handler.process.draft-progress.test.ts — 19 passed
  • vitest test/scripts/check-changelog-attributions.test.ts — 10 passed
  • pnpm tsgo:extensions — clean; pnpm tsgo:extensions:test — clean
  • pnpm oxlint <touched files> — clean; git diff --check — clean

The maintainer improvement also touches the shared durable-commentary buffer; current focused and hosted core proof is recorded in Evidence below.

Linked Issue

Tracked internally as Beads openclaw-7cd.

🤖 Generated with Claude Code

What Problem This Solves

With Discord progress streaming and verbose delivery enabled, the channel yielded tool lifecycle rows to a durable lane that does not own those rows. Users therefore saw commentary and the final answer but no live tool activity. During maintainer live proof, the same commentary text also arrived under changing producer IDs and was sent twice; the improved patch deduplicates that shared durable lane at its owner boundary.

Evidence

  • Exact head: b4f347e41aa97c3016c5c412f865754e0035a296.
  • Focused regressions: 302 core dispatch tests and 19 Discord progress tests passed.
  • Hosted validation: pnpm check:changed passed the selected core, core-test, extension, and extension-test lanes on Blacksmith Testbox.
  • Real Discord round-trip: progress mode plus verbose delivery produced exactly one durable commentary message and one editable progress draft with the exec row; the draft collapsed on completion and the final marker arrived unchanged. Redacted REST readback confirmed commentaryCount=1 and finalCount=1.
  • Fresh Codex autoreview reported no findings and judged the product patch correct (0.84 confidence).

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 20, 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. P2 Normal backlog priority with limited blast radius. labels Jul 21, 2026
@clawsweeper

clawsweeper Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 12:32 AM ET / 04:32 UTC.

ClawSweeper review

What this changes

The branch changes Discord progress streaming so tool lines remain in the live progress draft during verbose sessions, while commentary and narration can still yield to the durable verbose-message lane.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open. The targeted Discord fix appears to preserve tool-progress rows while the verbose lane owns commentary, but the branch still includes the previously flagged release-owned changelog edit and has no after-fix real Discord behavior proof; GitHub also reports the draft branch as dirty, so it needs a rebase and refresh before merge.

Priority: P2
Reviewed head: ac07ed96624e5c2274ebcb4c0c4cb3b56695c762

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is narrowly scoped with focused regression coverage, but no real Discord behavior proof is available and the release-owned changelog edit remains.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR provides test and static-check claims only; before merge, add redacted after-fix evidence from a real Discord run showing progress mode plus verbose delivery, such as a transcript, recording, terminal/live output, or runtime logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides test and static-check claims only; before merge, add redacted after-fix evidence from a real Discord run showing progress mode plus verbose delivery, such as a transcript, recording, terminal/live output, or runtime logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Targeted runtime change: The PR renames the verbose-visibility getter to commentary-specific wording and removes its early-return behavior from tool-event rendering, while retaining it for narration.
Regression coverage: The branch updates the draft-progress test to require tool rows whether the durable verbose lane is active, and adds a scenario where commentary yields while tool rows remain in the draft.
Prior finding remains unresolved: The current PR diff still adds a CHANGELOG.md entry even though the prior ClawSweeper review identified that release-owned edit as needing removal; repository policy reserves CHANGELOG.md for release work.
Findings 1 actionable finding [P3] Remove the release-owned changelog entry
Security None None.

How this fits together

Discord receives agent progress callbacks and turns them into a live editable progress draft. A separate durable verbose lane can send commentary and summaries, so the channel must decide which events belong only in the draft versus which have a standalone counterpart.

flowchart LR
  A[Agent progress callbacks] --> B[Discord progress runtime]
  B --> C{Commentary or tool line?}
  C -->|Commentary or narration| D[Durable verbose lane]
  C -->|Tool start item command patch| E[Live Discord progress draft]
  D --> F[Discord channel messages]
  E --> F
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides test and static-check claims only; before merge, add redacted after-fix evidence from a real Discord run showing progress mode plus verbose delivery, such as a transcript, recording, terminal/live output, or runtime logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Remove the release-owned changelog entry (P3) - CHANGELOG.md is release-owned in this repository, and the prior review already requested removal. Keep the user-visible context in the PR body or commit message; leaving this entry makes the normal bug-fix branch conflict with release ownership.
  • Resolve merge risk (P1) - The current branch is a draft and GitHub reports a dirty merge state; it needs a rebase onto current main so the actual three-way merge result can be reviewed.
  • Resolve merge risk (P1) - The contributor has not supplied real after-fix Discord evidence, so the tested unit scenario does not yet prove that a live progress draft and durable verbose messages render the intended split without duplication.
  • Complete next step (P2) - A narrow mechanical repair can remove the release-owned changelog edit, but the contributor must still provide real behavior proof and rebase the dirty draft before merge.

Findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:55
Agent review details

Security

None.

PR surface

Source +6, Tests +43, Docs +1. Total +50 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 18 12 +6
Tests 1 51 8 +43
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 70 20 +50

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the narrow event-ownership split, remove the release-owned changelog entry, rebase onto current main, and attach a redacted live Discord proof showing tool rows in progress mode with verbose delivery enabled.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the narrow event-ownership split, remove the release-owned changelog entry, rebase onto current main, and attach a redacted live Discord proof showing tool rows in progress mode with verbose delivery enabled.

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

No high-confidence live reproduction proof is present. The source-level callback split and focused regression tests make the reported path reproducible from code, but no real Discord run has been shown after the fix.

Is this the best way to solve the issue?

Unclear. The proposed separation is a narrow, plausible fix because commentary and tool events have different durable-lane counterparts, but the branch must first remove the release-owned changelog edit and demonstrate the live channel behavior after rebasing.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:55
    CHANGELOG.md is release-owned in this repository, and the prior review already requested removal. Keep the user-visible context in the PR body or commit message; leaving this entry makes the normal bug-fix branch conflict with release ownership.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.72

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

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

Label justifications:

  • P2: This is a bounded Discord rendering regression: users can complete turns, but tool activity is missing from a visible progress surface in the affected mode.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides test and static-check claims only; before merge, add redacted after-fix evidence from a real Discord run showing progress mode plus verbose delivery, such as a transcript, recording, terminal/live output, or runtime logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] git diff --check.

What I checked:

Likely related people:

  • unidentified: The supplied PR context identifies the Discord progress and verbose-lane files but does not provide usable current-main blame or feature-history authorship; ownership needs a fresh history pass after the branch is rebased. (role: historical area owner not established; confidence: low; files: extensions/discord/src/monitor/message-handler.process-progress.ts, extensions/discord/src/monitor/message-handler.process.draft-progress.test.ts)

Rank-up moves

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

  • Remove the CHANGELOG.md entry and rebase the draft onto current main.
  • Add redacted live Discord evidence showing tool rows in the progress draft while verbose commentary is delivered separately.
  • Update the PR body after adding proof; if no automatic refresh occurs, ask a maintainer to comment @clawsweeper re-review.

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 (1 earlier review cycle)
  • reviewed 2026-07-20T20:03:58.503Z sha c6eee5f :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog edit

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 27, 2026
@steipete steipete self-assigned this Jul 29, 2026
@steipete
steipete force-pushed the fix/discord-progress-verbose-tool-rows branch from ac07ed9 to 8282431 Compare July 29, 2026 06:16
@steipete

Copy link
Copy Markdown
Contributor

Maintainer proof for exact head 82824317717e1a0a7cb8ede73e8281dce76d47c7 is green.

  • Focused regressions: 302 core dispatch tests and 19 Discord progress tests passed.
  • Hosted gate: pnpm check:changed passed all selected core, core-test, extension, and extension-test lanes on Blacksmith Testbox (run).
  • Real Discord round-trip: with progress mode, commentary, tool rows, and verbose delivery enabled, the live tool window showed exactly one durable commentary message and one editable progress draft containing the exec row. After completion, the draft collapsed and the final marker arrived unchanged. Redacted REST readback confirmed commentaryCount=1 and finalCount=1.
  • The live harness omitted the privileged Message Content intent because the proof bot does not have that Discord application privilege; the tested turn used a normal Discord DM, so the production progress/delivery code remained exact-head. This adaptation was Testbox-only and is not part of the PR diff.
  • Fresh Codex autoreview reported no findings and judged the patch correct (0.84 confidence).

The live run initially exposed duplicate commentary when the same text arrived under changing producer IDs. The updated head moves that dedupe into the shared durable-commentary buffer and adds a focused regression, while retaining the contributor's clean Discord tool-lane ownership fix.

@steipete
steipete marked this pull request as ready for review July 29, 2026 06:20
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 29, 2026
@steipete
steipete force-pushed the fix/discord-progress-verbose-tool-rows branch from 8282431 to 38a0b90 Compare July 29, 2026 06:43
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 29, 2026
@steipete
steipete force-pushed the fix/discord-progress-verbose-tool-rows branch from 8a0478e to eeb38dd Compare July 29, 2026 06:57
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Jul 29, 2026
@steipete
steipete force-pushed the fix/discord-progress-verbose-tool-rows branch from eeb38dd to c6b0a39 Compare July 29, 2026 07:39
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Jul 29, 2026
@steipete
steipete force-pushed the fix/discord-progress-verbose-tool-rows branch from a7c49aa to b4f347e Compare July 29, 2026 07:57
@steipete
steipete merged commit 6c000dc into openclaw:main Jul 29, 2026
125 of 128 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main:
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
  fix(msteams): finalize sent replies after dispatch (#82354)
  fix(cron): deliver explicitly configured failure alerts (#115762)
  fix(hooks): resolve inbound claim conversation once (#115491)
  refactor: retire legacy provider and secret paths (#115655)
  fix(memory): reject malformed QMD result entries (#115705)
  fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261)
  fix(ui): localize remaining control surfaces (#115730)
  fix(gateway): prevent model owner mismatch after plugin activation (#115747)
  fix(agents): run reply hooks for restart recovery (#115711)
  fix(cron): initialize detached hook run sessions (#115765)
  fix(ios): keep stop available for staged voice notes (#115744)
  fix(doctor): preserve config includes during cleanup (#115723)
  fix(memory): keep dreaming consolidation within project scope (#115721)
  fix(discord): keep tool rows under verbose progress (#111947)

# Conflicts:
#	ui/src/pages/custodian/custodian-surface.ts
#	ui/src/styles/custodian.css
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
@zeroaltitude
zeroaltitude deleted the fix/discord-progress-verbose-tool-rows branch July 30, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

2 participants