Skip to content

fix(auto-reply): surface empty interactive completions - #99824

Closed
mushuiyu886 wants to merge 14 commits into
openclaw:mainfrom
mushuiyu886:feat/issue-99712
Closed

mushuiyu886 wants to merge 14 commits into
openclaw:mainfrom
mushuiyu886:feat/issue-99712

Conversation

@mushuiyu886

@mushuiyu886 mushuiyu886 commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #99712.

An interactive agent turn could complete successfully but leave no deliverable final reply after directive stripping, reasoning/commentary filtering, model-fallback exhaustion, queued follow-up routing, or block-stream dedupe. The user then saw a completed turn with no explanation.

Why This Change Was Made

This rewrite keeps the policy at the reply-delivery owner boundary instead of teaching the TUI or individual providers about empty results:

  • direct and queued follow-up paths share safe failure copy and conversation-silence policy;
  • terminal delivery evidence is distinct from reasoning, commentary, status notices, and empty voice markers;
  • explicit NO_REPLY, heartbeats, pending continuations, message-tool-only runs, room/internal events, and committed side effects remain silent;
  • fallback exhaustion without a preserved result still routes through the normal safe terminal-failure path;
  • model fallback preserves only the non-visible follow-up results needed by that owner path.

User Impact

Interactive users now receive a visible, sanitized failure when a completed turn produced no deliverable reply. Existing deliberate-silence and side-effect contracts are unchanged.

Evidence

@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 5, 2026, 3:57 PM ET / 19:57 UTC.

Summary
The PR adds a shared empty-interactive-reply fallback, wires it into direct reply and queued follow-up empty exits, centralizes delivery-evidence helpers, and adds focused regression coverage.

PR surface: Source +147, Tests +337, Docs +1. Total +485 across 8 files.

Reproducibility: yes. at source level: current main still has successful empty-payload exits in direct reply and queued follow-up paths, while the linked issue provides runtime evidence from OpenClaw 2026.6.9. I did not run the live Telegram failure path in this read-only review.

Review metrics: 1 noteworthy metric.

  • Release-owned changelog edit: 1 entry added. OpenClaw release generation owns CHANGELOG.md, so contributor PRs should carry release-note context in the PR body instead.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99712
Summary: This PR is a candidate fix for the canonical empty-interactive-reply message-loss issue; other open PRs overlap the same root cause, while the merged terminal-failure PR covers an adjacent but distinct empty-output failure mode.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • Resolve the conflict against current main while preserving the merged terminal-failure payload path.
  • Remove the direct CHANGELOG.md entry and keep release-note context in the PR body.
  • Rerun the focused reply/follow-up tests and current-head real behavior proof after the rebase.

Mantis proof suggestion
A fresh native Telegram proof after conflict resolution would materially verify the user-visible fallback on the current merged surface. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify an empty interactive turn returns the visible fallback reply after this PR is rebased on current main.

Risk before merge

  • [P1] The PR currently conflicts with current main, and the conflict is in the same reply/follow-up delivery code that now includes the merged terminal-failure payload path from fix: surface terminal agent run failures #99304.
  • [P2] Because this changes the final reply delivery decision, an overly broad guard could create false-positive error replies or suppress a fallback where a user still sees no reply.

Maintainer options:

  1. Rebase while preserving both delivery guards (recommended)
    Resolve the current-main conflict so fix: surface terminal agent run failures #99304 terminal-failure payload path and this PR's successful-empty fallback both survive, then rerun focused and real-behavior proof.
  2. Pause if another PR becomes canonical
    Keep this PR open only until maintainers choose whether this branch or another linked candidate owns the fix for the shared issue.

Next step before merge

  • [P2] Manual review is needed because the PR is conflicting in a message-delivery surface and maintainers need to pick or rebase the canonical linked fix.

Maintainer decision needed

  • Question: Should maintainers adopt this PR as the canonical fix for Interactive direct turns can complete with empty output and silently drop the reply #99712 and rebase it over the merged terminal-failure changes, or choose another linked candidate?
  • Rationale: The patch looks like the strongest current candidate, but the PR is conflicting in the same message-delivery surface and multiple linked PRs exist for the same bug.
  • Likely owner: steipete — He is assigned to this PR and authored the latest branch fixups in the conflicting reply/follow-up surface.
  • Options:

Security
Cleared: No dependency, workflow, lockfile, permissions, credential, or code-execution surface change was found in the diff.

Review findings

  • [P3] Drop the direct changelog entry — CHANGELOG.md:17
Review details

Best possible solution:

Land one canonical fix that covers both direct and queued empty interactive completions, preserves current main's terminal-failure payload path, removes the direct changelog edit, and reruns focused reply/follow-up tests plus real behavior proof.

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

Yes, at source level: current main still has successful empty-payload exits in direct reply and queued follow-up paths, while the linked issue provides runtime evidence from OpenClaw 2026.6.9. I did not run the live Telegram failure path in this read-only review.

Is this the best way to solve the issue?

Yes, the shared reply/follow-up boundary helper is the right layer because it has the final payload list plus silent-policy and committed-delivery evidence. It is not merge-ready until the current-main conflict is resolved and the release-owned changelog edit is removed.

Full review comments:

  • [P3] Drop the direct changelog entry — CHANGELOG.md:17
    CHANGELOG.md is release-owned in this repo, and CONTRIBUTING.md tells contributors not to edit it directly. The PR body already carries the release-note context, so this entry should be removed and left for release generation to avoid release-changelog drift and conflicts.
    Confidence: 0.91

Overall correctness: patch is correct
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The PR addresses an accepted interactive turn completing without any user-visible reply, which is an urgent message-delivery regression for real channel users.
  • merge-risk: 🚨 message-delivery: The diff changes final reply and queued follow-up delivery decisions, so mistakes can suppress, duplicate, or misroute user-visible fallback messages.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body includes a native Telegram screenshot showing the visible fallback reply, and a current-head Real behavior proof check succeeded for the latest head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes a native Telegram screenshot showing the visible fallback reply, and a current-head Real behavior proof check succeeded for the latest head.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes a native Telegram screenshot showing the visible fallback reply, and a current-head Real behavior proof check succeeded for the latest head.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The change creates a visible channel fallback that is easy to demonstrate in Telegram, even though the implementation is in shared reply code.
Evidence reviewed

PR surface:

Source +147, Tests +337, Docs +1. Total +485 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 257 110 +147
Tests 2 342 5 +337
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 600 115 +485

What I checked:

Likely related people:

  • steipete: Assigned on the PR, authored the latest branch fixups, and has substantial current-history work in auto-reply and follow-up delivery paths. (role: active reviewer and recent area contributor; confidence: high; commits: 3cc27b77fd58, 43e6c923ded1, 54648a9cf15d; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/followup-runner.ts)
  • moeedahmed: Authored the merged terminal-failure payload fix now overlapping this PR's conflict surface. (role: adjacent current-main fix author; confidence: medium; commits: 04857c78ee75; files: src/auto-reply/reply/agent-runner.ts)
  • codexGW: Authored a prior follow-up runner fix for empty/NO_REPLY queued runs leaving dispatch idle state stuck, adjacent to this queued empty-output path. (role: follow-up runner adjacent contributor; confidence: medium; commits: 6fb082e13160; files: src/auto-reply/reply/followup-runner.ts)
  • obviyus: Authored an earlier Telegram empty-response fallback fix that is historical context for visible channel fallback behavior. (role: earlier Telegram empty-reply contributor; confidence: medium; commits: 718bc3f9c818; files: src/auto-reply/reply/normalize-reply.ts, src/auto-reply/reply/reply-dispatcher.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.
Review history (6 earlier review cycles)
  • reviewed 2026-07-04T05:43:06.514Z sha 2c41dba736ccb5bbfca7d88f3dca789328cd0b9c :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T13:07:17.667Z sha 2c41dba736ccb5bbfca7d88f3dca789328cd0b9c :: needs real behavior proof before merge. :: [P1] Count accepted session spawns before failing direct replies | [P1] Preserve spawn-only follow-ups as successful side effects
  • reviewed 2026-07-04T15:16:04.324Z sha c9b508830ea288af998a0ee7e12c99e18826e63a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T15:22:30.705Z sha c9b508830ea288af998a0ee7e12c99e18826e63a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T15:27:58.580Z sha c9b508830ea288af998a0ee7e12c99e18826e63a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T17:40:13.354Z sha c9b508830ea288af998a0ee7e12c99e18826e63a :: needs maintainer review before merge. :: none

@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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 4, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs; this PR did not show the expected visible error reply after an empty Telegram turn.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-99824/run-28696489008-1/index.json

@mushuiyu886

Copy link
Copy Markdown
Contributor Author

Added the Real proof (2026-07-04) section to the PR body with the local Telegram proof and the focused verification results.

Summary for reviewers: the native Telegram proof shows a real direct empty-result turn delivering a visible fallback reply, while the exact new fallback helper text and intentional-silent guard cases are covered by the focused unit tests.

@openclaw-mantis please re-check the Telegram proof. @clawsweeper re-review

@mushuiyu886

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated this PR to commit c9b508830ea288af998a0ee7e12c99e18826e63a, rebased on current upstream main 11eeba9.

Fix/proof summary:

  • Direct empty interactive replies still surface a visible fallback error when there is no committed delivery evidence.
  • acceptedSessionSpawns now counts as successful side-effect evidence for direct replies, so spawn-only empty turns stay silent instead of creating a misleading fallback.
  • Follow-up empty interactive replies use the same acceptedSessionSpawns evidence, while the existing source-delivery/cron/approval/compaction side-effect guards remain covered.
  • Local focused proof: node scripts/run-vitest.mjs run src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts src/auto-reply/reply/followup-runner.test.ts => 2 files passed, 152 tests passed.
  • Local build proof: node scripts/build-all.mjs => passed on July 4, 2026.

Mantis/native Telegram proof can rerun against this head.

@clawsweeper

clawsweeper Bot commented Jul 4, 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. 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. labels Jul 4, 2026
@steipete steipete self-assigned this Jul 5, 2026
@steipete
steipete force-pushed the feat/issue-99712 branch from c9b5088 to 3cc27b7 Compare July 5, 2026 19:46
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L and removed size: M labels Jul 5, 2026
@steipete
steipete force-pushed the feat/issue-99712 branch from 3cc27b7 to 989fce1 Compare July 5, 2026 20:33
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer rewrite complete.

What changed:

  • shared safe empty-interactive failure copy for direct and queued follow-up delivery;
  • terminal delivery evidence now excludes reasoning, commentary, status notices, and empty voice markers;
  • explicit silence, heartbeats, pending continuations, message-tool-only runs, room/internal events, and committed effects remain unchanged;
  • fallback exhaustion without a preserved result now reaches the normal safe failure route.

Proof:

Codex dependency contract checked directly at be33f80bc65159c094ecd06bf155afa3061ce23d: codex-rs/app-server/src/bespoke_event_handling.rs:1348-1369 emits an empty item list for completed turns, while codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:231-263 defines the intentionally empty NotLoaded view.

Known proof gaps: none for the changed direct/queued/TUI surfaces.

@steipete
steipete force-pushed the feat/issue-99712 branch from fd55ae8 to a9d0643 Compare July 5, 2026 21:07
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Superseded by the clean maintainer replacement #100456.

The contributor head was concurrently rewritten several times during exact-head CI, so keeping both PRs open risks landing two different implementations. The replacement preserves @mushuiyu886's credit in the commit and will add changelog credit in its companion release-note PR. Focused, full changed-gate, real Gateway/TUI, and fresh autoreview proof are documented on #100456.

Thank you @mushuiyu886 for the original report and implementation base.

@steipete steipete closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

Interactive direct turns can complete with empty output and silently drop the reply

2 participants