Repository navigation
test(agents): give the sibling-drain completion wait a tolerance on slow runners - #139176
Conversation
…low runners The lifecycle-end assertion in subagent-spawn.authority.test.ts waits on the registry completion chain (root-work admission plus SQLite persistence) with vi.waitFor's 1s default. Two-CPU hosted runners exceed that on the first it.each case, so every fork PR fails checks-node-compact-small-11 without touching this code. Use the 15s tolerance the sibling boundary test already applies to the same class of wait; the settled state asserted is unchanged.
|
🦞👀 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: blocked before merge. Reviewed September 5, 2026, 12:17 PM ET / 16:17 UTC. ClawSweeper reviewWhat this changesThe PR gives a subagent cancellation test 15 seconds to observe completed setup on slow runners while preserving its assertions. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, focused CI fix absent from current main. The supplied slow-runner evidence supports the change, and no introduced correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherSubagent lifecycle events pass through the registry completion owner before task status becomes durable. This test waits for that setup, then checks cancellation of newly discovered descendants while preserving an independently active parent session. flowchart TD
A[Lifecycle end event] --> B[Registry completion]
B --> C[Reply capture and persistence]
C --> D[Task marked succeeded]
D --> E[Bounded test wait]
E --> F[Sibling cancellation scenario]
F --> G[Cancellation and ownership assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 1 file. 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the real completion and cancellation coverage with a local bounded observation wait, without expanding global timeouts or mocking terminal state. Do we have a high-confidence way to reproduce the issue? Yes: the supplied two-CPU, two-worker invocation fails at the unchanged current-main assertion and passes after the patch. This read-only review did not execute it independently. Is this the best way to solve the issue? Yes: the wait observes asynchronous fixture readiness, and the patch preserves the actual cancellation invariants. A global timeout increase or mocked completion would change more than necessary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 707edba619a6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Integrate the previously tested main revision and fix two CI fixtures. Use the existing 15-second completion setup allowance from #139176, keeping the cancellation scenario and succeeded assertion unchanged. Give agent-end context fixtures the adjacent controlled-clock and turn-start readiness pattern while preserving all terminal assertions. No production code or dependency versions change in this follow-up.
|
Sanitized constrained-runner proof for exact head
The existing |
|
@clawsweeper re-review Please incorporate the sanitized direct AWS evidence in #139176 (comment) for unchanged head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Reviewed unchanged head The completion owner freezes the result before finalizing the task, and the lifecycle emitter does not await that asynchronous listener. This fixture disables reply retries, but its first completion still loads the capture runtime and reads the transcript. The one-second deadline came from Vitest, not a production latency contract. A local 15-second observation bound preserves this real path within the existing 120-second test budget. Mocking terminal state or supplying an empty terminal-reply snapshot would skip part of that path. ClawSweeper's remaining evidence items are resolved: I directly inspected installed Vitest 4.1.11 Validation: exact-head CI run 33974524559 is green, including changed tests and test types. The same unmodified setup failure appeared in runs 33979544632 and 33979419687. The contributor's constrained-runner before/after proof and Vincent Koc's independent sanitized AWS proof cover all six cases in their original order; the independent cold case took 6.686 seconds and the next case 0.605 seconds. Fresh independent Codex autoreview found no actionable P0–P2 findings. No contributor code was executed on the credentialed maintainer Mac, and no authenticated-provider behavior is claimed. Thanks to Yalçın Doksanbir (@ylcn91) for the fix and Vincent for the independent constrained-runner verification. The contributor branch and commit ancestry are preserved. |
|
Merged via squash.
|
* commit '3e4becea5e2ce38ede69e8ecf5302805ecbfc09c': refactor: simplify outbound message execution context (openclaw#139107) fix(models): keep ordinary chat selections session-scoped (openclaw#139232) docs: slim root agent instructions and clarify testing scope (openclaw#139236) test(agents): give the sibling-drain completion wait a tolerance on slow runners (openclaw#139176) refactor(workboard): use canonical queries for card-tree writes (openclaw#139106) fix(canvas): recognize versioned macOS nodes (openclaw#138958) fix: load GitHub connections without a default agent (openclaw#139222) fix(memory): explain unsafe legacy host-event path recovery (openclaw#139195) refactor(talk): centralize typed voice session queries (openclaw#139103) fix(cli): preserve command dispatch and structured errors (openclaw#139067) refactor(agents): consolidate reply failure summaries (openclaw#139175) fix(auth): keep an unset default model unchanged during login (openclaw#139218) perf(media): reuse validated attachment read handles (openclaw#139168) refactor(channels): simplify account configuration updates (openclaw#139096) refactor(android): remove unused updater export root (openclaw#139198) fix(gateway): stop admitting post-ready producers during close (openclaw#139092) fix(gateway): expose agent hook completion outcomes (openclaw#139155) fix(config): return the saved configuration after plugin install commits (openclaw#139203) fix(android): reduce repeated retries to unreachable gateways (openclaw#138732)
…annel (#138831) Closes #138540 ## What Problem This Solves Fixes an issue where users starting a Claude CLI turn from Telegram would receive no interactive question when the turn called `ask_user` through loopback MCP. The question existed in Gateway state, but the originating chat received only a working indicator and eventually a timeout explanation. ## Why This Change Was Made Gateway tool construction now uses the existing portable question publisher for the originating channel, account, and conversation. One shared question lifetime ends unfinished publication before cancellation or post-answer metadata work. The durable delivery owner retires its exact, still-unsent claim when cancellation arrives during adapter preparation. Preparation remains attached so its eventual resource token and queued media receive normal cleanup. Dispatched, sent, ambiguous, expired-lease, and replacement-owned deliveries retain their existing settlement rules. ## User Impact Users receive the question and its choices in Telegram, answer with native controls or the existing text-answer path, and continue the original tool call. Ended questions cannot later publish or replay a proven-unsent prompt. Credential requests retain the existing Control UI link, native-only, and missing-public-link guidance. ## Evidence Reviewed head: `00338b642990bb5c65fa514f231606031dcf5bad`. Live product proof was run on `8034bbbe5bfca7274fcd9b8f6956cac33e8d6a67` and is retained under the unchanged-owner assessment below. - **Real baseline:** current main `d0137988844d201423fbe1918e8c5acef8ddfa8e`, Telegram Test Server user → Gateway → Claude CLI → `mcp__openclaw__ask_user`. Gateway listed the destination question as pending. Telegram received no question during the tool wait; the CLI eventually returned a timeout. The initial raw observer needed device identity; the canonical Gateway client captured the pending record during the same run. The observation-command failure and all earlier setup results are retained separately from product evidence. - **Real candidate:** the same entry path delivered one question with Staging and Production buttons. The user clicked Production. The same question changed to “Answered: Production,” and Claude confirmed Production after the tool returned the answer. Recording completed successfully, including the Gateway observer and native callback action. - **Supported-entrypoint cancellation / SDK hardening:** the same installed-plugin fixture ran through native Gateway `agent` → real Claude CLI → loopback `ask_user`. It held the public channel adapter's preparation callback, cancelled the actual question through `question.resolve`, invoked published SDK recovery while held and after release, then submitted a fresh authorized request in the same session. Intake `45e8624bbe03` replayed the cancelled question after preparation returned. Candidate `8034bbbe5bfc` produced no stale send or recovery candidate, released the late resource once, and delivered “Proceeding with destination Alpha.” The native transcript confirms cancellation returned to the original MCP tool-use ID. This uses published package exports and an installed synthetic transport, with no internal source imports; physical Telegram behavior remains covered by the two retained real Telegram runs. - **Regression proof:** the original contributor head failed both a held-metadata publication test and a held-adapter queue-retirement test. The repaired head passes both. Recovery while preparation remains held makes no send; late preparation releases its token once. Restored media, replacement claims, sent/ambiguous outcomes, and lease failure retain coverage. - **Pinned base refresh:** merged upstream `886aaa689076b7b7c2f7a4d8d0048e89f5855698`, which contains #139176's correction to the exact failing CI assertion. The question, cancellation, delivery queue, Telegram and Claude CLI owners remain byte-identical to the live-tested head; dependencies and build inputs are unchanged. Adjacent startup/session changes were inspected, and 192 focused tests passed on the refreshed source, including the corrected spawn case, loopback delivery, CLI parsing and session-cache behavior. No Telegram setup or unchanged acceptance was repeated; earlier failures and build identities remain preserved. - **Focused checks:** 194 tests passed across question tools, native harness questions, outbound queues/leases, Gateway tool resolution, loopback MCP authority, and Telegram question handling. Formatting with pinned oxfmt 0.65.0 and syntax lint pass. Type-aware lint exceeded the isolated proof resource limit; hosted exact-head CI remains required before landing. - **Independent acceptance:** all six prewritten contract clauses passed. The validator authored a different Amber/Cobalt decision, submitted it through a prepared Telegram lease, clicked Cobalt, and verified the exact tool result and matching confirmation. It also judged 20 lifetime/recovery cases from 640 raw observations; diagnostic transport and synthetic-secret limits are retained. Commands: ```sh node scripts/run-vitest.mjs src/agents/tools/secrets-tool.test.ts src/agents/tools/ask-user-tool.test.ts src/agents/tools/ask-user-tool-normalization.test.ts src/agents/harness/gateway-question.test.ts src/agents/tools/question-prompt-send.test.ts node scripts/run-vitest.mjs src/infra/outbound/deliver-queue.cancellation-integration.test.ts src/infra/outbound/deliver-queue.lease-integration.test.ts src/infra/outbound/deliver.queue-integration.test.ts node scripts/run-vitest.mjs src/gateway/tool-resolution.exclude.test.ts test/loopback-ask-user-telegram-channel.test.ts src/gateway/mcp-http.question-authority.test.ts test/telegram-question-gateway.test.ts ``` The lifetime observation interface uses production question/delivery/queue/recovery owners with an explicitly synthetic adapter. It includes the real question-manager expiry timer and actual harness answer/cancel paths. Some Gateway terminal inputs remain supplied by the fixture. It complements the real Telegram/Claude flow; it does not claim physical native-app clicks, real secret storage, or a second replacement ingress run. Production delta: +293/-84 (+209). The added behavior is the missing loopback publisher and immediate claim-fenced cancellation with delayed resource cleanup; neither existed at those owner boundaries. The schema moved unchanged beside input normalization, and duplicate publication-abort and durable-outcome branches were removed. Test delta: +1060/-63, including moved normalization coverage. The five retained ClawSweeper moves are addressed by canonical outbound abort checks, immediate credential publication closure, atomic unsent-custody retirement, preserved credential guidance, and owner/sibling regression proof. Separate observed follow-up: Claude CLI ended a 120-second Gateway question call after approximately 60 seconds. Aligning that client deadline with question lifetime is outside this repair's timeout scope. Original repair by @ericcaiwx-star; reported by @drsnett. Maintainer repair and validation are AI-assisted. The original [CI failure](https://github.com/openclaw/openclaw/actions/runs/33980427913) remains recorded. This refresh adopts the merged correction to that assertion and requires normal exact-head CI; no historical-causality claim or CI bypass is used. Additional observed follow-up: startup logs a duplicate `/dashboard` command registration. The question workflow completed; the warning is not attributed to this change. Co-authored-by: Cursor <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Merge the canonical main fix for the unrelated subagent authority fixture so fork CI can validate the heartbeat repair. Preserve the existing heartbeat implementation, regression tests, documentation and contributor ancestry without changing the assertions in the shared fixture. Related: openclaw#139176
Merge the main commit containing openclaw#139176 after the fork CI reproduction hit its known cold-runner timing failure. Preserve contributor ancestry and the reviewed rate-limit auth-catalog repair unchanged. Co-authored-by: Grynn <[email protected]>
…low runners (openclaw#139176) The lifecycle-end assertion in subagent-spawn.authority.test.ts waits on the registry completion chain (root-work admission plus SQLite persistence) with vi.waitFor's 1s default. Two-CPU hosted runners exceed that on the first it.each case, so every fork PR fails checks-node-compact-small-11 without touching this code. Use the 15s tolerance the sibling boundary test already applies to the same class of wait; the settled state asserted is unchanged.
…annel (openclaw#138831) Closes openclaw#138540 ## What Problem This Solves Fixes an issue where users starting a Claude CLI turn from Telegram would receive no interactive question when the turn called `ask_user` through loopback MCP. The question existed in Gateway state, but the originating chat received only a working indicator and eventually a timeout explanation. ## Why This Change Was Made Gateway tool construction now uses the existing portable question publisher for the originating channel, account, and conversation. One shared question lifetime ends unfinished publication before cancellation or post-answer metadata work. The durable delivery owner retires its exact, still-unsent claim when cancellation arrives during adapter preparation. Preparation remains attached so its eventual resource token and queued media receive normal cleanup. Dispatched, sent, ambiguous, expired-lease, and replacement-owned deliveries retain their existing settlement rules. ## User Impact Users receive the question and its choices in Telegram, answer with native controls or the existing text-answer path, and continue the original tool call. Ended questions cannot later publish or replay a proven-unsent prompt. Credential requests retain the existing Control UI link, native-only, and missing-public-link guidance. ## Evidence Reviewed head: `00338b642990bb5c65fa514f231606031dcf5bad`. Live product proof was run on `8034bbbe5bfca7274fcd9b8f6956cac33e8d6a67` and is retained under the unchanged-owner assessment below. - **Real baseline:** current main `f27b38941fb37ae5525b8d11d0af9d9025945caf`, Telegram Test Server user → Gateway → Claude CLI → `mcp__openclaw__ask_user`. Gateway listed the destination question as pending. Telegram received no question during the tool wait; the CLI eventually returned a timeout. The initial raw observer needed device identity; the canonical Gateway client captured the pending record during the same run. The observation-command failure and all earlier setup results are retained separately from product evidence. - **Real candidate:** the same entry path delivered one question with Staging and Production buttons. The user clicked Production. The same question changed to “Answered: Production,” and Claude confirmed Production after the tool returned the answer. Recording completed successfully, including the Gateway observer and native callback action. - **Supported-entrypoint cancellation / SDK hardening:** the same installed-plugin fixture ran through native Gateway `agent` → real Claude CLI → loopback `ask_user`. It held the public channel adapter's preparation callback, cancelled the actual question through `question.resolve`, invoked published SDK recovery while held and after release, then submitted a fresh authorized request in the same session. Intake `45e8624bbe03` replayed the cancelled question after preparation returned. Candidate `8034bbbe5bfc` produced no stale send or recovery candidate, released the late resource once, and delivered “Proceeding with destination Alpha.” The native transcript confirms cancellation returned to the original MCP tool-use ID. This uses published package exports and an installed synthetic transport, with no internal source imports; physical Telegram behavior remains covered by the two retained real Telegram runs. - **Regression proof:** the original contributor head failed both a held-metadata publication test and a held-adapter queue-retirement test. The repaired head passes both. Recovery while preparation remains held makes no send; late preparation releases its token once. Restored media, replacement claims, sent/ambiguous outcomes, and lease failure retain coverage. - **Pinned base refresh:** merged upstream `f6bab53d48b5cdea7e1eb33d6c2988a086e4aa5c`, which contains openclaw#139176's correction to the exact failing CI assertion. The question, cancellation, delivery queue, Telegram and Claude CLI owners remain byte-identical to the live-tested head; dependencies and build inputs are unchanged. Adjacent startup/session changes were inspected, and 192 focused tests passed on the refreshed source, including the corrected spawn case, loopback delivery, CLI parsing and session-cache behavior. No Telegram setup or unchanged acceptance was repeated; earlier failures and build identities remain preserved. - **Focused checks:** 194 tests passed across question tools, native harness questions, outbound queues/leases, Gateway tool resolution, loopback MCP authority, and Telegram question handling. Formatting with pinned oxfmt 0.65.0 and syntax lint pass. Type-aware lint exceeded the isolated proof resource limit; hosted exact-head CI remains required before landing. - **Independent acceptance:** all six prewritten contract clauses passed. The validator authored a different Amber/Cobalt decision, submitted it through a prepared Telegram lease, clicked Cobalt, and verified the exact tool result and matching confirmation. It also judged 20 lifetime/recovery cases from 640 raw observations; diagnostic transport and synthetic-secret limits are retained. Commands: ```sh node scripts/run-vitest.mjs src/agents/tools/secrets-tool.test.ts src/agents/tools/ask-user-tool.test.ts src/agents/tools/ask-user-tool-normalization.test.ts src/agents/harness/gateway-question.test.ts src/agents/tools/question-prompt-send.test.ts node scripts/run-vitest.mjs src/infra/outbound/deliver-queue.cancellation-integration.test.ts src/infra/outbound/deliver-queue.lease-integration.test.ts src/infra/outbound/deliver.queue-integration.test.ts node scripts/run-vitest.mjs src/gateway/tool-resolution.exclude.test.ts test/loopback-ask-user-telegram-channel.test.ts src/gateway/mcp-http.question-authority.test.ts test/telegram-question-gateway.test.ts ``` The lifetime observation interface uses production question/delivery/queue/recovery owners with an explicitly synthetic adapter. It includes the real question-manager expiry timer and actual harness answer/cancel paths. Some Gateway terminal inputs remain supplied by the fixture. It complements the real Telegram/Claude flow; it does not claim physical native-app clicks, real secret storage, or a second replacement ingress run. Production delta: +293/-84 (+209). The added behavior is the missing loopback publisher and immediate claim-fenced cancellation with delayed resource cleanup; neither existed at those owner boundaries. The schema moved unchanged beside input normalization, and duplicate publication-abort and durable-outcome branches were removed. Test delta: +1060/-63, including moved normalization coverage. The five retained ClawSweeper moves are addressed by canonical outbound abort checks, immediate credential publication closure, atomic unsent-custody retirement, preserved credential guidance, and owner/sibling regression proof. Separate observed follow-up: Claude CLI ended a 120-second Gateway question call after approximately 60 seconds. Aligning that client deadline with question lifetime is outside this repair's timeout scope. Original repair by @ericcaiwx-star; reported by @drsnett. Maintainer repair and validation are AI-assisted. The original [CI failure](https://github.com/openclaw/openclaw/actions/runs/33980427913) remains recorded. This refresh adopts the merged correction to that assertion and requires normal exact-head CI; no historical-causality claim or CI bypass is used. Additional observed follow-up: startup logs a duplicate `/dashboard` command registration. The question workflow completed; the warning is not attributed to this change. Co-authored-by: Cursor <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
src/agents/subagents/spawn/subagent-spawn.authority.test.tsfails on every fork pull request today in thechecks-node-compact-small-11shard (agentic-agents-core-isolated), which turnsopenclaw/ci-gatered for unrelated changes:The same shard passes on
mainand on repository-branch PRs. Fork PRs run this shard on two-CPU hosted runners, where the lifecycle-end completion chain (completeSubagentRunWithRecoveryunderrunWithGatewayIndependentRootWorkContinuation, thensafeFinalizeSubagentTaskRunand SQLite persistence) takes longer than the 1 s defaultvi.waitFortimeout on the firstit.eachcase. The nested-sibling case that runs second passes in about 1.5 s.Introduced by #138910 (the lifecycle-end emission plus the default-timeout
vi.waitForassertion); #138059 moved the file into the isolated shard. Maintainer analysis reproducing the failure on the parent commit without any PR code: #139089 (comment)Why This Change Was Made
The assertion waits on real asynchronous work owned by the registry completion runtime, so the bound is a tolerance on a timing-dependent value, not a contract. The sibling boundary test already uses the same tolerance for the same class of wait (
subagent-spawn.production-boundary.test.ts:274,{ timeout: 15_000 }). The assertion itself is unchanged: the task must still settle tosucceeded.User Impact
CI only. No runtime behavior changes. Fork pull requests stop failing
checks-node-compact-small-11andopenclaw/ci-gateon an assertion unrelated to their change, and maintainers stop needinglandpr-approve-unrelated-redfor this shard.Evidence
Fork PR runs from 2026-09-05 with the identical failure, all on heads that do not touch this test or the registry:
mainruns 33969885902, 33970296274, 33970630278, and 33971109206 passed the shard.Local reproduction on a 16-core host pinned to two CPUs with two workers, before the change (same file, same assertion, same shard runner):
Same command after the change, on
114ceb86(this PR head), same host, same two-CPU pin and two workers; the first case now waits about 12 s for the completion chain, the second settles in about 1.2 s, and the file passes:The 12 s on the first case is dominated by lazy runtime loading on a cold worker (the run reports 23.6 s of import time across the file); the second case, on the warm worker, settles in about 1.2 s. The 15 s tolerance sits under the 120 s per-test budget (
test/vitest/vitest.timeouts.ts,DEFAULT_VITEST_TEST_TIMEOUT_MS). The exact-head CI run for this PR passed the selected lanes.Formatting:
node_modules/.bin/oxfmt --check src/agents/subagents/spawn/subagent-spawn.authority.test.tspasses. Test-only change; no production LOC.