Fix Telegram stop debounce bypass#83248
Conversation
|
Codex review: passed. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. by source inspection: current main enqueues Telegram text through inbound debounce before abort handling, and the debouncer only has flush semantics for pending keyed work. I did not run a live Telegram repro in this read-only pass. Real behavior proof Mantis proof suggestion Next step before merge Security Review detailsBest possible solution: Land this bounded Telegram ingress fix after exact-head checks, keeping the generic helper small and preserving authorization-gated cancellation semantics. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main enqueues Telegram text through inbound debounce before abort handling, and the debouncer only has flush semantics for pending keyed work. I did not run a live Telegram repro in this read-only pass. Is this the best way to solve the issue? Yes. A generic What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d85a7c6b67bd. |
4143b1e to
726b1e1
Compare
Mantis Telegram Desktop ProofSummary: Mantis skipped Telegram Desktop before/after GIF proof because this PR did not have an honest native Telegram-visible before/after.
|
|
@clawsweeper automerge |
|
🦞🧹
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
726b1e1 to
19245a3
Compare
|
@clawsweeper automerge |
Summary
stop,/stop, and bot-addressed/stop) bypass inbound debounce immediately.Root Cause
Telegram inbound debounce could hold a normal message for a short window. When
stopor/stoparrived before that window flushed, the abort turn could either become debounceable itself or only cancel the current message's debounce lane, leaving an older same-chat buffered prompt to run after the stop.Real behavior proof
Behavior addressed: Telegram
stop//stopbypasses and cancels pending same-chat inbound debounce.Real environment tested: Focused Telegram bot middleware harness in a fresh tmp worktree from
origin/main.Exact steps or command run after this patch:
node scripts/run-vitest.mjs extensions/telegram/src/bot.create-telegram-bot.test.tsEvidence after fix:
Test Files 1 passed (1); Tests 80 passed (80)Observed result after fix:
stop,/stop@openclaw_bot, andstopafter a forwarded-burst buffer ran immediately while the earlier same-chat debounced prompt was still pending, and the earlier prompt did not flush afterward.What was not tested: Manual live Telegram E2E was not run in this pass.
Verification
node scripts/run-vitest.mjs extensions/telegram/src/bot.create-telegram-bot.test.tspnpm build~/.codex/skills/codex-review/scripts/codex-review --mode branchgit diff --checkWhat was not tested