Skip to content

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

Merged
steipete merged 2 commits into
mainfrom
codex/pr-99824-empty-replies
Jul 5, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/pr-99824-empty-replies

Conversation

@steipete

@steipete steipete commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Closes #99712.

Maintainer replacement for #99824. The commit preserves contributor credit; a companion changelog PR will land immediately after the runtime change to avoid unrelated mainline changelog drift.

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

@steipete

steipete commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 5:20 PM ET / 21:20 UTC.

Summary
The branch adds a shared empty-interactive fallback payload and wires direct replies, queued follow-ups, block-stream terminal evidence, and TUI coverage so successful non-deliverable completions surface a visible failure while deliberate-silence and side-effect cases stay silent.

PR surface: Source +247, Tests +502. Total +749 across 9 files.

Reproducibility: yes. at source level: current main still has direct and queued follow-up empty-payload exits that can return no outbound payload, and the PR adds regression tests for those paths. I did not run a live Telegram reproduction.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/tui/tui-pty-local.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99712
Summary: The linked issue is the canonical report for empty interactive completions; this PR is the active replacement candidate, and the earlier contributor PR is closed as superseded.

Members:

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

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

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

Risk before merge

  • [P2] This changes the final source-channel delivery/silence decision, so the residual merge risk is incorrectly surfacing a fallback in a deliberately silent path or suppressing a needed fallback despite the targeted direct, follow-up, block-stream, and TUI coverage.

Maintainer options:

  1. Land with the delivery-boundary coverage (recommended)
    Accept the residual message-delivery risk after maintainer review because the PR covers direct replies, queued follow-ups, block-stream evidence, and a real Gateway/TUI PTY path without adding config or API surface.
  2. Require one more live transport proof
    Ask for a short live Telegram or channel proof only if maintainers want channel-adapter confidence beyond the generic Gateway/TUI path.
  3. Pause if the silence policy is too broad
    Pause or close this branch if maintainers decide interactive empty completions should remain silent in more cases than the linked issue describes.

Next step before merge

  • No automated repair is needed; maintainers should review the active replacement PR, accept the message-delivery risk if appropriate, and merge once required checks are acceptable.

Maintainer decision needed

  • Question: Should this PR be accepted as the canonical message-delivery fix for empty interactive completions, replacing the closed contributor PR?
  • Rationale: The code review found no concrete defect, but the change deliberately adjusts when OpenClaw synthesizes source-channel failure copy versus preserving silence, which is a maintainer-owned delivery behavior choice.
  • Likely owner: steipete — He authored this replacement branch and recently merged adjacent reply-finalization work in the affected files.
  • Options:
    • Accept this PR as canonical (recommended): Land this branch after required checks are acceptable because it fixes both direct and queued follow-up paths with focused regression and TUI proof.
    • Ask for extra transport proof: Request an additional live Telegram or channel recording if maintainers want transport-specific confidence beyond the real Gateway/TUI PTY proof.
    • Pause for a narrower replacement: Close or pause this branch only if maintainers decide the fallback should be narrower than the linked issue currently requests.

Security
Cleared: Cleared: the diff changes TypeScript runtime and test logic only, with no dependency, lockfile, workflow, permission, secret-handling, or package-execution surface changes.

Review details

Best possible solution:

Keep this PR as the canonical fix for the linked issue, land it after maintainer review and required checks are acceptable, then close the linked issue and leave the superseded contributor PR closed.

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

Yes, at source level: current main still has direct and queued follow-up empty-payload exits that can return no outbound payload, and the PR adds regression tests for those paths. I did not run a live Telegram reproduction.

Is this the best way to solve the issue?

Yes, this is the best fix shape: the auto-reply/follow-up delivery boundary has the final payload list plus silence, continuation, and committed-delivery evidence, while provider or TUI-only fixes would duplicate policy in the wrong layer.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add merge-risk: 🚨 message-delivery: The diff changes the shared decision for when source-channel replies are synthesized, suppressed, or treated as already delivered.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: PR evidence and CI logs show an after-fix real Gateway plus TUI PTY path rendering the fallback and accepting the next turn; the current head only removes the direct changelog entry after that code proof.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Sufficient: PR evidence and CI logs show an after-fix real Gateway plus TUI PTY path rendering the fallback and accepting the next turn; the current head only removes the direct changelog entry after that code proof.

Label justifications:

  • P1: The PR targets an accepted interactive agent turn that can complete without any visible reply and leave later messages appearing stuck.
  • merge-risk: 🚨 message-delivery: The diff changes the shared decision for when source-channel replies are synthesized, suppressed, or treated as already delivered.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Sufficient: PR evidence and CI logs show an after-fix real Gateway plus TUI PTY path rendering the fallback and accepting the next turn; the current head only removes the direct changelog entry after that code proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: PR evidence and CI logs show an after-fix real Gateway plus TUI PTY path rendering the fallback and accepting the next turn; the current head only removes the direct changelog entry after that code proof.
Evidence reviewed

PR surface:

Source +247, Tests +502. Total +749 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 327 80 +247
Tests 4 513 11 +502
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 840 91 +749

What I checked:

  • Repository policy read: Root AGENTS.md plus scoped src/agents and src/tui guides were read; their Codex-contract, message-delivery, changelog, and real TUI/Gateway proof rules apply to this review. (AGENTS.md:1, aa665817490b)
  • Current-main source reproduction: Current main can still return no direct payload when payloads and fallback notices are empty, and the queued follow-up path returns immediately for empty payload arrays. (src/auto-reply/reply/agent-runner.ts:2101, aa665817490b)
  • Direct reply fix location: The PR computes terminal-delivery evidence separately from generic streamed/progress evidence and injects the empty-interactive fallback only when the normal final payload set has no terminal reply. (src/auto-reply/reply/agent-runner.ts:2017, 97332c6b5642)
  • Shared fallback helper: The shared helper suppresses the fallback for heartbeat, explicit silent policy, message-tool-only mode, pending continuations, explicit silent replies, and committed delivery before producing safe user-visible copy. (src/auto-reply/reply/agent-runner-execution.ts:1072, 97332c6b5642)
  • Queued follow-up fix location: Queued follow-up delivery now builds the same fallback after checking routable destinations, committed side effects, room events, internal provenance, message-tool-only mode, silent policy, pending continuations, and final deliverable payloads. (src/auto-reply/reply/followup-runner.ts:1515, 97332c6b5642)
  • Block-stream terminal evidence: The block reply pipeline now distinguishes any stream from terminal reply streams, so reasoning/commentary/status-like output does not suppress the fallback. (src/auto-reply/reply/block-reply-pipeline.ts:197, 97332c6b5642)

Likely related people:

  • steipete: Peter Steinberger recently merged adjacent terminal-failure reply work, touched the central auto-reply/follow-up files through current-main history, and authored this maintainer replacement branch. (role: recent area contributor and likely follow-up owner; confidence: high; commits: 3f380635f59b, f7c8830bc833, 97332c6b5642; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/followup-runner.ts, src/tui/tui-pty-local.e2e.test.ts)
  • moeedahmed: Moeed Ahmed authored the recent merged terminal agent run failure PR that introduced adjacent fallback behavior in the same reply finalization area. (role: adjacent terminal-failure contributor; confidence: medium; commits: 04857c78ee75, 2b0ff6afafa6; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/agent-runner-execution.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 (1 earlier review cycle)
  • reviewed 2026-07-05T21:04:35.750Z sha 0be75376a2b234a08d67308ed75a3999b2eb14ba :: needs real behavior proof before merge. :: [P3] Drop the direct changelog entry

@clawsweeper clawsweeper Bot added 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. 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 5, 2026
@steipete
steipete force-pushed the codex/pr-99824-empty-replies branch from 0be7537 to 6af6383 Compare July 5, 2026 21:06
@steipete
steipete force-pushed the codex/pr-99824-empty-replies branch from 6af6383 to 97332c6 Compare July 5, 2026 21:08
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete
steipete merged commit f0093b7 into main Jul 5, 2026
135 of 149 checks passed
@steipete
steipete deleted the codex/pr-99824-empty-replies branch July 5, 2026 21:22
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(auto-reply): surface empty interactive completions

Co-authored-by: mushuiyu886 <[email protected]>

* chore(changelog): defer empty-reply release note

---------

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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

1 participant