Skip to content

fix: orphan-recovery restart test flakes when the retry timer has not been scheduled yet - #162126

Open
azuretek wants to merge 70 commits into
openclaw:mainfrom
azuretek:fix/subagent-orphan-retry-timer
Open

azuretek wants to merge 70 commits into
openclaw:mainfrom
azuretek:fix/subagent-orphan-retry-timer

Conversation

@azuretek

Copy link
Copy Markdown
Contributor

Fixes #162125

What Problem This Solves

Fixes: src/agents/subagents/registry/subagent-orphan-recovery.restart-integration.test.ts flakes on the compact-large Node shards, reddening unrelated pull requests whose diff never touches the file. The reported assertion is:

AssertionError: expected 0 to be greater than 0

User Impact

No user-visible change; the behavior under test and its assertion are kept. The impact is on contributors and maintainers: a flaky restart-integration test currently fails unrelated pull requests, so a red compact-large shard can no longer be read as a statement about the PR under test.

Why This Change Was Made

The retired wait retry case installed fake timers, rejected the in-flight wait with a gateway timeout, then asserted the retry timer existed:

oldWait.reject(new Error("gateway request timeout"));
await vi.advanceTimersByTimeAsync(0);
expect(vi.getTimerCount()).toBeGreaterThan(0);

The retry timer is scheduled only inside scheduleWaitRetry in src/agents/subagents/registry/subagent-registry-run-wait.ts, reached after the wait's rejection travels through the recovery path's asynchronous Gateway worker reads (resolveSubagentSessionStartedAt, then resolveSubagentSessionCompletion). A single 0ms advance can inspect the timer queue before that path reaches the scheduling call, so on a loaded runner the count is still 0: the wait measured host scheduling rather than the behavior under test.

The change drains the recovery path until the retry timer is present, bounded, instead of assuming one 0ms advance is enough. The assertion and the behavior under test are unchanged.

Relationship to CONTRIBUTING

CONTRIBUTING asks contributors not to open test-only PRs for failures already red on main CI. This change is test-only and is stated as such: it removes a live flake signature that reddens unrelated pull requests (the same file already failed as compact-large-31 on a different head). Direct pushes to main are not available for this contribution, so the fix is proposed here as a PR.

Evidence

The focused file has not been run locally: this environment has no reachable Linux test host. The changed-lane CI job selects this file, so the PR's own compact-large run is the proof. The signature being removed is expected 0 to be greater than 0 at src/agents/subagents/registry/subagent-orphan-recovery.restart-integration.test.ts:333.

steipete and others added 30 commits September 28, 2026 20:44
Version alignment, 2026.9.7 changelog, contribution record, and changelog index for the final re-cut at 8426973.
…t fixtures) (openclaw#160975)

Keep the state read worker out of the update write graph (7c4cae3; worker 52.2 MB -> 3.5 MB, Kova RSS regression from openclaw#160592). Cherry-picked 66b9c5b and 129a640 (-x) and openclaw#160948 (05ecebf) test fixes.
…ession (openclaw#160998)

Pass the durable runSessionKey to image/video/music tools so shared-main channel sessions detach media generation again (regression from openclaw#159179), and wait for the terminal image task state in the image-generation-lifecycle e2e.
…law#161034)

Media task ownership stays on the chat policy key while detach uses the durable session (3f50e4c); spawn production-boundary fixture awaits completion roots (9749ebd); absent-Gateway status e2e fixtures stay unreachable (622ec63).
…ork (openclaw#161038)

Cherry-pick of 4c61161 (openclaw#160987) for the 2026.9.7 release batch.

Co-authored-by: Gio Della-Libera <[email protected]>
Candidate admission preserves SQLite artifacts (0a3a4083); gateway agent yielded-orchestrator, agent-chat shard, and first-hop harness fixes; cherry-picks 4d8c9bd and c086fe6; live/e2e skips under the release lead waiver decision.
…law#161143)

Release lead decision under Peter's 2026-09-29 waiver authorization: skip timeout-recovery child completion (openclaw#161139), memory dreaming provenance (openclaw#161140), runreplyagent onAdopted after restart recovery (openclaw#161141, possible registry race).
…penclaw#161177)

Fixture race behind openclaw#161141: the aborted-restart case deleted its database before async recovery-owner release re-registered it. Join successor-admission barriers and close fixture databases before deletion; re-enable the two runreplyagent cases skipped for 2026.9.7.
…nclaw#161203)

Preserve per-agent database artifacts during candidate update admission by using the WAL-aware private snapshot when preserveSourceArtifacts is set; skip the experience-review live OpenAI eval for 2026.9.7 (openclaw#161199) under the release lead waiver decision.
…test (openclaw#161348)

The captures test counted every worker_threads Worker, including the shared SQLite broker when co-located with other catalog-worker integration files; use the fixture catalog-only tracker and keep the exactly-one-catalog-worker assertion (openclaw#161347).
Since openclaw#160224 the root package depends on npm, whose v3 lock lists bundled packages under node_modules/npm/node_modules/* with inBundle and no resolved/integrity. The dependency release evidence job rejected them as unsupported lock entries. Bundled entries are now accepted only when their nearest non-bundled carrier has a verified registry tarball, and each report entry records them as bundledDependencies with that parent. Ordinary entries without resolved/integrity stay fatal.

(cherry picked from commit 1470a9b)
Wait for checked taskkill /T /F completion and updater close before accepting
an upgrade timeout. Refuse direct installation when tree cleanup is unverified.
Retry only EPERM/EBUSY package-directory removal, with five logged backoffs
covering 15.5 seconds, and preserve persistent failures in lane evidence.

Derive packaged-update budgets from the measured baseline installation:
1.5x per step, bounded to 10-20 minutes, with two steps plus two minutes for
the wrapper. A 677-second baseline gets 1016-second steps and a 2152-second
wrapper. Record the measurement and budgets alongside existing phase evidence.

Allow only Windows packaged-upgrade CI jobs 180 minutes: two existing
45-minute install caps plus the 42-minute update cap and runtime proof.
This prevents the previous 60-minute job limit from interrupting fallback.
Other job deadlines and runner counts remain unchanged.

Validation: 170 harness tests and 25 workflow tests pass. Eight new lane
regressions fail against original production files; the workflow budget
regression fails against its original 60-minute deadline. Final 35-test lane
rerun: 15.98s wall; workflow tests: 109.18s wall (new case: 25ms).
Touched-file oxfmt/oxlint, workflow checks, and git diff --check pass.
Native Windows release execution was not rerun. Harness-only change.

(cherry picked from commit 2993f78)
Use the existing synthetic ChildProcess property convention instead of
assigning to Node's readonly pid declaration. Preserve the Windows taskkill,
close settlement, and fallback assertions.

Validation: all 35 owning cases, the root-scripts test type graph, scoped lint,
formatting, and fresh review pass. No production or timeout changes.

(cherry picked from commit 64ef24b)
MiniMax-M3 intermittently misses the Code Mode tool-read probe, and the
lane fails only when both MiniMax models miss in one run (5 of the last 30
Release Checks). This is model behavior, not a tool-result regression: a
local live run at 01d7131 passed, and the Code Mode read returned the
probe file correctly. Keep the suite in the full profile. Restore stable
once openclaw#161072 is fixed.

Evidence: FRV 36534008742, Release Checks job 109300784027.
(cherry picked from commit 6ac053b)
Peter approved waiving minor live-channel QA for 2026.9.7 when it cannot be repaired before release. QA Live Matrix fails 7/24 deterministically on 01d7131 (FRV 36534008742, jobs 109299525565 and rerun 109316259401) and Telegram QA 4/25 repeats across 56fb887 and e61efb6 (job 109279074202). Add the exact 2026.9.7-owner-approved entry with the same telegram+matrix scope as 2026.9.5; the existing binding still requires an exact stable/full target, candidate, and package specs.

(cherry picked from commit d0e3126)
Release-lead waiver under Peter's 2026-09-29 00:40 PT decision skipped the only case in three live files on release/2026.9.7 (gateway-progress-refresh openclaw#161083, responses-output-limit openclaw#161084, subagent cold-restart). test:live:shard then rejects the shard because a selected file has no passing assertion (FRV 36550214329 job 109350988291). Exclude exactly those files from shard selection when the candidate package version is 2026.9.7, so the no-pass guard keeps full strength for every other file and release.

(cherry picked from commit 2859785)
native-live-src-agents on FRV 36557373367 (job 109374842818) passed every test but the shard report guard rejected five env-gated files whose only suite is skipped without its opt-in flag: execute.compaction-watchdog.claude (OPENCLAW_LIVE_CLAUDE_COMPACTION), subagent-continuation (OPENCLAW_LIVE_SUBAGENT_E2E), subagent-late-reply, subagent-yield-resume and sessions-send-peer (OPENCLAW_LIVE_SUBAGENT_STRESS). Earlier release runs never reached the guard because a live test failed first. Register them as optional files so they are strict whenever their flag is set.

(cherry picked from commit 13b3bf2)
Scanned all live test files at the 2026.9.7 candidate for suites that skip entirely unless a boolean opt-in flag is set and are missing from the optional-file map: Claude CLI compaction records, three Codex real-binary app-server proofs, Ollama and Twitch. Register them with their exact flags so the no-passing-assertions guard stays strict whenever the flag is set, and does not reject these shards when it is not (FRV 36557373367 job 109374842818 class).

(cherry picked from commit a15f3f7)
…tion (openclaw#161256)

* test(ci): bound the Windows process census by its owning operation deadline

* fix(release): make Windows Node CI shards advisory for release validation

* fix(ci): keep the workflow below its size limit

(cherry picked from commit a214e76)
…tion (openclaw#161291)

Release lead decision under Peter's 2026-09-29 authorization to use best judgement and ship 2026.9.7.

The package-update-self-upgrade Docker chunk runs upgrade-survivor plus the six update-first-hop-compat lanes (2026.9.1-9.6) concurrently in one job. Under that six-way contention single updates take 1000+ s instead of ~540 s, four lanes hit the chunk time limit and 9.3/9.4 fail rollback verification under load. It failed deterministically in FRV 36574050952 (candidate Release Checks jobs 109446149023 and rerun 109482109194).

No coverage is lost: in that same FRV every update-first-hop-compat lane (9.1-9.6), the plain upgrade-survivor lane (targeted job 109449112217 / 109482117123), every published upgrade-survivor lane, and all 12 cross-OS packaged lanes passed as separate lanes. The chunk stays in the full profile.

Follow-ups: openclaw#161257 (rollback-verification budget under disk load) and the waves change 5aed431599c1 (at most two concurrent first-hop lanes in this chunk), to land on main after the release and restore the chunk to stable.
(cherry picked from commit e89ae26)
Hosted four-CPU runs spend about 19 minutes preparing SDK artifacts and
compiling all 126 plugin packages with two compiler children. Three runs
hit the 20-minute job deadline: one completed compile and canary but timed
out during the job lifecycle, while two lost receipt or canary coverage.

Give only the extension-package-boundary row 30 minutes for the complete
flow, including setup and cleanup. Preserve the other additional-check
rows at 20 minutes, full selection, compiler concurrency, receipt guards,
negative canary, runner routes, and caches.

Validated the executable timeout guard against the original failure and
neighboring hosted budgets; workflow/static checks and independent review
cover the scoped correction. No new hosted runtime success is claimed.

(cherry picked from commit 5e5e50e)
…aw#161079)

The published-driver upgrade-survivor cell (legacy-operator-state) failed
at legacy-operator-update-noop for every candidate built after openclaw#160056.
That change reworded the managed-service rerun guidance, and the
already-current assertion hardcoded the full advisory text, so the only
difference was advisory.message.

Project each step's advisory to its kind plus a non-empty explanation.
The check still requires an already-current, repair-free result with no
steps or exactly one unexecuted managed-service-reconciliation entry
(same name, command, cwd, duration, exit code, and advisory kind).
Product text is unchanged.

(cherry picked from commit 4e52570)
…openclaw#161463)

* fix(release): record dependency advisories without blocking releases

Release dependency evidence now blocks only on known malware. Vulnerability
advisories of every severity are recorded in the evidence summary and surfaced
as GitHub warning annotations, and CI dispatched by Full Release Validation or
release publication reports a failing production audit as a warning. The
per-release risk-acceptance table existed only to accept advisory blockers and
is removed.

The release skills also record that main CI health never gates a release and
that every failed test gets an explicit real-blocker-or-flake decision.

* fix(ci): keep release audit relaxation within the workflow size budget

ci.yml sits at the 480000-byte guard, so the release-dispatch check moves
into a trusted harness script that security-fast already checks out.

(cherry picked from commit 56f616e)
The extension-package-boundary timeout change (5e5e50e) pushed ci.yml to 480103 bytes, over the 480000-byte guard in ci-workflow-guards.test.ts, which turned every PR and main red. Comment-only trims bring it to 479968.

(cherry picked from commit 62369f3)
ci-workflow-planning.test.ts asserts this exact comment; the 62369f3 trim reworded it and turned main red. ci.yml stays at 479971 bytes, under the 480000 guard.

(cherry picked from commit 3e29414)
…claw#161520)

GitHub omits empty-string workflow_dispatch inputs from github.event.inputs,
so every sealed child receipt lacked the "" defaults that the parent-side
request filled in, and receipt validation rejected every candidate. The
per-candidate errors were swallowed, so dispatch logs never said why.

Treat empty and absent inputs as identical on both sides, only spend the
five full validations on receipts for this target and tooling, scan 100
runs, and log why each candidate was reused or rejected. Reuse now requires
the child's Tooling SHA to equal the current parent's, enforced at dispatch,
plan sealing, and final verification (previously any main-ancestor tooling
was accepted, which would have become live with this fix).

(cherry picked from commit 306e8a8)
…budget (openclaw#161516)

Adds `pnpm frv watch --run <parent>`: it resolves Full Release Validation children from the parent's dispatch-job logs and reports each attempt transition and failed job once, with runner labels. It tolerates transient GitHub failures and resumes from a small state file.

Adds `pnpm frv rerun --run <parent> --child <key|run-id> [--max-attempts N]`: a bounded, audited single rerun-failed-jobs request. It reruns the green producer when a consumer binds its run attempt (openclaw#161317) and checks the new attempt for duplicate or missing jobs.

Retires `pnpm frv prioritize --run`, since the priority variable no longer controls admission. `--restore` stays.

(cherry picked from commit 53ccbd1)
…f blocking publication (openclaw#161515)

* feat(release): accept exact-job recorded flakes in release validation

A release lead can classify one failed Normal CI job of a Full Release
Validation run as a flake through the trusted classification workflow. The
receipt binds the exact job id and attempt, CI child run, FRV parent run and
attempt, and Release SHA, and carries a tracking issue or PR plus a reason.
Release Decision, the manifest, the publisher's live re-derivation, the step
summary, and the GitHub release notes tail treat it as a visible advisory.
Required classes and every other child stay blocking.

* docs(release): fold recorded flakes into the shared release boundaries

* fix(release): scope flake receipt discovery to the CI child run

* fix(release): require main lineage for flake receipt producers

* test(release): copy the flake classification module into tooling fixtures

* fix(release): keep advisory-only release notes verifiable

(cherry picked from commit f34c2a2)
Canonical 2993f78 gives Windows packaged-upgrade jobs 180 minutes while
other cross-OS jobs retain 60. Evaluate the real runner matrix with the
existing workflow-expression helper instead of assuming one fixed budget.
Use the longest evaluated job in the existing centralized drain check.

Production deadlines and drain margins are unchanged. The original three
acceptance-workflow failures reproduce before this repair; all three and
25 cross-OS workflow sibling tests pass afterward.

(cherry picked from commit c7e89bc)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui channel: a2a channel: buzz channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: qa-channel Channel integration: qa-channel channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: signal Channel integration: signal channel: slack Channel integration: slack channel: sms Channel integration: sms channel: synology-chat channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: admin-http-rpc extensions: arcee extensions: baseten Extension: baseten extensions: byteplus extensions: cerebras extensions: clawrouter Extension: clawrouter extensions: clickclack extensions: copilot-proxy Extension: copilot-proxy extensions: crabbox extensions: deepgram extensions: deepinfra extensions: deepseek extensions: diagnostics-otel Extension: diagnostics-otel extensions: diagnostics-prometheus extensions: document-extract extensions: duckduckgo extensions: featherless extensions: gmi extensions: llama-cpp extensions: llm-task Extension: llm-task extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: memory-wiki extensions: oc-path extensions: onepassword 1Password plugin extensions: policy extensions: qa-lab extensions: tencent extensions: tokenjuice Changes to the bundled tokenjuice extension extensions: vault Extension: vault extensions: web-readability gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. plugin: azure-speech Azure Speech plugin plugin: beam Beam session sharing plugin plugin: bonjour Plugin integration: bonjour plugin: code-mode-quickjs plugin: cua-computer plugin: facetime FaceTime plugin plugin: file-transfer plugin: geolocation Geolocation plugin (IP to coarse city) plugin: google-meet plugin: imap plugin: linux-node plugin: logbook Logbook automatic work journal plugin plugin: migrate-claude plugin: migrate-hermes plugin: mxc plugin: onnx plugin: pixverse plugin: session-share plugin: slack-huddles plugin: team-reports plugin: teams-meetings Teams Meetings plugin plugin: typesafe plugin: visitor-access plugin: workboard plugin: zoom Zoom plugin rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts security Security documentation size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] subagent orphan-recovery restart-integration flakes on compact-large shards: retry timer not yet scheduled

4 participants