fix(telegram): retry forum replies without invalid thread id#79410
fix(telegram): retry forum replies without invalid thread id#79410Clausinho wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source inspection gives a high-confidence path: current main retries threadless only for DM threads and the existing forum test asserts the thread-not-found error is thrown and logged. I did not run tests because this review is read-only. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep non-General forum topic sends fail-closed unless maintainers explicitly change the delivery-scope policy; address the visible failure with safe diagnostics or a designed recovery path that does not send topic content to a different thread. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence path: current main retries threadless only for DM threads and the existing forum test asserts the thread-not-found error is thrown and logged. I did not run tests because this review is read-only. Is this the best way to solve the issue? No. The code change is small, but broadening forum-topic retry reverses the established fail-closed safety boundary; a safer fix should preserve topic scope or require explicit maintainer policy approval. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 29e27d2d9cb3. |
|
Updated the PR body to include the required Real behavior proof section and copied live after-fix evidence from the patched checkout. GitHub would not rerun the old failed run (), so this comment is just a heads-up while the next PR sync/check cycle catches up. |
7f30eb8 to
2823866
Compare
2823866 to
4795404
Compare
|
Thanks for the focused fix and the detailed write-up. I’m going to close this because current main has moved to the safer delivery policy from #78575: when Telegram rejects a requested topic/thread id, OpenClaw should fail visibly instead of retrying without the topic and potentially posting into the wrong chat surface. The original failure mode is real, but this PR’s forum threadless retry would reverse that safety boundary. Any remaining forum-topic routing work should continue through the safer follow-up path in #76920. |
Summary
400: Bad Request: message thread not found.extensions/telegram/src/bot/delivery.send.tsnow allows the same emergency threadless retry forscope: "forum"that it already allowed forscope: "dm", andextensions/telegram/src/bot/delivery.test.tswas updated to lock in the forum retry behavior.message thread not foundfallback case.Linked Issue/PR
Real behavior proof
message_thread_idwas stale/invalid, instead of retrying threadless once like the older Telegram send paths already do./home/clausi/openclaw/tmp/openclaw-upstream-check), using the actual repository files for the Telegram integration and inspecting the patched source plus regression-test target in place.extensions/telegram/src/bot/delivery.test.ts.vitestis unavailable in this worktree).sendTelegramWithThreadFallback()only permitted threadless retry forparams.thread?.scope === "dm", which explains why forum-topic replies could vanish while other Telegram paths already recovered.Root Cause
bot-message-dispatch.ts->delivery.replies.ts->delivery.send.ts) had lost parity with older Telegram send helpers and draft preview delivery. It retried threadless only for DM topics, not forum topics, onmessage thread not found.extensions/telegram/src/send.tsandextensions/telegram/src/draft-stream.tsalready accepted the fallback tradeoff for forum threads, but the newer reply sender did not.Regression Test Plan
extensions/telegram/src/bot/delivery.test.tsmessage_thread_id, gets400: Bad Request: message thread not found, then retries once withoutmessage_thread_idand succeeds without runtime error logging.sendTelegramWithThreadFallback(), so the smallest durable guardrail is the delivery-layer test around that helper rather than a broader dispatcher workaround.