Skip to content

fix(telegram): recover directed turns after empty model replies - #118305

Merged
steipete merged 3 commits into
mainfrom
codex/fix-telegram-empty-reply
Aug 3, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-telegram-empty-reply

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #116277

What Problem This Solves

Fixes an issue where users sending directed Telegram group messages could receive no response when a model completed with no visible content, while the Telegram last-mile recovery also discarded its own fallback as intentional silence.

Why This Change Was Made

Visible turns now treat bare empty and reasoning-only model completions as incomplete and use the existing bounded continuation path; only explicit NO_REPLY or genuinely reply-optional jobs remain silent. Telegram also consumes the shared settled noVisibleReplyFallbackEligible fact instead of re-inferring failure from zero payloads, preserving ambient group silence, room events, send-policy denial, message-tool delivery, and observed delivery.

The issue's original DeepSeek attribution was retracted by the reporter after the affected interactive session was identified as Kimi. No provider-specific workaround is included.

User Impact

Directed Telegram group turns recover with a real answer when a bounded retry succeeds, or send one generic recovery message when the shared terminal classifier proves the turn is eligible. Explicit silence remains silent.

Evidence

  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run.incomplete-turn.test.ts -- -t "retries .* even when deliberate silence is allowed" — 2 passed, 155 skipped.
  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.fallback-topic-media.test.ts — 12 passed.
  • Full embedded incomplete-turn file before the assertion-only test correction — 155 unchanged tests passed; the two new behavior cases were corrected and rerun above.
  • Direct live deepseek-v4-flash streaming probe, 3/3 HTTP 200 completions with visible content, finishReason=stop, and [DONE]; first visible content in 625–950 ms.
  • Autoreview: clean, no accepted/actionable findings.
  • CI run 30773802153 — green on exact head b04e3f33ecdf.

Real Telegram proof remains blocked by the proof infrastructure before any scenario assertion:

  • Desktop proof run 30774069639 and bounded fresh-run retry 30775459608 both authenticated the burner account, then skipped baseline and candidate because the isolated candidate SUT exited before a proof message; both runs released their Telegram and Crabbox leases.
  • Telegram live QA run 30776603434 failed while preparing the candidate worktree, before telegram-empty-response-after-write-recovery ran or produced an evidence manifest.

No proof run observed a product failure; none reached the Telegram assertion. The PR remains open because ClawSweeper requires real after-fix Telegram evidence before merge.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 2, 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. 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 Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 10:19 PM ET / August 3, 2026, 02:19 UTC.

ClawSweeper review

What this changes

The PR retries bare-empty and reasoning-only embedded-agent completions for visible turns, then makes the Telegram plugin send one generic recovery message only when the shared reply dispatcher has established that no visible reply was delivered.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

The patch follows the shared settled-delivery eligibility contract rather than re-inferring silence in Telegram, and its focused tests cover retry and fallback delivery. It remains a maintainer-owned P1 merge decision: a current real Telegram scenario did not reach an assertion, and CI is still running on the latest head.

Priority: P1
Reviewed head: 7550082fde44be0febeb67a6ea124c6d0fa213ee
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The owner-boundary repair and focused coverage are solid, but live Telegram behavior has not yet been observed on the branch.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Focused tests and CI are supplemental, but all documented real Telegram attempts stopped before their scenario assertion; attach a redacted live transcript or Desktop recording if maintainers do not accept the stated exception. 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 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Focused tests and CI are supplemental, but all documented real Telegram attempts stopped before their scenario assertion; attach a redacted live transcript or Desktop recording if maintainers do not accept the stated exception. 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 6 items Shared eligibility owner: The shared dispatcher marks fallback eligibility only after settlement, with guards for visible delivery, observed delivery, active-run acceptance, deliberate silence, and already delivered fallback; this is the authoritative producer the Telegram change consumes.
PR consumes authoritative fact: The branch copies the shared no-visible-reply eligibility result into Telegram state and gates the generic fallback on that fact instead of treating every empty group result as recoverable.
Visible-turn retry boundary: The branch keeps explicit silent replies eligible for silence but treats bare empty and reasoning-only outcomes as retryable for visible turns, preserving optional terminal jobs as the distinct non-visible case.
Findings None None.
Security None None.

How this fits together

The embedded agent runner turns a model completion into terminal reply state, and the shared reply dispatcher records whether a user-visible delivery occurred. The Telegram plugin consumes that settled result to decide whether it should emit a final recovery message to a directed group turn.

flowchart LR
  A[Directed Telegram message] --> B[Telegram dispatch turn]
  B --> C[Embedded agent runner]
  C --> D[Shared reply dispatcher]
  D --> E{Visible reply delivered?}
  E -->|Yes or explicit silence| F[No recovery message]
  E -->|No, eligible| G[Telegram recovery reply]
  G --> H[Telegram group user]
Loading

Decision needed

Question Recommendation
Should this P1 Telegram delivery repair merge once exact-head CI is green despite the failed proof infrastructure, or should maintainers require one successful real Telegram scenario first? Require successful Telegram proof: Re-run the Telegram Desktop or live QA scenario until it demonstrates one recovery reply for an eligible empty completion and no reply for explicit NO_REPLY.

Why: The code and focused tests support the owner boundary, but no live Telegram run reached its assertion, so accepting that delivery risk is a maintainer release judgment.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Focused tests and CI are supplemental, but all documented real Telegram attempts stopped before their scenario assertion; attach a redacted live transcript or Desktop recording if maintainers do not accept the stated exception. 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.
  • Resolve merge risk (P1) - The change alters the final Telegram message-delivery decision for directed turns; synthetic coverage is strong, but every attempted live Telegram proof stopped before the scenario assertion, so the exact user-visible behavior remains unobserved.
  • Resolve merge risk (P1) - The latest branch is cleanly mergeable but behind main and has incomplete CI; merge should wait for exact-head required checks and a refresh against current main.
Agent review details

Security

None.

PR surface

Source -22, Tests +71. Total +49 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 13 35 -22
Tests 2 93 22 +71
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 106 57 +49

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #116277
Summary: This PR is the candidate implementation for the linked silent Telegram reply report; the PR body narrows the report’s retracted provider attribution to a shared completion and delivery invariant.

Members:

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

Mantis proof suggestion

A Telegram Desktop proof can directly show that an eligible directed empty completion produces one recovery message while explicit NO_REPLY remains silent. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify that an eligible directed empty completion produces exactly one recovery reply while explicit NO_REPLY remains silent.

Merge-risk options

Maintainer options:

  1. Capture the final Telegram behavior (recommended)
    Require one redacted live Telegram transcript or Desktop recording on the current head before merge, then let ordinary exact-head CI gates decide.
  2. Accept the live-proof exception
    A maintainer may merge once required checks are green while accepting that the recovery decision has only shared-contract and mock-harness proof.

Technical review

Best possible solution:

Land the shared eligibility consumer only after exact-head CI is green and a maintainer either supplies one real Telegram before/after transcript or explicitly records acceptance of the currently unproven live-delivery risk.

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

No live reproduction was completed: the supplied Telegram proof runs failed before the scenario assertion. Yes at source level: the current branch’s focused tests model the settled eligibility path and the visible-turn retry boundary.

Is this the best way to solve the issue?

Yes: using the shared settled delivery fact is safer than Telegram re-inferring silence from empty payloads, because the producer already excludes observed delivery, message-tool delivery, deliberate silence, and double-send states.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Focused tests and CI are supplemental, but all documented real Telegram attempts stopped before their scenario assertion; attach a redacted live transcript or Desktop recording if maintainers do not accept the stated exception. 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 status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: A directed Telegram group message can end without the expected user-visible response, affecting an active channel workflow.
  • merge-risk: 🚨 message-delivery: The PR changes when Telegram emits or suppresses the final recovery message after a model turn.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Focused tests and CI are supplemental, but all documented real Telegram attempts stopped before their scenario assertion; attach a redacted live transcript or Desktop recording if maintainers do not accept the stated exception. 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.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram group-reply behavior, and a short Telegram Desktop recording can directly show the recovery and silence outcomes.

Evidence

What I checked:

  • Shared eligibility owner: The shared dispatcher marks fallback eligibility only after settlement, with guards for visible delivery, observed delivery, active-run acceptance, deliberate silence, and already delivered fallback; this is the authoritative producer the Telegram change consumes. (src/auto-reply/reply/dispatch-from-config.finalize.ts:366, 347f16d5565d)
  • PR consumes authoritative fact: The branch copies the shared no-visible-reply eligibility result into Telegram state and gates the generic fallback on that fact instead of treating every empty group result as recoverable. (extensions/telegram/src/bot-message-dispatch-turn.ts:287, 7550082fde44)
  • Visible-turn retry boundary: The branch keeps explicit silent replies eligible for silence but treats bare empty and reasoning-only outcomes as retryable for visible turns, preserving optional terminal jobs as the distinct non-visible case. (src/agents/embedded-agent-runner/run/incomplete-turn.ts:703, 7550082fde44)
  • Focused regression coverage: The branch adds an embedded-runner case that verifies a reasoning-only completion retries and a Telegram dispatch case that verifies the shared eligibility bit produces exactly one generic reply. (src/agents/embedded-agent-runner/run.incomplete-turn.test.ts:1569, 7550082fde44)
  • Feature provenance: Blame attributes both branch changes to the initial PR implementation commit, while the main-branch shared eligibility contract predates the branch and is attributed to the recent auto-reply work on current main. (extensions/telegram/src/bot-message-dispatch.ts:509, 991bca33dd9f)
  • Proof and exact-head status: The PR body documents two Telegram Desktop attempts and one live QA attempt that failed before the scenario assertion; its latest-head CI remains incomplete, with build, lint, contract, QA, and security lanes still in progress in the supplied check state. (7550082fde44)

Likely related people:

  • steipete: Current-main history and blame connect Peter Steinberger to the shared no-visible-reply contract, and the same person authored the branch implementation across the embedded runner and Telegram consumer. (role: recent area contributor; confidence: high; commits: c5bcb7a84e27, 991bca33dd9f, 7550082fde44; files: src/auto-reply/reply/dispatch-from-config.finalize.ts, src/agents/embedded-agent-runner/run/incomplete-turn.ts, extensions/telegram/src/bot-message-dispatch.ts)

Rank-up moves

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

  • Capture a redacted Telegram Desktop or live QA result for both the eligible recovery and explicit NO_REPLY cases.
  • Wait for the latest-head CI matrix to finish green and refresh the branch against current main if required.

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 (5 earlier review cycles)
  • reviewed 2026-08-02T23:50:50.471Z sha ea444f5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T00:04:20.863Z sha 9548ccc :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T00:15:49.042Z sha b04e3f3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T01:47:13.690Z sha b04e3f3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T02:03:57.969Z sha 04829f75d91cd31e68dc26b846ae91f71a249514 :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

I am retaining the changelog entry. Root AGENTS.md requires a changelog for a user-facing landed fix, and this is a maintainer-authored repair rather than a contributor PR where release curation would add it later.

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis telegram desktop proof: verify that a directed group turn with an eligible empty completion produces exactly one recovery reply while explicit NO_REPLY remains silent.

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 3, 2026
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer decision: proceed without real Telegram proof. The missing proof is explicitly accepted for this landing.

The residual risk is understood: two Desktop proof attempts skipped both baseline and candidate before any Telegram assertion because the isolated SUT could not start, and the separate Telegram live workflow also failed before its scenario ran. Exact-head CI, focused regression tests, live DeepSeek transport probes, and autoreview are green; no proof attempt observed a product failure.

This comment is the explicit resolution of the remaining ClawSweeper proof/risk move for this merge.

@steipete steipete self-assigned this Aug 3, 2026
@steipete
steipete force-pushed the codex/fix-telegram-empty-reply branch from b04e3f3 to 7099215 Compare August 3, 2026 01:55
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 3, 2026
@steipete
steipete force-pushed the codex/fix-telegram-empty-reply branch from 04829f7 to 7550082 Compare August 3, 2026 02:14
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 3, 2026
@steipete
steipete merged commit 97034f3 into main Aug 3, 2026
194 of 198 checks passed
@steipete
steipete deleted the codex/fix-telegram-empty-reply branch August 3, 2026 02:53
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…claw#118305)

* fix(telegram): recover empty directed replies

* test: fix empty-reply assertions

* test: restore result assertions

---------

Co-authored-by: Peter Steinberger <[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 channel: telegram Channel integration: telegram maintainer Maintainer-authored PR 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

DeepSeek v4 Flash silent reply failure — no reply generated, generic fallback

1 participant