Repository navigation
fix(telegram): honor human delay for streamed replies - #69022
Conversation
Greptile SummaryThis PR wires Confidence Score: 5/5This PR is safe to merge — the change is minimal, follows the established cross-channel pattern exactly, and is covered by a new passing test. No P0 or P1 issues found. The fix is a one-liner at the correct injection point, re-uses the same resolveHumanDelayConfig seam already present in all peer channel implementations, and the new test validates the wiring end-to-end. No files require special attention. Reviews (1): Last reviewed commit: "Telegram: apply humanDelay between strea..." | Re-trigger Greptile |
|
Maintainer triage: safe small merge for #68945, but not part of the polling-stall root cause. This is the better of the two humanDelay PRs because it uses the local runtime barrel and has a focused test proving Note for triage: this intentionally adds configured delay between streamed block replies; it should not be used as evidence for #69147/#64288 slow polling stalls. |
52f02bc to
022d0f5
Compare
022d0f5 to
495e715
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #69022 |
495e715 to
8b39c94
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 5:05 AM ET / 09:05 UTC. ClawSweeper reviewWhat this changesThe PR passes the routed agent’s existing human-delay setting to Telegram’s buffered streamed-block reply dispatcher and adds focused regression coverage. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still omits the Telegram handoff, while this focused patch restores the documented block-only pacing behavior with exact-head Telegram proof and no blocking finding. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherTelegram turns resolve an agent route and assemble a reply dispatcher before sending streamed blocks to the Telegram Bot API. This change supplies the existing agent-level pacing policy to that dispatcher, which already limits delays to blocks after the first. flowchart LR
A[Telegram inbound message] --> B[Route and agent selection]
B --> C[Existing human-delay policy]
C --> D[Buffered reply dispatcher]
D --> E[First block immediately]
E --> F[Later blocks paced]
D --> G[Tool and final replies unchanged]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +24. Total +32 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Merge the Telegram-local handoff so its streamed-block path uses the existing route-scoped policy and remains aligned with sibling channels. Do we have a high-confidence way to reproduce the issue? Yes. The supplied real Telegram baseline reproduced back-to-back streamed blocks with a fixed 2500ms policy, and current main source still omits the handoff. Is this the best way to solve the issue? Yes. Reusing the existing route-scoped resolver at Telegram’s dispatcher boundary matches sibling channels and avoids a Telegram-specific configuration or core workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf908f70b9c7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Punchcard-Session: calm-brook-harbor-jm
|
@openclaw-mantis verify exact-head Telegram human-delay behavior with three streamed block replies and a custom, clearly observable delay. Require the baseline to deliver the blocks back-to-back. Require the candidate to pause only before blocks two and three, never before block one. Also verify the delay is not applied to final replies or tool-result messages. Publish the exact baseline and candidate SHAs plus recorded timing evidence. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Mantis Telegram proof — PASSSummary: Real-user Telegram proof compared baseline 0497cd9 with candidate edf851d4db4d8901f8182c56b911e85a78363b80 (the merge candidate containing PR head eff606f). With a fixed 2500ms humanDelay, baseline block dispatches had no configured hold, while the candidate waited about 2.5 seconds after each prior block delivery. Tool-start, tool-result, and final replies retained their normal cadence in both lanes.
Motion-trimmed clips: |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|


Fixes #68945
What Problem This Solves
Fixes an issue where Telegram users receiving streamed block replies would get every block back-to-back even when the routed agent configured
humanDelay.Why This Change Was Made
The active Telegram turn resolves the existing route-scoped human-delay policy and passes it to the shared buffered reply dispatcher. This is the Telegram owner boundary already used by sibling channels; it adds no config, default, SDK, dependency, schema, fallback, or lifecycle surface.
User Impact
Telegram block-streaming replies now honor the configured default and per-agent pacing policy.
Evidence
Exact published head:
eff606f2b285aff90fbc0cf02aafaa60c6735e61Current-main port base:
7ba58abd93d6625d1bb02f04a088c82c39dd05b9Regression proof
forwards route-scoped humanDelay to the block dispatcherreported that the resolver had 0 calls. Result: 1 failed, 21 passed.Focused proof
node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.delivery-basics.test.ts- 22/22 passed.node scripts/run-vitest.mjs src/agents/identity.human-delay.test.ts- 2/2 passed.node scripts/run-vitest.mjs src/auto-reply/reply/reply-flow.test.ts- 24/24 passed.git diff --checkand targetedoxfmtpassed.OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs -- <touched files>passed all selected gates. Dead-export scanning was skipped only in the final unchanged rerun after passing twice with 0 entries.Production delta: +3 lines. Tests and test-support delta: +29 lines. The positive production delta is the minimal Telegram-owned policy handoff; moving it into shared core would violate the plugin boundary.
Punchcard-Session: calm-brook-harbor-jm