Flush buffered Telegram finals after segmented delivery#83616
Flush buffered Telegram finals after segmented delivery#83616bpconnor3-r2 wants to merge 1 commit into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as a duplicate: the same Telegram buffered-final flush is already tracked by the older open canonical PR, which has the linked root bug, the same code change, and a fuller regression scenario. Canonical path: Close this duplicate draft and continue review, live Telegram proof, and any landing work on #53762. So I’m closing this here and keeping the remaining discussion on #53762 and #53384. Review detailsBest possible solution: Close this duplicate draft and continue review, live Telegram proof, and any landing work on #53762. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection and both PR tests show the path: a final payload split into reasoning and answer segments can leave reasoning only hinted, buffer the answer, and return from the segment branch before flushing; I did not execute tests because this review is read-only. Is this the best way to solve the issue? No for this PR as the merge vehicle. The code shape is plausible, but the same fix is already represented by the older canonical PR with the linked bug and fuller regression scenario. Security review: Security review cleared: The diff touches Telegram dispatch logic and a test only; it does not change dependencies, workflows, permissions, secrets handling, or package execution paths. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 35cd2af159f4. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Root cause
When Telegram final output was split into reasoning/answer lane segments, the reasoning segment could be handled without sending a visible message. The visible answer was then buffered, but the
segments.length > 0path returned beforeflushBufferedFinalAnswer()ran, so automatic direct-message delivery could silently drop the final answer.Validation
OPENCLAW_VITEST_INCLUDE_FILE=/tmp/openclaw-telegram-include.json node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.tsextensions/telegram/src/bot-message-dispatch.test.tspassed, 67 testsNote: I also attempted the broader Telegram extension suite. This dispatch test file passed there as well, but the full suite reported unrelated existing failures in
channel.gateway.test.tsstartup probe handling plus runtime/token setup errors.