fix(telegram): stop duplicate fallback when dispatch fails after final reply#90152
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step |
0b30f27 to
4cd8fa2
Compare
|
Live Telegram proof for Setup:
Observed result:
Sanitized runner summary: {
"status": "pass",
"proofScenario": "late-dispatch-after-final",
"botUsername": "moongpbot",
"chatType": "private",
"requestLogContainsProofText": true,
"gatewayLogContainsForcedHook": true,
"requestLogExists": true
}@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…l reply Telegram no longer sends a generic "Something went wrong" fallback after a final answer was already delivered and a later dispatch/cleanup step failed. Failures with only partial or no visible output still send the error fallback and stay retryable. Related: openclaw#87299 Closes openclaw#90152
|
Maintainer takeover: rewrote the branch to a single commit keeping the runtime fix and its behavior tests, and dropping the private-QA parts. Kept:
Dropped (maintainer decision — we don't want more env-gated QA fault hooks in bundled plugin runtime code):
The live Telegram Desktop proof posted above still stands as evidence for the fix itself. Thanks @zhangguiping-xydt — authorship kept on the squashed commit. |
…l reply Telegram no longer sends a generic "Something went wrong" fallback after a final answer was already delivered and a later dispatch/cleanup step failed. Failures with only partial or no visible output still send the error fallback and stay retryable. Related: openclaw#87299 Closes openclaw#90152
Related: #87299
Related: #89930
What Problem This Solves
Resolves a Telegram late-dispatch boundary where a visible final reply could be followed by a generic error fallback if dispatch cleanup failed afterward.
The branch had also become unmergeable after upstream Telegram dispatch changes. This update rebases the proof harness onto current
origin/main, resolves the conflicts, and keeps the fallback suppression tied to final-answer delivery rather than any partial/progress delivery.Why This Change Was Made
This adds a trusted private-QA proof scenario,
--proof-scenario late-dispatch-after-final, and passes it into the local Telegram gateway asOPENCLAW_TELEGRAM_QA_DISPATCH_FAULT=late-dispatch-after-final. The Telegram hook remains gated byOPENCLAW_BUILD_PRIVATE_QA=1,OPENCLAW_ENABLE_PRIVATE_QA_CLI=1, and the exact scenario value.The proof runner also rejects candidate SUT checkouts that do not contain the matching Telegram QA fault hook, and the Mantis Telegram Desktop prompt tells agents to rebase onto the harness or test a merge result instead of treating an unsupported candidate run as proof. The SUT support guard now checks for the hook in the exported
dispatchTelegramMessagedispatch path rather than accepting loose stale strings or fake dispatcher snippets (RF-003). The runtime fallback guard now suppresses duplicate generic fallback only after a final answer has been delivered, while preserving the error fallback after partial-only output failures. Spooled replay completion still treats already visible output as delivered so draft/progress output is not retried unnecessarily.Maintainers should still decide whether carrying this private-QA runtime hook and trusted proof-runner behavior in bundled Telegram source is acceptable (RF-004, RF-005).
User Impact
Developers and maintainers can now run a deterministic Telegram proof scenario for the late-dispatch-after-final boundary, and proof agents get a clear failure instead of misleading exact-path evidence when a candidate checkout lacks the hook.
Telegram users no longer receive a second generic error reply after a visible final answer is already delivered. If dispatch fails after only partial/block output, the existing terminal error fallback is still sent.
Evidence
Before this update,
check-main-driftreportedhas_conflicts: trueandsync-mainreproduced conflicts in:extensions/telegram/src/bot-message-dispatch.tsextensions/telegram/src/bot-message-dispatch.test.tsscripts/e2e/telegram-user-crabbox-proof.tstest/scripts/telegram-user-crabbox-proof.test.tsAfter resolving the conflicts,
check-main-driftreportshas_conflicts: falseagainst currentorigin/main; the updated branch is squashed to a single commit on top oforigin/main(RF-002). Validation included the rebased full-file suites before the final focused guard hardening:Additional focused validation on the current head:
Current limitations: this PR still does not include a fresh live Telegram Desktop forced late-dispatch capture (RF-001). The intended exact-path consumer remains the downstream Telegram behavior-fix proof after this harness lands or is tested as a merge result.