fix(telegram): materialize preview drafts#95044
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 10:16 PM ET / 02:16 UTC. Summary PR surface: Source +79, Tests +79. Total +158 across 6 files. Reproducibility: yes. at source level: the PR's new noteActivity path calls gate.noteWork, the gate can start later from a timer, and the delayed onStart render does not re-check finalReplyStarted or finalReplyDelivered. I did not run a live Telegram repro in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Add a final-state cancellation or render guard with a regression test, then provide redacted native Telegram proof before maintainers decide whether to merge the delayed-placeholder policy. Do we have a high-confidence way to reproduce the issue? Yes at source level: the PR's new noteActivity path calls gate.noteWork, the gate can start later from a timer, and the delayed onStart render does not re-check finalReplyStarted or finalReplyDelivered. I did not run a live Telegram repro in this read-only review. Is this the best way to solve the issue? No as-is: the change is in a plausible owner boundary, but it needs a final-state guard/cancel path and native Telegram proof before it is the best mergeable solution. The prior debounce-fragment PR is only partial overlap, not a replacement. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d6c7e95c7b3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +79, Tests +79. Total +158 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper explain I think the superseded-by-#80045 conclusion is inconsistent with the evidence in this review. #80045 fixed #79605 by preserving the 30-character first-preview debounce while coalescing delta-shaped partial fragments. It did not change delayed below-threshold first-preview materialization, and it did not address progress-mode answer-lane suppression. This PR targets #95004 specifically:
The review's own cluster says this PR is |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dcafa52c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@openclaw-mantis telegram desktop proof Please capture real Telegram Desktop visible proof for the current head. Focus on the issue #95004 behavior: the Telegram draft stream should not send a tiny first answer-only preview immediately; the first visible preview should wait for the delayed threshold or meaningful content, and the final response should still be delivered. |
|
@openclaw-mantis telegram desktop proof Retry after the GitHub App rate-limit reset. Please capture real Telegram Desktop visible proof for the current head. Focus on issue #95004 behavior: the Telegram draft stream should not send a tiny first answer-only preview immediately; the first visible preview should wait for the delayed threshold or meaningful content, and the final response should still be delivered. |
|
@clawsweeper re-review I updated the PR body's |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
Fixes #95004.
This updates Telegram preview streaming in two places:
minInitialCharsnow materialize after two throttle windows, using the latest pending text and cancelling cleanly on discard, clear, reset, or threshold send.Verification
node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.ts telegram/src/draft-stream.test.ts -t "minInitialChars"failed on the new delayed-materialization expectation with zerosendMessagecalls.node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.ts telegram/src/draft-stream.test.ts -t "minInitialChars".node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.ts telegram/src/bot-message-dispatch.test.ts -t "answer-only progress-mode".node scripts/run-vitest.mjs run --config test/vitest/vitest.channels.config.ts src/channels/progress-draft-compositor.test.ts -t "generic activity".node scripts/run-vitest.mjs run --config test/vitest/vitest.channels.config.ts src/channels/progress-draft-compositor.test.ts && node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.ts telegram/src/draft-stream.test.ts telegram/src/bot-message-dispatch.test.ts.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/telegram/src/draft-stream.ts.node scripts/run-bundled-extension-oxlint.mjs.node_modules/.bin/oxfmt --check --threads=1 extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/draft-stream.test.ts extensions/telegram/src/draft-stream.ts src/channels/progress-draft-compositor.test.ts src/channels/progress-draft-compositor.ts.git diff --check.node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo.node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo.git diff --check origin/main...HEAD.Autoreview was attempted once per the draft-PR guardrail, but the helper failed before reviewing because the local Codex config uses
service_tier = priority, which this Codex binary rejects. No autoreview findings were produced.Real behavior proof
Behavior addressed: Telegram preview streaming no longer stays silent for source-proven short first drafts below
minInitialChars, and answer-only progress-mode streams now produce the existing label-only progress preview instead of suppressing all draft activity until final delivery.Real environment tested: Source-level behavior proof in a real OpenClaw checkout, using the original issue's accepted current-main reproduction plus PR-head after-fix commands. ClawSweeper already reviewed #95004 as a high-confidence source repro and labeled it
clawsweeper:source-repro/issue-rating: 🦞 diamond lobster: #95004 (comment)Exact steps or command run after this patch: I compared the issue's current-main source proof against this PR head, then ran the focused after-fix commands below:
Evidence after fix: The original issue proof established that current main suppresses the first short Telegram preview below
minInitialChars, setsdraftMinInitialCharsto 30 outside progress mode, and drops answer-lane partials in progress mode before they reach the Telegram draft stream. This PR changes those exact paths. After the patch, the delayedminInitialCharstest observes a TelegramsendMessageafter the bounded delay, and the answer-only progress-mode test observes a label-only draft update, no answer text draft update, draft cleanup, and final durable delivery.Observed result after fix:
What was not tested: Native Telegram Desktop / real-user visual proof was not captured from this contributor environment. Local
openclaw-telegram-user-crabbox-proofwas unavailable, the repo script dry-run failed without~/.codex/skills/custom/telegram-e2e-bot-to-bot/convex.local.env, and the Mantis proof workflow requires maintainer/write permission for comment triggers. The proof above is the issue-backed source-level reproduction plus after-fix source verification, not a native Telegram recording.