Repository navigation
fix(telegram): show progress before reply preparation - #178125
ChuLaiTheGreat wants to merge 13 commits into
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 real behavior proof before merge. What this changesAdds Telegram preparation feedback before reply resolution and memory checkpointing, suppressing the initial receipt only after a confirmed reaction. Example: A Telegram user enables progress commentary and sends “Summarize our conversation” before a required memory checkpoint.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open for its distinct preparation-visibility improvement; no actionable introduced defect was found, and the public callback needs an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherTelegram dispatch supplies channel feedback callbacks to core reply preparation, which sends nonterminal status through the existing progress preview and preserves final-delivery ownership. flowchart LR
A[Telegram message] --> B[Message context and reaction]
B --> C[Core reply dispatch]
C --> D[Reply preparation callback]
D --> E[Telegram progress preview]
C --> F[Memory checkpoint and model]
F --> G[Final delivery and preview cleanup]
Technical reviewBest possible solution: Keep preparation feedback in the existing dispatch, preflight, and preview owners under an explicitly accepted callback contract. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the missing preparation notification, and the contributor supplies red/green ordering results; no end-to-end reproduction was run during this read-only review. Is this the best way to solve the issue? The implementation reuses the existing preview and preserves maintenance, cancellation, and final-delivery ownership; the dedicated public callback remains an owner choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7ad64520b5a2. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +76, Tests +234. Total +310 across 11 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)Reviewed October 20, 2026, 6:06 AM ET / 10:06 UTC (Revision 3). |
|
@clawsweeper re-review Addressed the false native-acknowledgment finding in 305195a. The Telegram adapter now resolves the acknowledgment outcome only after the actual Bot API result; rejected reactions and unsupported emojis preserve the receipt. The public status-controller contract stays unchanged. The two rejected/unsupported HTTP cases fail on the old producer and pass on the repair. All 6 native HTTP cases and 4 focused preparation/policy/abort/preflight cases pass. The HTTP test uses the real context producer/controller and grammY against loopback HTTP, including same-message input and exact progress→final lifecycle. Also repaired the reported preflight type/AbortSignal fixture, denied-policy callback and HTTP database-worker registration. Core production types, focused format/non-type-aware lint and fresh independent review pass. The updated body records exact commands and remaining limits. Real Gateway/model/Telegram Test Server evidence still requires the team's authenticated Convex broker, and the canonical shared autoreview tool is unavailable here. Please have the channel SDK owner assess the additive onReplyPreparation callback; I am not claiming that owner decision. PR remains ready for review, with broader CI on the new head. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Revision 2 follow-up is ready at 511587c. The introduced package-boundary compiler failure is repaired using the existing SDK deferred primitive. The native package-boundary compile passes for Codex, Telegram and Slack; all 6 HTTP cases pass again. The central preparation-ordering tests now also fail natively on the pre-PR production files (2 expected failures), then all 4 preparation cases pass on the candidate. The prior production-type failure has been attributed rather than guessed: an isolated checkout of CI base 68603ba alone reproduces all 809 direct diagnostics, byte-identical to both PR jobs after root normalization. Upstream a2332ca adds the browser-importing test-support root. No DOM library, exclusion, guard or ignore change is used to conceal it. Commands and terminal excerpts are in the updated body. Channel/SDK maintainers: please decide whether to accept the narrow optional awaited onReplyPreparation callback with accepted/context phases. This is the specific owner decision requested by revision 2; I cannot supply that decision as an external contributor. The separate live Gateway/model/Telegram proof still needs the team's authenticated Convex QA broker. The readiness diagnostic found no usable authentication here. Could the team run the existing broker-backed fixture or provide access through its private credential channel? No live result is claimed. The PR remains open and ready for review. |
|
🦞👀 Re-review progress:
|
…"Plugin invocation scope is closed" (#196940) fix(subagents): deliver direct subagent announcements outside the finished turn's plugin scope A finished subagent's announcement started from the child's completed turn and kept that turn's plugin invocation scope, which is released when the turn ends. The channel target lookup and send then failed with "Plugin invocation scope is closed", so the result never reached the chat after its retries. sendSubagentAnnounceDirectly now runs inside pluginInvocationContext.exit, the same pattern as #196750 and #196700. ChuLaiTheGreat found this path in #171315 and #178125; #178125 carries the same fix inside a feature. Evidence: a built Gateway on node:24.22.1 in secretless Docker with a stand-in model and a stand-in Telegram Bot API recording every sendMessage, two runs each. On main a DM subagent result was never delivered and each run logged 4 "Plugin invocation scope is closed" errors. With this change it is delivered once with no scope errors. A normal reply, a group subagent completion, the provider-failure notice, a steered follow-up answered NO_REPLY and a session-targeted cron reply are each delivered once on both, and plugin-invocation-scope tests pass on both, so closed scopes still throw. The two QA Smoke scenarios from #196899 could not run locally because the QA Telegram transport fails before any scenario starts on main and this branch alike. Closes #196899. Thanks @amittell for the report and @ChuLaiTheGreat for finding the path. Co-authored-by: Ayaan Zaidi <[email protected]>
…"Plugin invocation scope is closed" (openclaw#196940) fix(subagents): deliver direct subagent announcements outside the finished turn's plugin scope A finished subagent's announcement started from the child's completed turn and kept that turn's plugin invocation scope, which is released when the turn ends. The channel target lookup and send then failed with "Plugin invocation scope is closed", so the result never reached the chat after its retries. sendSubagentAnnounceDirectly now runs inside pluginInvocationContext.exit, the same pattern as openclaw#196750 and openclaw#196700. ChuLaiTheGreat found this path in openclaw#171315 and openclaw#178125; openclaw#178125 carries the same fix inside a feature. Evidence: a built Gateway on node:24.22.1 in secretless Docker with a stand-in model and a stand-in Telegram Bot API recording every sendMessage, two runs each. On main a DM subagent result was never delivered and each run logged 4 "Plugin invocation scope is closed" errors. With this change it is delivered once with no scope errors. A normal reply, a group subagent completion, the provider-failure notice, a steered follow-up answered NO_REPLY and a session-targeted cron reply are each delivered once on both, and plugin-invocation-scope tests pass on both, so closed scopes still throw. The two QA Smoke scenarios from openclaw#196899 could not run locally because the QA Telegram transport fails before any scenario starts on main and this branch alike. Closes openclaw#196899. Thanks @amittell for the report and @ChuLaiTheGreat for finding the path. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #140380
What Problem This Solves
Telegram can remain silent while the reply resolver prepares history or a required memory checkpoint, even when progress commentary is enabled. Send a nonterminal receipt before resolver work and preparation feedback before the checkpoint through the existing preview owner.
User Impact
Opted-in users see preparation feedback independently of tool telemetry. Only a successfully applied native acknowledgment suppresses the initial receipt; rejected reactions and unavailable emojis retain it. Final delivery keeps its existing lifecycle: accept the final answer before removing the temporary card. Send-policy denial, aborts and commentary opt-outs retain their boundaries. No configuration, database or queue is added.
This is a current-main contribution of a downstream 2026.10.3 correction. It starts at dispatch-from-config, after Telegram's earlier context construction, and does not validate a downstream 2026.10.5 migration.
Implementation / Owner Decision
An optional awaited
onReplyPreparationcallback carriesacceptedandcontextthrough the existing dispatch and preflight owners. Dispatch revalidates authority after the new await; feedback failure does not replace the task result. Telegram observes the actual Bot API result through the existing SDK deferred primitive, rather than treating controller scheduling as success. No new public deferred helper or status-controller contract is introduced.Channel/SDK owner decision requested: accept this narrow optional preparation callback and its Telegram commentary consumer. The contributor does not claim that upstream approval.
Evidence
Current head:
a4d467dc45746ea1aa73f77163d626fabd5b4ca9, reconciled with main0182580ebf7e1436686791f263f49a5dae52df0a.The merge conflict is resolved by retaining the upstream subagent delivery owner and regression from #196940. Main now uses
runOutsideAdmittedGenerationScopes, which includes exiting the released plugin invocation scope. The duplicate local regression and its obsolete test-line allocation are removed; the upstream regression remains unchanged. The Telegram preparation callback, HTTP regressions, and current preparation-owner tests are preserved. The remaining preparation allocation is 151 lines (117 HTTP + 34 preparation regression lines), with no inherited-debt allowance or shared-baseline change.Validation for this reconciliation: TypeScript syntax parsing for 12 affected files, Node syntax checking for the test routing module, conflict-marker and whitespace checks, and source comparison with the exact upstream owner and regression. No fresh runtime tests, typecheck, lint suite, live Telegram acceptance, or full CI result is claimed for this head. Current PR CI and the Channel/SDK decision remain pending.
Historical evidence: full PR CI passed on
a83286992a6a5d451df1bd51de9b8938da7bf70cin run 42890389720, including all six QA smoke profiles, types, SDK boundaries, lint, and test budgets. Before the upstream incorporation, the closed-scope regression failed without the fix and all 111 delivery tests passed with it. Those results describe that old head only.Remaining Proof
The channel/SDK owner decision and live Telegram Test Server evidence remain outstanding. Synthetic HTTP/Gateway evidence does not establish live Telegram acceptance. No deployment, merge or release is included.
Historical evidence on 511587c (before upstream owner migration)
Current head:
511587cf101d6e3c14460ba7d90d11df633fc830.--mode=compileinvocation does not claim the negative canary. The introduced target-library failure was repaired by reusing the existing SDK primitive.git diff --checkand fresh independent source review pass. The canonical sharedautoreviewtool is unavailable and was not run.Focused commands:
Native terminal excerpts (
-texcludes unrelated cases; none were newly disabled):Earlier production-type failures were independently reproduced on CI base
68603baaalone: 809 direct diagnostics match both previous PR jobs after checkout-root normalization. Upstreama2332caeadded a browser-importing test-support root. No DOM library/exclusion/ignore workaround was added to this PR; the new full CI passes.Remaining Proof
Live Telegram Test Server evidence remains unexecuted. The exact-head Gateway/model control below uses a synthetic Bot API and does not replace that live proof. The canonical readiness doctor found no authenticated Convex QA broker launcher; no team lease, live send or model call was attempted. The team has been asked to run its broker-backed fixture or configure access privately. Loopback HTTP proof is not live Telegram proof, and it does not establish whole-Gateway restart/replay behavior.
Ready for review, with the live proof and owner decision stated explicitly. Only generic source and synthetic fixtures are published; no client runtime, accepted work, deployment, merge or release was changed or claimed.
Exact runtime follow-up — October 21
The unchanged head
511587cf101d6e3c14460ba7d90d11df633fc830now has its own successful nativeqaRuntimebuild in run 39621479405. Frozen dependencies, the complete selected runtime build, and both native build/postbuild stamps are verified; both stamps identify this head with clean inputs. The actual build container exited 0 with no OOM and no remaining PID. The finite hosted build removed its own source/dependency/cache payloads after exporting the candidate runtime. This is runtime preparation, not a full publishable-package build, deployment, or maintainer contract decision.The exact runtime and synthetic checkpoint trigger are prepared (details below). The actual preparation → required checkpoint → final delivery → preview cleanup scenario and the channel/SDK owner decision remain open.
Required-checkpoint fixture preparation — October 21
The unchanged head
511587cf101d6e3c14460ba7d90d11df633fc830now completes the missing disposable checkpoint setup through its built Gateway. All 58,115 tracked source blobs and both clean native build stamps were verified against that head. The native memory plugin is selected. Gateway RPCs read backmaxActiveTranscriptBytes=2048,memoryFlush.enabled=trueandmemoryFlush.forceFlushTranscriptBytes=1024, then create a distinct disposable session, inject a 4,960-byte synthetic transcript seed and read that seed back throughchat.history.The earlier session-creation rejection was a fixture setup failure. The passing secretless fixture uses the existing OAuth-route configuration with a synthetic bearer marker for local catalogue admission. Any later inference must use the separately authorized credential-resident Test relay. No real credential is present, no provider request is sent, and this does not prove provider sign-in or inference. Neither native auth guards nor PR source changed. The Gateway and container both exit 0 without OOM, and the finite validation cycle closes with its actual result.
Runtime and checkpoint-trigger preparation are complete; actual checkpoint execution and Telegram behavior remain unproven. The next required proof is preparation feedback → actual required memory checkpoint → final delivery → preview cleanup through the real model and Telegram path. Another active QA recipe currently owns the shared conversation lock; it was not interrupted. The separate channel/SDK owner decision remains outstanding. No client runtime changed and no earlier accepted scenario was replayed.
Native preflight and delivery lifecycle — 22 October
A fresh isolated check on unchanged head
511587cf101d6e3c14460ba7d90d11df633fc830now uses two actual native user/model seed turns, then a third turn requiring context maintenance. All 58,115 tracked source blobs and both clean build stamps match. The native adapter sends its receipt, edits that same receipt to preparation feedback before the memory checkpoint, runs the checkpoint to its nativeNO_REPLYterminal after a read tool call, obtains two completed compaction summaries, and feeds a nativecompactionSummarycontext into the final primary-model request. The final response is accepted before the temporary receipt is deleted. Eight selected-model requests complete with HTTP 200; no alternate model is forwarded.The scenario, both owned Gateway lifetimes, and Docker finish with exit 0, terminal PID 0 and no OOM; the container is removed. A separate post-final memory pass is cancelled by the owning Gateway during teardown and is not claimed as completed background persistence. No new durable-memory file write or memory-recall criterion is asserted. Bot API, actor identity and conversation state are synthetic: this proves the exact Gateway/model/preflight/adapter ordering, not live Telegram acceptance or downstream activation.
The earlier injected-history attempt remains partial: its visible lifecycle passed, but its memory calls were locally rejected before provider forwarding and compaction reported no real conversation to compact. Its green wrapper result was not treated as checkpoint acceptance. The new run fixes that setup with distinct native turns; it does not replay the old update or change contribution code, client runtimes, SDK approval, merge status or release state.