feat(telegram): unify progress fallback with assistant preview lane#95522
feat(telegram): unify progress fallback with assistant preview lane#95522snowzlmbot wants to merge 10 commits into
Conversation
|
@clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 9:57 AM ET / 13:57 UTC. Summary PR surface: Source +147, Tests +208, Docs +20, Generated 0, Other 0. Total +375 across 18 files. Reproducibility: yes. Current main has source-level paths for suppressed short first previews and progress-mode answer partial suppression, and the PR includes live Telegram proof for the after-fix behavior. Review metrics: 2 noteworthy metrics.
Stored data model 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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Maintainers should either accept this combined Telegram behavior/API surface after exact-head gates finish, or choose the split path by landing #95183 first and revisiting #82303 separately. Do we have a high-confidence way to reproduce the issue? Yes. Current main has source-level paths for suppressed short first previews and progress-mode answer partial suppression, and the PR includes live Telegram proof for the after-fix behavior. Is this the best way to solve the issue? Unclear as product direction, technically acceptable as implementation: the combined patch is coherent, but maintainers must decide whether it is better than landing the split default-fix and assistant-preview PRs separately. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b28e68e0ceb2. Label changesLabel justifications:
Evidence reviewedPR surface: Source +147, Tests +208, Docs +20, Generated 0, Other 0. Total +375 across 18 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
|
cf536ce to
3296107
Compare
|
Force-pushed a metadata-only rewrite for commit identity hygiene. What changed:
@clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Pushed the same focused fix for the delayed-preview timer finding on the combined branch. What changed:
Validation: git diff --check origin/main...HEAD
pnpm config:channels:check
pnpm config:schema:check
node scripts/run-vitest.mjs \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.tsResult: 278 targeted tests passed; local proof-policy evaluation accepts the PR body as real behavior proof. @clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Added live Telegram Bot API before/after proof to the PR body. What the redacted live proof shows:
The proof used the configured test bot token against a private proof chat; token and chat identifiers are redacted in the PR evidence. @clawsweeper review-pr |
ae1b0bd to
8f16960
Compare
|
Rebased #95522 onto latest Why:
Post-rebase validation: git diff --check origin/main...HEAD
pnpm config:channels:check
pnpm config:schema:check
node scripts/run-vitest.mjs \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.tsResult: config checks passed and 278 targeted tests passed. Also re-ran the live Telegram Bot API delayed-clear proof on exact head @clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Complementary observations on top of ClawSweeper's detailed review: Cluster overlap is real. ClawSweeper flagged this PR as combining concerns that overlap with #95183 (default placeholder fix) and #82303 (assistant preview lane). I agree — and the overlap is worth resolving before merging because each piece changes user-visible Telegram behavior independently:
If maintainers want all three, merging this PR is fine — but they should explicitly accept the combined product (which ClawSweeper's review flagged as a P1). If not, the recommended path is to land #95183 first (default fix only), then revisit #82303 (assistant preview) as a separate opt-in. Specific to the lane-delay concern (P1 #1). The bot-message-dispatch delay logic uses a per-lane threshold without a bounded delay, which ClawSweeper notes can keep short opt-in previews invisible until final delivery. This is the kind of subtle timing bug that's easy to miss in tests but obvious to users — they see no preview, then a final answer, with no in-between. Two suggestions:
Real Telegram proof is missing. ClawSweeper notes the proof only covers delayed-clear timer cleanup. For a PR that changes visible Telegram behavior (placeholder text, preview ordering, final-answer ordering), proof should be one redacted Telegram Desktop recording showing:
Mantis proof request in the review comment is the right path. If you can't get Telegram proof pre-merge, the maintainer option #3 (accept source-only transport risk) is the explicit alternative. Bundled-config-metadata migration. ClawSweeper flagged |
|
Pushed What failed and why:
Fix:
Validation: git diff --check origin/main...HEAD
node scripts/plugin-sdk-surface-report.mjs --check
OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS_BY_ENTRYPOINT='{"core":2}' node scripts/plugin-sdk-surface-report.mjs --check
node scripts/run-vitest.mjs \
test/scripts/plugin-sdk-surface-report.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.ts \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.tsResult: surface report checks passed and 282 targeted tests passed. CI note:
@clawsweeper review-pr |
9948803 to
77786d8
Compare
|
Rebased onto latest What was fixed in this PR:
What was not caused by this PR:
Validation after rebase: git diff --check origin/main...HEAD
node scripts/plugin-sdk-surface-report.mjs --check
pnpm config:channels:check
pnpm config:schema:check
node scripts/run-vitest.mjs \
test/scripts/plugin-sdk-surface-report.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.ts \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.tsResult: surface report/config checks passed and 282 targeted tests passed. @clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Addressed the P1 lane-delay concern from the review thread and NianJiuZst's comment. What changed:
Validation: git diff --check origin/main...HEAD
node scripts/run-vitest.mjs \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.tsResult: targeted tests passed (278 tests across Telegram/channel/plugin-sdk/policy shards). Live Telegram Bot API proof on head
This proof is intended to support clipping a GIF from the screen recording around the 20:32 GMT+8 run. @clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Added the dedicated Telegram test bot recording proof to the PR body. Dedicated-bot proof details:
This should support the GIF clip from the operator recording. Once the recording file is uploaded, I can trim the 20:54:59-20:55:12 GMT+8 window into a GIF and attach it. @clawsweeper review-pr |
|
Pushed What changed:
Validation: git diff --check origin/main...HEAD
node scripts/plugin-sdk-surface-report.mjs --check
node scripts/run-vitest.mjs \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.tsResult: surface report passed; targeted tests passed (278 total across plugin-sdk, policy, Telegram, and channel shards). Note: the earlier @clawsweeper review-pr |
|
🦞🧹 Reason: re-review requires an open issue or PR. |
|
Thanks for pulling this together and for the detailed Telegram proof. We are going to close this one because the main user-facing gap is already covered on Appreciate the work here, especially the careful live proof. |
|
Resolved the merge conflict by rebuilding this PR branch cleanly on top of latest What changed:
Current head: Scope check:
Validation: git diff --check origin/main...HEAD
node scripts/plugin-sdk-surface-report.mjs --check
pnpm config:channels:check
pnpm config:schema:check
node scripts/run-vitest.mjs \
test/scripts/plugin-sdk-surface-report.test.ts \
src/plugin-sdk/channel-streaming.test.ts \
src/agents/model-runtime-policy.test.ts \
extensions/telegram/src/bot-message-dispatch.test.ts \
extensions/telegram/src/draft-stream.test.ts \
extensions/telegram/src/lane-delivery.test.ts \
src/channels/progress-draft-compositor.test.tsResult: surface/config checks passed; targeted Vitest passed (282 tests total). @clawsweeper review-pr |
Thanks for your review |
What Problem This Solves
Fixes #95004.
Telegram
progressstreaming currently has two related gaps:partial/blockbehavior.This PR is a canonical combined proposal that keeps the low-noise default fix from #95183 and incorporates the optional assistant-preview lane from #82303.
Relationship to Prior PRs / Attribution
This PR intentionally combines two existing approaches:
streaming.progress.assistantPreviewsupport that keeps the progress/tool draft and streams assistant partial text on a separate assistant preview lane.Credit for the assistant-preview lane design, config surface, and original regression coverage goes to @Fuma2013 in #82303. This branch cherry-picks those commits and preserves their author attribution, then resolves the interaction with #95183's richer progress draft behavior.
Summary
progressbehavior low-noise:streaming.progress.assistantPreview: truepreserves the existing progress/tool draft;clear()so cleanup cannot leave a pending preview flush after a draft is removed.Behavior Matrix
streaming.mode: "progress"only:streaming.mode: "progress", streaming.progress.assistantPreview: true:minInitialDelayMs.Real behavior proof
streaming.progress.assistantPreview: trueshould keep the progress/tool draft while rendering assistant partial text on a separate transient assistant preview lane.7541abe2753b58f3d0f53839f96f9bc926f42507.streaming.progress.assistantPreviewis enabled, assistant partial text is observed on the separate assistant lane and the progress draft remains intact. The generated channel metadata and base config schema also validate for the new config surface. The live Telegram Bot API delayed-clear proof shows the old post-clear timer fire is gone after this fix.7541abe2753b58f3d0f53839f96f9bc926f42507after the assistant-lane bounded-delay fix.Live Telegram Bot API timer cleanup proof
A real Telegram Bot API proof was run with the configured test bot token against a private proof chat. Token and chat identifiers are redacted in the captured evidence.
Scenario:
minInitialChars: 80andminInitialDelayMs: 1200.Proof <label>), then flush once so the delayed first-preview timer is scheduled.clear()before the delay elapses.Before/after evidence:
Observed result: before the fix,
clear()removed the visible draft state but left the delayed first-preview timer alive until it fired after cleanup. After the fix,clear()cancels the pending timer immediately, so no delayed flush runs after draft cleanup. The live Bot API run also confirms that the cleanup scenario does not leave a stray Telegram message after the fix.Generated metadata / upgrade compatibility proof
The only stored-data-model warning from ClawSweeper is for
src/config/bundled-channel-config-metadata.generated.ts. This PR does not add or migrate persisted runtime data. The generated metadata change exposes the new optional Telegram config keystreaming.progress.assistantPreviewso config UIs/schema consumers can discover it. Existing configs remain compatible because the field is optional and defaults to disabled behavior.Compatibility checks run on the combined head:
Result: both checks passed after regenerating
src/config/bundled-channel-config-metadata.generated.ts; no migration step is required.Live Telegram Bot API assistant-preview lane proof
A live Telegram Bot API proof was run on exact head
7541abe2753b58f3d0f53839f96f9bc926f42507with token/chat identifiers redacted. This proof targets the review concern that short opt-in assistant previews could stay invisible until final delivery.Timeline from the redacted proof log:
Observed result: with
streaming.progress.assistantPreviewenabled, the progress marker and assistant preview are separate visible messages, the short assistant preview no longer waits until final delivery, and cleanup removes the transient preview/marker so no stale preview remains.The screen-recording window for clipping the GIF is the 20:32 GMT+8 proof run.
Dedicated Telegram test bot recording proof
A second live proof was run with the dedicated Telegram test bot against the dedicated private test chat. The bot token and full chat id are stored only in local secret files and are not included in this PR.
Exact PR head:
7541abe2753b58f3d0f53839f96f9bc926f42507.Visible Telegram timeline from the dedicated test bot run:
Redacted Bot API log summary:
Observed result: in the dedicated Telegram test chat, the progress marker appears first, the short opt-in assistant preview appears as a separate message after the bounded delay, the final answer is sent separately, and transient proof messages are cleaned up. This is the screen-recording window intended for GIF clipping.
Public GIF / MP4 evidence assets
The dedicated Telegram test-bot screen-recording evidence has been clipped and hosted on the
snowzlmbot/openclawfork on an evidence-only branch, separate from this PR's code branch so the PR diff stays clean.Correction: the usable proof window is in the latter half of the operator recording. The hosted assets below use the corrected late-recording segment, not the earlier/incorrect first-half clip.
Stable evidence commit:
ad7e8c792476817dab2a56f789bb2125c5f0f40fRecommended GIF evidence:
Additional assets:
The clip shows the dedicated Telegram test bot sequence: progress placeholder first, short opt-in assistant preview after the bounded delay, final answer separately, then cleanup. The bot token and full chat id are not included in the hosted assets or PR text.
Rebase / CI scope note
After the timer proof update,
check-test-typeson #95522 failed on an upstreamscripts/control-ui-i18n.tsimport of./lib/windows-taskkill.mjsthat was included because the combined PR still had an older base SHA. I rebased #95522 onto latestmainso that upstream script change is no longer part of this PR diff. The post-rebase diff remains limited to Telegram/streaming/config/doc surfaces.Post-rebase validation on exact head
7541abe2753b58f3d0f53839f96f9bc926f42507:Result: config checks passed and 278 targeted tests passed.
Validation
Local targeted validation on this combined branch:
Result:
Risk / Review Notes
streaming.progress.assistantPreviewis enabled.