Skip to content

fix(auto-reply): keep verbose commentary ahead of answers - #168345

Merged
obviyus merged 1 commit into
mainfrom
fix/verbose-commentary-dup
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/verbose-commentary-dup

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes repeated commentary and tool-progress messages arriving after the answer when verbose logging is enabled with streaming previews.

User Impact

Each preamble is delivered once, and pending verbose progress lands before the answer preview. Verbose-off delivery and channel-owned progress drafts keep their existing behavior. No configuration or SDK changes.

Why This Change Was Made

A completed item snapshot could re-enter the commentary buffer after its earlier snapshot had already been flushed. Meanwhile, answer previews bypass the dispatcher queue, allowing queued commentary and tool summaries to appear afterward. Remember flushed item identities for the turn and settle earlier verbose progress before forwarding the preview.

The fix is in shared reply dispatch, not the Telegram adapter. The regression covers Telegram, Discord, and Slack. Checked #116548: its explicit NO_REPLY handling is unchanged. Quiet channel-owned progress does not enter the new barrier.

Evidence

Telegram Test Server timelines, using the same four-tool scenario:

Build Observed messages
Baseline 2790eea27fb Duplicate commentary at message IDs 75854/75855; final 75858 at 35.371s, then Apply Patch 75859 and commentary 75860 at 41.599s.
Candidate repeat 1 Five preambles, each once; final 76315 at 31.761s; no subsequent messages during the settled recording.
Candidate repeat 2 Five preambles, each once; final 76330 at 34.052s; no subsequent messages during the settled recording.
Verbose off No standalone commentary; final 76335; no subsequent messages.
Progress mode, verbose on Temporary authored preamble retained, diagnostics separate; final 76344; no subsequent messages.

The baseline source matches its built artifacts. There are no commits touching src/auto-reply/reply/dispatch-from-config* between that baseline and the candidate's main base; #168225 only changed the Telegram progress adapter and is included in the candidate.

  • Focused regression: three verbose-on channel cases fail before the fix due to duplicate commentary; all four cases pass afterward, including verbose-off and late-progress suppression. node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.commentary.test.ts: 49.66s including compilation, 1.1s test execution, in isolated Linux Docker.
  • Exact-head Docker runtime build and targeted formatting checks passed.
  • Real gpt-5-mini Telegram turn: authored preamble 76348, Exec 76349, final VERBOSE_REAL_OK 76350; two successful provider requests, no late messages.

Two-way door: reverting restores the prior delivery behavior without state or configuration migration. Blast radius is standalone verbose commentary and answer-preview ordering in shared channel reply dispatch.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 10, 2026
@obviyus
obviyus marked this pull request as ready for review October 10, 2026 08:32
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR deduplicates flushed verbose preambles and delivers pending progress before answer previews.

Example: With verbose enabled, preamble item inspect emits an update, a tool starts, and the completed snapshot repeats inspect.

  • Before: The preamble can appear twice, and queued progress can arrive after the answer preview.
  • After: The preamble appears once, and earlier verbose progress settles before the preview.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-consistent repair supported by boundary regression coverage and detailed reported runtime observations.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The body records changed shared-dispatch behavior through Telegram Test Server: duplicate and late baseline messages, two successful candidate repetitions, verbose-off and draft-owner controls, and a real-provider final. These are reported runtime timelines; the unrelated downloaded screenshot was excluded.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Verbose users can receive repeated preambles and tool progress after the answer has appeared.
Reason: The change restores the documented one-message-per-block and answer-last behavior without expanding product surface.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused fix restores the existing commentary ordering contract, remains necessary on current main, and introduces no definite correctness defect.

Priority: P2
Reviewed head: b7e6fbbbf917b385e5c84cac4a68c195844c7012

Before merge

None.

Findings

None.

Agent review details

How this fits together

Shared reply dispatch receives model item events, tool results, and partial answers, then coordinates standalone progress messages and channel-owned answer previews.

flowchart TD
  A[Model events] --> B[Shared reply dispatch]
  B --> C[Commentary buffer]
  B --> D[Tool progress]
  C --> E[Reply dispatcher]
  D --> E
  E --> F[Channel delivery]
  B --> G[Answer preview barrier]
  E --> G
  G --> F
Loading

Technical review

Best possible solution:

Retain the shared-dispatch repair while preserving existing verbose visibility and channel-owned commentary behavior.

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

Current-main source permits a flushed item to re-enter the buffer and forwards previews independently of queued progress; the body also supplies targeted Test Server observations, but no target code was executed during this review.

Is this the best way to solve the issue?

The repair belongs in shared dispatch, reuses its delivery queue, and preserves the existing channel commentary owner rather than adding transport-specific ordering logic.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b04bf1bb6966.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +24, Tests +95, Docs +4. Total +123 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 25 1 +24
Tests 1 95 0 +95
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 124 1 +123

Labels

Label changes:

  • add P2: Repeated and delayed progress messages impair verbose streaming conversations without demonstrating lost final answers or a broader outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • add proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Telegram Test Server can observe the changed standalone preamble count and progress-before-answer ordering; the body reports those scenarios.

Label justifications:

  • P2: Repeated and delayed progress messages impair verbose streaming conversations without demonstrating lost final answers or a broader outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Telegram Test Server can observe the changed standalone preamble count and progress-before-answer ordering; the body reports those scenarios.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 10, 2026, 4:37 AM ET / 08:37 UTC.

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

CI on b7e6fbbbf917b385e5c84cac4a68c195844c7012 is paused after an unrelated failure; no hosted jobs were rerun and the head was not re-pushed.

  • checks-ui-e2e (1/2): the two session-dashboard.e2e.test.ts cases “shows a bounded visible outcome when a Canvas dashboard pin fails” and “pins an inline MCP App using only its session-bound view identity” time out clicking Pin to dashboard because .chat-gutter-stack--details intercepts pointer events.
  • Both exact cases and the same interception already fail on independent PR #168312, verified from its log. This diff changes shared reply dispatch and a streaming doc, not the mocked Control UI dashboard layout or its click handling.
  • openclaw/ci-gate fails from that originating job and fail-fast cancellations. 14 jobs were cancelled.
  • Related coverage was replayed in isolated Linux Docker: production core types, changed-path core test types for the two dispatch owners and new regression, and both dispatch test files all passed (142 tests total). Core lint, docs, architecture guards, package boundaries and completed changed-test lanes also passed in hosted CI.

ClawSweeper reviewed this exact head: no findings; ready for maintainer review. Runtime proof and before/after timelines remain in the PR body.

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: after replaying the failed and cancelled jobs, every selected job is green except checks-ui-e2e (1/2), where the same two session-dashboard pin cases fail because chat-gutter-stack intercepts the Pin to dashboard click (https://github.com/openclaw/openclaw/actions/runs/38038236202/job/114177848683). The identical failure appears on unrelated PRs #59414 (doctor-only: https://github.com/openclaw/openclaw/actions/runs/38034336859/job/114161791045) and #168312, which landed with the same override. This PR doesn't touch ui/; ClawSweeper is ready on this exact head.

@obviyus
obviyus merged commit 96a361a into main Oct 10, 2026
236 of 255 checks passed
@obviyus
obviyus deleted the fix/verbose-commentary-dup branch October 10, 2026 09:16
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 96a361a. Verbose commentary now arrives once and before the answer; Test Server before/after evidence is in the PR body.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…68345)

With /verbose on and partial streaming, durable commentary was re-buffered after a tool-boundary flush and sent twice, and queued tool summaries and commentary drained after the final answer. Flushed commentary items are now remembered so later snapshots of the same item are not resent, text-only progress is dropped once final delivery starts, and the answer preview waits for earlier progress to settle. Shared dispatch, so Telegram, Discord and Slack all benefit. Found by our Telegram Test Server bug hunt.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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