Repository navigation
fix(agents): show activity while yielded parents resume - #160039
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 28, 2026, 12:34 PM ET / 16:34 UTC (Revision 13). ClawSweeper reviewWhat this changesThe branch starts guarded channel typing when a yielded top-level parent begins its continuation, uses the configured refresh cadence, and adds lifecycle tests and documentation. Merge readiness✅ Ready for maintainer review Current main still lacks typing activity when a yielded parent resumes. The branch addresses that gap, and the available client trace and source review support keeping it as a useful landing candidate. Priority: P2 Review scores
Verification
How this fits togetherSubagent settlement resumes a parent after child results arrive and dispatches a Gateway agent turn. The Gateway typing manager sends temporary channel activity while the turn's existing delivery path handles the final reply. flowchart TD
A[Child results] --> B[Settlement handoff]
B --> C{Public parent?}
C -->|Yes| D[Gateway turn starts]
C -->|No| H[No channel activity]
D --> E[Typing manager]
E --> F[Channel activity]
D --> G[Final reply]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +38, Tests +118, Docs +10. Total +166 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep resumed-parent activity tied to the current public delivery owner and configured typing cadence, with final replies remaining under the existing turn delivery path. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main dispatches the resumed parent without this typing handoff, and the contributor reports pre-fix cases with zero adapter calls. This review did not execute the baseline. Is this the best way to solve the issue? Yes. The branch uses the existing Gateway typing manager and shared cadence resolver, while limiting the new caller to an executing, publicly delivered parent. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad7669535c37. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The PR body now includes independent P0–P3 autoreview and fresh secretless proof on the unchanged head 6d44393: 30 direct-delivery tests, 20 sibling tests, and two held-getChat HTTP cases all passed. Please reassess the reported lookup-to-send authority race against the production client, not an injected bare api. The Telegram heartbeat forwards the callback without opts.api; send-context.ts installs the guard as a grammY transformer inside the account limiter, immediately before HTTP. The held-getChat probe used that real client: a current source sent typing; a source revoked while getChat was held threw the expected authority error and sent zero sendChatAction requests. No production code change was necessary. The body links the exact source and records timings, test-audit/deslop results, and proof limits. This is loopback HTTP boundary evidence, not a live Telegram Test Server/client-rendering claim. The PR changes the announcement-to-existing-manager handoff, not the Telegram adapter or API. Exact-head CI remains under observation. |
|
🦞👀 Re-review progress:
|
Reuse the existing typing interval resolver for recovery-owned activity, preserving the documented six-second default and configured cadence. Cover default and nondefault scheduling through the existing lifecycle test. Include the exact already-landed upstream lint repair from 2e95cdb (openclaw#160159), by Peter Steinberger, so the older branch can pass its full preparation gate without a fork-wide merge or lint suppression. Both UI files match the canonical blobs; existing attachment behavior is unchanged. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: VACInc <[email protected]>
|
@clawsweeper explain Revision 6 on f6afa55 accepts the cadence repair and reports no code/security findings. Please clarify the remaining mandatory Telegram-client screenshot checklist against the current repository proof contract:
Is there a specific uncovered transport contract that makes live client capture mandatory here, rather than the generic screenshot policy? No live Test Server or client-rendering pass is claimed. CI currently has real failing jobs under investigation, so this clarification is not a request to merge or ignore CI. |
|
🦞👀
|
|
@clawsweeper re-review Current head: f6afa55. The PR body now records a fresh Telegram Test Server user-client trace through the actual DM ingress, isolated Gateway, accepted child spawn, yielded parent, resumed parent, observed typing refreshes, and final bot reply. It gives redacted relative times and states the remaining GUI screenshot gap plainly. No code or security findings were present in revision 7. Please reassess the live-behavior checklist against this new evidence. Current-head CI is still red and under investigation; this request does not claim merge readiness. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Head Focused validation on the new head: recovery typing 14/14, direct delivery 30/30, Telegram admission 50/50, Control UI chat lifecycle 16/16, and both named Gateway failure cases passed. |
|
🦞👀 Re-review progress:
|
|
Head @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
) * fix(agents): show activity while yielded parents resume * fix(agents): honor resumed typing cadence Reuse the existing typing interval resolver for recovery-owned activity, preserving the documented six-second default and configured cadence. Cover default and nondefault scheduling through the existing lifecycle test. Include the exact already-landed upstream lint repair from 87b7350 (openclaw#160159), by Peter Steinberger, so the older branch can pass its full preparation gate without a fork-wide merge or lint suppression. Both UI files match the canonical blobs; existing attachment behavior is unchanged. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: VACInc <[email protected]> Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes missing channel activity when a top-level parent resumes after
sessions_yield, leaving the chat looking idle while the continuation works.User Impact
Supported channels show typing once the resumed parent starts executing, using the configured refresh cadence. Queued admission, private completions, and nested children do not signal external activity. Typing opt-outs, time limits, final delivery, and message-queue settings remain unchanged. This restores the activity indicator, not individual tool-progress bubbles.
Why This Change Was Made
The original inbound dispatcher ends at yield, so the settlement continuation now passes its resolved public route to the existing Gateway typing manager. It starts from the execution-start notification, keeps source/cancellation/Gateway checks live, and stops during cleanup.
Maintainer review also caught the manager falling back to a fixed three-second refresh. It now reuses the existing reply-typing interval resolver, honoring
agents.defaults.typingIntervalSecondsand the documented six-second default. No new configuration, state store, timer implementation, or delivery owner is added. Retired per-agent/session cadence keys are not restored.Original implementation by @VACInc; the correction retains that ancestry and co-author credit. The earlier cadence commit credits Peter Steinberger’s canonical lint extraction from #160159. A later merge of pinned main
316f2ea6d5c4resolves an actual import conflict with the subsequently landed attachment-menu extraction. The attachment UI now exactly matches that main snapshot; no PR-specific UI change remains.Evidence
Published and read back on this PR:
94c326897f27d0acca1a27e3154903d66c291ce0. A clean merge of main includes the upstream Telegram admission-fixture repair36030c6156band the backing-session-id test fix from #160479, main commitd2c789bfb4b4de9d23f9bd888ae30fb55ae42605. All seven PR feature files still have the exact same bytes as the reviewedf6afa55a38b3a7d70ccc48f68289c98f5b008d8ehead. Prior-head CI finished red in four test jobs andopenclaw/ci-gate; new-head CI is pending. ClawSweeper revision 9 found no actionable code or security finding and marked the priora1f18614cb0fd1cf2b24f48e0dd854577f2c0ce9head ready for maintainer review. Re-review is requested for this merge head. The live Test Server client proof predates both merges, as detailed below.chat.sendbacking-session-id case waiting foragent.waitwith a one-second helper deadline; provider-settings catalog startup at 90 seconds; and a UI Stop-button detach wait at 30 seconds. All four failing test files were byte-identical to prior main316f2ea6. Current main independently fixed the Telegram fixture by feeding the same JSON update throughbot.handleUpdate, avoiding a webhook deadline around cold worker setup; that exact upstream fix is in this merge. The backing-session-id case is now fixed byd2c789bfb4bon main; the prior provider-settings and UI Stop cases have no established root-cause fix. No CI rerun, timeout increase, skipped assertion, or passing-run substitution was used.pnpm test src/gateway/agent-turn/recovery-typing.test.ts src/agents/subagents/announce/subagent-announce-direct-delivery.test.ts --maxWorkers=1passed both files: 14/14 recovery-typing and 30/30 direct-delivery cases, 52.22 seconds total wall time.git diff --check HEAD^1 HEADpassed. No PR feature-file bytes changed in this merge.checks-node-changed-compact-large-8first timed out at 120 seconds in the existingkeeps deferred owner release retries from retaining a successorcase. That fixture advances a fake clock by 100 ms before asynchronous SQLite worker I/O is guaranteed to schedule each retry delay; the successor can then wait on a timer the clock has already passed. Later cases in the same file reported retry counts of two instead of one, consistent with fallout after the first timed-out case left fake timers active. The test file is byte-identical to main, and this PR changes no recovery admission or retry implementation: itssrc/auto-reply/reply/typing.tsdelta only exports the existing interval resolver. The focused first case and the complete 11-case file passed locally before any test edit, which does not prove a fix. PR causation was not established; no test or production change for this failure was pushed.checks-ui-e2e-real-gateway (2/2)timed out clicking Send after a cold-start draft vanished and the composer stayed disabled;checks-node-changed-compact-small-1timed out at 45 seconds in the unchanged Doctor → Gateway readiness process case. These existing test paths have no demonstrated PR causation. The UI case passed a private one-case real-Gateway local check (57.5-second test body) after a readiness wait was tried locally, but that trial is not part of this PR and does not clear its prior-head CI red. No timeout, assertion, retry, or CI setting was changed in this PR.checks-node-changed-compact-large-24failed the backing-session-idchat.sendcase because its one-secondagent.waithelper returnedtimeout. #160479 merged to main asd2c789bfb4b4de9d23f9bd888ae30fb55ae42605and waits for the chat run to complete deterministically before checkingagent.wait. This exact main commit is included in94c326897f27d0acca1a27e3154903d66c291ce0. No separate fix was made in this PR.f6afa55ahead: A fresh isolated Gateway running that built code, a mock OpenAI provider, and a Convex-leased TDLib user client exercised the actual DM ingress and bot delivery path. The parent calledsessions_spawn(accepted), thensessions_yield(yielded). The child completed after a controlled 20-second provider delay. The resumed parent received that completion and spent another controlled 15 seconds in its provider request. The TDLib client recordedchatActionTypingat 24.991 seconds, refreshes at 31.102 and 37.273 seconds, then the final reply at 40.031 seconds. It also recorded the working message and no parent completion before the resumed typing. The recorder completed, six provider requests were observed, and the isolated Gateway and mock listener shut down. These are redacted relative times; no user, bot, chat, credential, or private log data is published. This is observed Test Server client behavior, not a Telegram GUI screenshot or production deployment. The feature files are byte-identical on the merged head, but this live run predates the merge.pnpm checkpassed on the pre-conflict cadence candidate6e9a747e, including the repaired inherited lint failure. New-head scoped revalidation is recorded below; these older full checks are not described as a new-head full-suite pass. The full Testbox run ended without completing: the remote command returned exit -1 after 1 h 48 m, and cleanup reported proxy authentication failure. No full-suite success receipt exists. Completed shard summaries are partial coverage, not a full-suite pass; the original head’s green CI is historical only. No tests, assertions, or checks were disabled.6e9a747e; the only manual resolution keeps the exact current-main attachment file after its import moved. On the refreshed dependencies, 155 typing/reply/announcement tests passed in 79.48 s combined wall time; 23 attachment/input tests passed in 9.04 s; targeted lint reported zero warnings/errors. The committed tree equals this tested tree. Existing independent review is retained for unchanged code rather than repeated for a mechanical merge.pnpm test src/gateway/agent-turn/recovery-typing.test.ts --maxWorkers=1pnpm test src/agents/subagents/announce/subagent-announce-direct-delivery.test.ts --maxWorkers=1pnpm test src/auto-reply/reply/typing-persistence.test.ts src/auto-reply/reply/reply-utils.test.ts --maxWorkers=1The changed files’ test bodies remain below one second. The direct-delivery run spent 91% of its 25.11-second Vitest duration transforming code. Prior-head CI failures and available case timings are recorded above; new-head CI is not yet a success claim. Formatting and
git diff --checkpassed.Limits: no Telegram GUI screenshot, deployment, or production restart is claimed. The Test Server proof uses a controlled provider delay; its live transport and user-client observations are described above.
Resolved Telegram authority finding and earlier proof
ClawSweeper revision 3 accepted the evidence that the production heartbeat uses a guarded client rather than an injected bare API. The API-context owner checks live authority inside the account limiter immediately before HTTP; transport authority also guards retries.
A disposable probe on the original head used real grammY and the existing loopback HTTP fixture, with no injected API or mocked send implementation. It held the actual
getChatresponse, changed source authority, and released the response:Those transport inputs are unchanged by the cadence repair. This is actual-client loopback HTTP proof, not live Telegram proof. Original-head secretless AWS verification also passed 30 direct-delivery and 20 sibling cases; its lease was released. The original author recorded the three positive announcement regressions failing before the original production patch with zero adapter calls.
Initial fixture expansion held its own recovery reader; releasing that reader before joining fixed the fixture. An initial unsupported Node 25 install was replaced with Node 24, and four missing test braces were corrected before lint passed.
Inherited and unrelated CI failures on the landed head
check-source-contracts(lint:tmp:export-name-collisions):maincarried duplicatesrc/cli/daemon-cli.tsexports when this run started; fixed onmainby 385ac28. This PR does not touchsrc/cli.checks-node-changed-compact-large-32:src/gateway/server-startup-workspace-readiness.test.tsworkspace-path equality assertion. File not touched by this PR; passes 3/3 locally on this head (node scripts/run-vitest.mjs <file> --maxWorkers=1, 27s/24s/22s).checks-node-changed-compact-large-40:src/gateway/server.catalog-startup.test.ts90s test timeout. File not touched by this PR; same timeout hit fix: deliver final replies after unrelated plugin reloads #160009 on an unrelated diff. Passes 3/3 locally on this head (85s cold, 40s, 41s).Landed through the admin exception per the pre-existing-red policy.