telegram: avoid silent fallback after message tool send (#78685)#78726
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. as a source-level path but not a live run in this review. Current main only marks Telegram delivery from the inbound reply pipeline, while Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Mark the active inbound turn delivered using the successful Telegram send result's resolved Do we have a high-confidence way to reproduce the issue? Yes, as a source-level path but not a live run in this review. Current main only marks Telegram delivery from the inbound reply pipeline, while Is this the best way to solve the issue? No. Forwarding Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against f66a2dc41d3b. |
Code review follow-up ([P2] gateway
|
|
@clawsweeper re-review |
3816525 to
90070cb
Compare
) Register the active Telegram inbound SessionKey/outbound peer while dispatching, and mark inbound lane delivery when deliverOutbound emits a matching telegram message:sent success. Prevents rewritten silent-reply fillers after visible tool-routed replies with an empty final. Co-authored-by: Cursor <cursoragent@cursor.com>
90070cb to
c4f3116
Compare
obviyus
left a comment
There was a problem hiding this comment.
Verified the Telegram same-chat message.send path and confirmed the fix marks the matching inbound turn delivered after the action-runtime send succeeds, so the rewritten silent fallback is skipped.
Maintainer follow-up: moved correlation into the Telegram plugin, removed the core/SDK hook, rebased, and updated structured RBP proof with maintainer override.
Gate: pnpm test extensions/telegram/src/inbound-turn-delivery.test.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/channel-actions.test.ts extensions/telegram/src/bot-message-dispatch.test.ts; pnpm exec oxfmt --check --threads=1 ...; node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json ...; git diff --check origin/main...HEAD; CI/RBP green on c4f3116.
|
Landed on main. Thanks @neeravmakwana. |
… (thanks @neeravmakwana) * telegram: correlate message-tool sends with inbound turn (openclaw#78685) Register the active Telegram inbound SessionKey/outbound peer while dispatching, and mark inbound lane delivery when deliverOutbound emits a matching telegram message:sent success. Prevents rewritten silent-reply fillers after visible tool-routed replies with an empty final. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(telegram): track message action delivery --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
…@neeravmakwana) * telegram: correlate message-tool sends with inbound turn (#78685) Register the active Telegram inbound SessionKey/outbound peer while dispatching, and mark inbound lane delivery when deliverOutbound emits a matching telegram message:sent success. Prevents rewritten silent-reply fillers after visible tool-routed replies with an empty final. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(telegram): track message action delivery --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us> (cherry picked from commit 447182a)
… (thanks @neeravmakwana) * telegram: correlate message-tool sends with inbound turn (openclaw#78685) Register the active Telegram inbound SessionKey/outbound peer while dispatching, and mark inbound lane delivery when deliverOutbound emits a matching telegram message:sent success. Prevents rewritten silent-reply fillers after visible tool-routed replies with an empty final. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(telegram): track message action delivery --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * telegram: correlate message-tool sends with inbound turn (openclaw#78685) Register the active Telegram inbound SessionKey/outbound peer while dispatching, and mark inbound lane delivery when deliverOutbound emits a matching telegram message:sent success. Prevents rewritten silent-reply fillers after visible tool-routed replies with an empty final. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(telegram): track message action delivery --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Root cause
Telegram inbound dispatch tracks user-visible replies with
deliveryStatewhen the buffered reply pipeline callsdeliverReplies/ durable final delivery. Themessagetool path for Telegram is gateway-owned and sends throughextensions/telegram/src/action-runtime.ts; the original patch marked the generic outbound delivery path instead, so a successful Telegrammessage.sendstill left the inbound turn looking undelivered and allowed the rewritten silent-reply fallback to show up.Fixes #78685 .
Approach
Keep the correlation inside the Telegram plugin. During an inbound Telegram turn, correlate the trusted session key to the active chat/account, pass that trusted session key into the Telegram action runtime, and mark the inbound turn delivered only after the matching Telegram
message.sendsucceeds for the same target/account.Safety
Scoped to Telegram + matching session key/outbound recipient. The correlation is cleared when inbound dispatch exits, wrong targets do not mark the turn delivered, and no core/SDK Telegram special case remains.
Runtime / security
No change to Telegram auth/pairing, gateway auth models, sandboxing, or tool ACLs. Delivery correlation only affects whether the rewritten silent filler is skipped after proven outbound visibility.
Real behavior proof
message.sendshould not also get the unwanted rewritten silent fallback.c4f3116a4660374562554f2be9f37febb22aefcc, currentorigin/mainbase92284bc46043900bccd5a3c612d49132638d5da4, Node/pnpm repo tooling, Telegram plugin dispatch/action runtime path.pnpm test extensions/telegram/src/inbound-turn-delivery.test.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/channel-actions.test.ts extensions/telegram/src/bot-message-dispatch.test.ts;pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/telegram/src/action-runtime.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/channel-actions.ts extensions/telegram/src/channel-actions.test.ts extensions/telegram/src/inbound-turn-delivery.ts extensions/telegram/src/inbound-turn-delivery.test.ts;node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/telegram/src/action-runtime.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/channel-actions.ts extensions/telegram/src/channel-actions.test.ts extensions/telegram/src/inbound-turn-delivery.ts extensions/telegram/src/inbound-turn-delivery.test.ts;git diff --check origin/main...HEAD; GraphQL review-thread query for PR telegram: avoid silent fallback after message tool send (#78685) #78726.Test Files 4 passed (4)/Tests 100 passed (100),All matched files use the correct format.,Found 0 warnings and 0 errors., cleangit diff --check, and GraphQLreviewThreads.nodes=[]at headc4f3116a4660374562554f2be9f37febb22aefcc.TELEGRAM_BOT_TOKEN/OPENCLAW_QA_TELEGRAM_*credentials were exposed locally; maintainer override is applied for the RBP gate with the scoped code-path proof above.Tests run
Out of scope