Repository navigation
fix(telegram): make ingress coalescing checks wait for dispatch - #150093
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:57 AM ET / 13:57 UTC. ClawSweeper reviewWhat this changesThe PR synchronizes Telegram ingress tests with buffer entry and downstream dispatch while preserving delivery order, message counts, and durable-completion assertions. Merge readiness✅ Ready for maintainer review Keep open: this focused fixture repair remains useful for validating the linked shutdown work, and current main retains the premature assertions. No actionable correctness defect was found. Priority: P3 Review scores
Verification
How this fits togetherTelegram updates enter a durable queue, pass through the shared ingress monitor, and reach a buffer that combines related messages before agent dispatch. These tests check that buffering preserves progress, ordering, and replay protection. flowchart LR
A[Synthetic Telegram updates] --> B[Durable ingress queue]
B --> C[Ingress monitor]
C --> D[Message buffer]
E[Controlled debounce clock] --> D
D --> F[Observed agent dispatch]
F --> G[Ordering and completion checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +13. Total +13 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep lifecycle-based synchronization in the existing fixture, with logical timing coverage separate from shutdown settlement and wall-clock performance claims. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the assertion race: durable admission and an empty pending queue do not establish downstream dispatch. The supplied full-file results support it; this read-only review did not execute tests. Is this the best way to solve the issue? Yes. Waiting at existing lifecycle boundaries and controlling the debounce clock addresses the race without changing production code or weakening final delivery assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ebae945b4afa. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #150080
What Problem This Solves
Telegram's durable-ingress tests can assert delivery before the debounce window has elapsed or before a claimed follower reaches dispatch, obscuring validation of the account-shutdown fix in #150080.
User Impact
No runtime behavior changes. This maintainer-requested fixture repair preserves the message counts, ordering checks, durable tombstones, and existing test deadlines.
Why This Change Was Made
Wait for the real handler to reach the buffer before advancing each 20 ms timer step. At the existing 400 ms maximum-wait boundary, observe the existing downstream-dispatch callback before admitting the final four of 24 messages. Real asynchronous preparation remains awaited. The session-conflict case checks its follower inside the existing wait barrier because an empty pending queue can still contain claimed work.
This proves logical debounce progress and ordered delivery; it does not measure end-to-end real-wall-clock throughput. Production code and the existing 1-second, 5-second, and outer test deadlines are unchanged.
Evidence
OPENCLAW_E2E_SKIP_BUILD=1 node scripts/run-vitest.mjs extensions/telegram/src/telegram-ingress-coalescing.e2e.test.ts.The earlier 11-case shutdown-candidate result used a different completion waiter and is not final proof for #150080. That PR must consume this canonical fix and rerun its own 11-case sequence.