Skip to content

fix: run agents-core CI files safely in parallel - #154133

Merged
steipete merged 6 commits into
mainfrom
ci-burden/s-agents-core-parallel
Sep 21, 2026
Merged

steipete merged 6 commits into
mainfrom
ci-burden/s-agents-core-parallel

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Related: #153435

What Problem This Solves

Agents-core forces 584 test files to run serially inside CI children, retaining 16 groups across 11 parents even when two workers are available.

User Impact

CI runs the same inventory with parallel files, one fewer Node row on Blacksmith and hybrid, and two fewer on GitHub. Local model service shutdown now joins an idle stop already in progress, protects replacement ownership from late lease release, and recovers on a later call after a failed stop observation. There are no configuration or migration changes. Compact children retain a two-worker cap; local runs inherit shared scheduling, including its one-worker throttle.

Why This Change Was Made

The shared runner already resets mocks, evaluated modules, timers, environment, and lifecycle state between files. Qualification exposed fixture isolation problems and a production shutdown ownership bug:

Root cause Scope Repair
Ports released between probing and child startup 4 provider-service test files, 19 original allocation sites One shared fixture retains port claims through daemon shutdown and port-free verification.
Cleanup callback observed before its request settled 1 Bash-tool test file Await the existing heartbeat completion barrier before disposing its handler.
A cloned filesystem mock missed native auth-store bindings 1 auth-permission test file Scope a real builtin spy and synchronize/restore native ESM exports in finally.
An idle stop retired ownership before its process-tree cleanup settled 1 process owner and 2 provider test files already counted above Retain/coalesce shutdown, fence acquisition and late releases, and allow later calls to recheck failed stop attempts.

Three real-process lifecycle regressions fail on the preceding implementations and pass after the repairs. Existing diagnostic formatters move unchanged to one internal module to preserve the 700-line cap; no baseline exception is added. CLI and Gateway teardown consume the existing lifecycle flag/API, so this also preserves update/restart cleanup without changing config or persisted state.

No new serial exceptions are needed. The planner converts legacy serial history into effective-worker estimates while retaining indivisible file costs. Separate parallel timing identities prevent a second discount. Splitting measured parallel parents accounts for each child's effective workers; exact child observations replace estimates, and complete-child wall totals are not multiplied again. Existing CLI stripes remain. The 851 planner descriptors still cover exactly 584 active files; the other 267 are excluded by the config.

One import-cost repair uses the existing Gateway core entry for the watched-session title helper. The watched-session module's measured import fell from 1.62 s to 0.587 s. Standalone runner wall was 22.36 s before and 24.47 s after, so this does not claim a whole-file speedup. The MCP SDK wrapper and runtime config accessor retain their required lifecycle and fallback semantics.

Evidence

Qualified candidate: 962fe39f0f168d2c8e6d1257c91ac4bf5883db44, rebased onto 356b0f186b785dfbb51f7b1f26f6797416e6e309 with both cron and agents-core timing conversions preserved.

All six fresh complete Linux replays passed: 3/3 at the planner cap of two workers and 3/3 at eight workers, through scripts/ci-run-node-test-shard.mts. Every replay independently verified 584 files (582 passed, two existing skips) and 12,209 passed tests with 25 existing skips. Each replay runs all 14 canonical CI children sequentially. No serial carveouts were added.

Execution Replay walls Median wall GNU time maximum RSS
Serial control, 16 groups 795.87 s 795.87 s 5.98 GiB
Parallel, 2 workers, 14 groups 482.05, 497.97, 479.17 s 482.05 s 7.52–7.62 GiB
Parallel, 8 workers, 14 groups 471.24, 402.32, 402.40 s 402.40 s 11.85–12.01 GiB

The two-worker median is 39.4% lower than the fresh control; eight workers are 49.4% lower. Actual host capacity was four CPUs and 15.42 GiB. The serial control used main's 16 groups with file parallelism disabled, followed immediately by the three candidate two-worker samples in the same invocation, source tree, and lease. This measures scheduling/packing and cache-order effects together. Eight-worker proof used a separate lease of the same host class. GNU time maximum RSS is not the sum of concurrent process RSS.

Blacksmith Testbox lease runs: paired serial/two-worker proof, eight-worker proof, and standalone/build/changed checks. Fresh qualification replaces the earlier pre-rebase comparison.

All nine touched test owners/import consumers passed 10/10 alone at cap eight: 90 invocations. Ten standalone runs per file is the explicitly requested maintainer scope for this lane; it takes precedence over the later generic twenty-run recommendation. The four required planner suites passed 2,156 tests, and the final build passed. The final canonical all-16-file changed checks, type-aware lint, formatting, and diff checks passed. A fresh floating-promise canary produced the expected no-floating-promises diagnostic and its temporary file was removed.

The linked campaign’s exact 38-path changed set and the broad fallback produce identical PR counts. All nine current-main/candidate profile/scenario comparisons preserve coverage and remain within 90 compact / 130 PR Node / 70 push Node rows.

Profile Compact PR rows PR Node rows Push Node rows
Blacksmith 74 → 73 122 → 121 55 → 54
Hybrid 70 → 69 118 → 117 45 → 44
GitHub 82 → 80 130 → 128 53 → 51
Per-parent walls at the planner's two-worker cap

Serial values sum each parent's child walls. Parallel values are independent parent medians across three replays; their sum need not equal the median whole replay.

Parent Serial Two workers
auth 68.99 s 42.61 s
models 182.54 s 111.68 s
runner-cli-1 21.15 s 6.56 s
runner-cli-2 11.89 s 9.80 s
runner-cli-3 8.06 s 7.53 s
runner-commands 84.30 s 59.94 s
runner-embedded 23.80 s 15.87 s
runner-sessions 17.02 s 12.88 s
runtime 235.51 s 130.18 s
subagents 21.55 s 13.86 s
tools 120.24 s 70.96 s
Standalone file costs and corresponding CI jobs

One-worker values are complete isolated wrapper walls measured with --maxWorkers=1. CI did not publish per-file timing artifacts. The final column is the owning CI job's complete wall, including unrelated groups and setup; it is not a per-file CI measurement.

File One-worker wall Owning CI job wall
src/agents/provider-local-service.test.ts 22.047 s large-12: 942 s
src/agents/provider-local-service.env-case.test.ts 1.720 s large-12: 942 s
src/agents/provider-local-service.shutdown.test.ts 9.482 s large-12: 942 s
src/agents/provider-local-service.linux-oom.test.ts 1.718 s large-12: 942 s
src/agents/bash-tools.test.ts 14.623 s large-3: 471 s
src/agents/auth-profiles.permissions.test.ts 14.384 s large-14: 427 s
src/agents/watched-sessions-prompt.test.ts 17.391 s large-15: 294 s
test/scripts/ci-node-test-plan.test.ts 60.032 s small-43: 635 s
test/vitest-scoped-config.test.ts 16.549 s small-39: 267 s

The planner file's existing integration inventory makes its whole-file cost exceed 30 seconds; the new cases use bounded synthetic file weights through the actual planner to protect worker pricing, excluded-file handling, and child projection. The provider shutdown tests exercise actual process-tree exit and replacement ownership, including the existing four-second TERM/KILL budget; a mocked timer/process would omit the contract exposed by parallel qualification.

Qualification exposed and repaired the Bash cleanup race, native-filesystem mock mismatch, pending provider shutdown race, late lease deletion, and failed-stop promise poisoning. Independent review also found the parallel-parent split underestimate; the executable probe now prices two 200-second singleton children as 200 + 200 seconds, not 100 + 100. No failed test sample was rerun unchanged. Assertions and existing time limits remain intact; no retry policy, baseline exception, or new serial list was added. Earlier harness preflight and transport interruptions remain recorded separately from successful tests.

Fresh Codex branch autoreview is scoped-clean through P2, with no actionable findings. A preceding review's cancellation/reacquisition scenario was rejected after independent and lead source traces; the final review with full owner context confirms that caller cancellation stays separate from shared startup and that the synchronous stopping fence prevents bypassing retirement.

Exact-head CI run 35544335558 passed on attempt one: 147 successful jobs, 15 skipped, zero failures, including openclaw/ci-gate, in 16m58s. No jobs were rerun. Published ClawSweeper reviews found no code or security defects; this section supplies the requested refreshed qualification, flake repairs, and costs.

Remaining pre-merge blocker: the published-updater survivor cell failed on its first attempt. Testbox run 35547884479 used the existing legacy-operator-state / auto-auth cell with published [email protected] and the exact public candidate. Canonical preparation passed, then the cell exited 1 after 260.117 seconds. No retry, version bump, assertion relaxation, package publication, or operator Gateway change occurred.

The core updater reported status: ok; every core step exited zero, and the installed and serving build ID matched the prepared candidate: 2026.9.5-962fe39f0f16-2026-09-21T00-33-25.590Z. Gateway verification reported the service running and ready, with channels ready and no plugin startup errors. The prepared tarball’s SHA-256 was 5592cf61932692891e9ad1af8fd7e367284f3814bb24adb1e3dfe73059a54112.

The complete cell nevertheless failed successful update failed plugin convergence: the fixture first installs the published Discord tarball, then its candidate-phase registry advertises rebuilt bytes under the same immutable @openclaw/[email protected] identity. The product correctly reports an integrity drift and aborts that plugin update. The assertion prevents the later restart bookkeeping/remaining survivor assertions from running, so updateRestartSource remains null. This is not a passing survivor qualification.

The owning follow-up is companion registry selection in configure_plugin_registry: preserve published package identity across same-version phases, or use an explicit real version transition. That fixture repair is outside this agents-core lane. The three real-process regressions separately prove local-provider cleanup ordering, replacement ownership, and recovery. This PR remains unmerged as requested.

@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 21, 2026, 2:40 AM ET / 06:40 UTC (Revision 6).

ClawSweeper review

What this changes

The PR parallelizes agents-core CI tests, adjusts scheduling estimates, repairs fixture isolation, and makes local model service shutdown retain ownership until cleanup completes.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the work remains useful on current main, and source review found no blocking code or security defect.

Priority: P2
Reviewed head: 73abad896a66d7bcea130f610a05c0c09339bc20

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has substantial behavior evidence and no supported correctness findings, with one remaining upgrade qualification.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded Linux shard replays exercise the real CI runner, and real-process regressions cover idle-stop joining, replacement ownership, and failed-stop recovery. The lifecycle source is unchanged from the prior reviewed head; the separate required packaged-upgrade qualification remains outstanding.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded Linux shard replays exercise the real CI runner, and real-process regressions cover idle-stop joining, replacement ownership, and failed-stop recovery. The lifecycle source is unchanged from the prior reviewed head; the separate required packaged-upgrade qualification remains outstanding.
Evidence reviewed 9 items Pinned introduced changes: Reviewed the merge-base-to-head hunks across all 16 introduced paths. The host-verified test merge records the fetched main followed by the exact PR head; unrelated endpoint drift was not attributed to this PR.
Still necessary on main and latest release: Fetched main and the supplied latest release both retain fileParallelism: false. Main also removes the service-map entry before awaiting process cleanup, so neither central change is already implemented.
Lifecycle ownership repair: Shutdown synchronously marks retirement, coalesces its promise, joins startup and process-tree cleanup, and deletes only the matching owner. Failed observations retain ownership while allowing a later attempt; acquisition and late release check that same owner.
Findings None None.
Security None None.

How this fits together

The CI planner turns test inventories and timing history into bounded worker jobs. Local model service management starts and stops provider processes for model requests and Gateway teardown; parallel testing exposed races in that lifecycle.

flowchart TD
  A[Test inventory and timing history] --> B[CI planner]
  B --> C[Parallel test workers]
  C --> D[CI results]
  C --> F[Local service lifecycle]
  E[Model requests and Gateway teardown] --> F
  F --> G[Join process shutdown]
  G --> H[Release ownership or start replacement]
Loading

Before merge

  • Resolve merge risk (P1) - Packaged restart and cleanup remain unqualified for the changed service owner: the recorded candidate upgrade stopped before survivor assertions, and the current CI run skipped that cell.
  • Complete next step (P2) - Complete and record the published-updater survivor qualification for this candidate with the repaired registry fixture.
Agent review details

Security

None.

PR surface

Source +111, Tests +484, Docs +9, Other +126. Total +730 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 3 212 101 +111
Tests 10 630 146 +484
Docs 2 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 1 185 59 +126
Total 16 1036 306 +730

Review metrics

Metric Value Why it matters
Growth by responsibility Runtime +111 LOC; planner +126; tests/support/config +484 Production growth has stated ownership and scheduling purposes, while most net growth provides regression and isolation coverage.
Reported scheduling benefit Two-worker replay median: 795.87s → 482.05s The recorded 39.4% reduction preserves the 584-file inventory, but includes scheduling, packing, and cache-order effects.

Merge-risk options

Maintainer options:

  1. Complete candidate upgrade qualification (recommended)
    Use the repaired fixture to establish the candidate's remaining restart and cleanup outcomes and attach the result to the PR.

Technical review

Best possible solution:

Retain the existing scheduling and lifecycle owners, with completed published-updater qualification establishing safe packaged restart and cleanup.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: main retires the service-map entry before process shutdown settles, allowing overlapping shutdown or reacquisition to miss that cleanup. This review did not execute the regression.

Is this the best way to solve the issue?

Yes: coalescing cleanup in the existing service owner and reusing shared worker scheduling are focused repairs without new configuration or competing implementations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8e4c007a6829.

Labels

Label justifications:

  • P2: This is a bounded CI efficiency improvement with a concrete local-provider shutdown repair.
  • merge-risk: 🚨 availability: The changed process-cleanup owner participates in Gateway teardown, whose packaged restart qualification remains incomplete.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded Linux shard replays exercise the real CI runner, and real-process regressions cover idle-stop joining, replacement ownership, and failed-stop recovery. The lifecycle source is unchanged from the prior reviewed head; the separate required packaged-upgrade qualification remains outstanding.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded Linux shard replays exercise the real CI runner, and real-process regressions cover idle-stop joining, replacement ownership, and failed-stop recovery. The lifecycle source is unchanged from the prior reviewed head; the separate required packaged-upgrade qualification remains outstanding.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head hunks across all 16 introduced paths. The host-verified test merge records the fetched main followed by the exact PR head; unrelated endpoint drift was not attributed to this PR. (73abad896a66)
  • Still necessary on main and latest release: Fetched main and the supplied latest release both retain fileParallelism: false. Main also removes the service-map entry before awaiting process cleanup, so neither central change is already implemented. (test/vitest/vitest.agents-core.config.ts:11, ec9c1a13db89)
  • Lifecycle ownership repair: Shutdown synchronously marks retirement, coalesces its promise, joins startup and process-tree cleanup, and deletes only the matching owner. Failed observations retain ownership while allowing a later attempt; acquisition and late release check that same owner. (src/agents/provider-local-service.ts:528, 73abad896a66)
  • Scheduling and regression coverage: Parallel groups retain two-worker caps and separate timing identities. Added cases cover indivisible files, excluded files, serial-history conversion, and measured child costs; process regressions cover pending idle shutdown, late release, and failed-stop recovery. (scripts/lib/ci-node-test-plan.mts:901, 73abad896a66)
  • Complete captured proof and review continuity: Retrieved the omitted body ending and verified SHA-256 b610cf3cdc8a89893efea6acf62e64da53bf37d537b1def50c3269091da0617b, matching the supplied snapshot. It records six complete Linux replays and three real-process regressions, but explicitly says the updater cell did not finish survivor qualification. GitHub contents reads confirmed the lifecycle implementation, diagnostics, and shutdown tests are byte-identical to reviewed head 962fe39. Historical local blob reads failed; those continuity checks used immutable GitHub source instead. (src/agents/provider-local-service.shutdown.test.ts:89, 73abad896a66)
  • Fixture failure has a merged owner: fix(ci): preserve published plugin bytes in upgrade fixtures #154374 merged the same-version plugin registry fixture repair. Its successful survivor result used its own candidate, so it resolves the fixture defect without demonstrating this PR's changed lifecycle in a completed upgrade cell. (1f4ddebf122c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach completed published-updater survivor evidence for this candidate using the merged fixture repair, and refresh the PR body's blocker status.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-20T22:53:53.919Z sha d519ecd7a8ddf6074ed177da2efd61edd3b67ec3 :: needs changes before merge. :: none
  • reviewed 2026-09-20T23:29:05.367Z sha 962fe39 :: needs changes before merge. :: none
  • reviewed 2026-09-20T23:50:26.976Z sha 962fe39 :: blocked before merge. :: none
  • reviewed 2026-09-21T00:16:16.651Z sha 962fe39 :: blocked before merge. :: none
  • reviewed 2026-09-21T01:15:14.419Z sha 962fe39 :: blocked before merge. :: none

@steipete
steipete force-pushed the ci-burden/s-agents-core-parallel branch from d519ecd to 962fe39 Compare September 20, 2026 23:19
@steipete
steipete marked this pull request as ready for review September 20, 2026 23:20
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 20, 2026
@steipete
steipete enabled auto-merge (squash) September 21, 2026 04:06
@steipete
steipete force-pushed the ci-burden/s-agents-core-parallel branch from 962fe39 to 73abad8 Compare September 21, 2026 06:32
@steipete
steipete merged commit 5084bde into main Sep 21, 2026
210 checks passed
@steipete
steipete deleted the ci-burden/s-agents-core-parallel branch September 21, 2026 06:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
* fix(agents): retain local service ownership through shutdown

* test(agents): await heartbeat cleanup completion

* test(agents): inject permission failures into native filesystem bindings

* perf(agents): narrow watched-session title import

* ci: parallelize agents-core files with effective worker costs

* test(ci): retain agents-core split timing assertions
steipete added a commit that referenced this pull request Oct 14, 2026
* refactor(agents): simplify old runtime bookkeeping

Use one catalog discovery pass, local-process stop promise, presentation
completion path, diagnostic recovery batch, and generated-media rollback
owner. Reuse directory parameter declarations and keep sandbox validation
at its existing boundary without repeating the same blocked-path checks.
Remove the duplicate full-map primary-probe prune.
Trust JSON-normalized result previews and group identical session-export
style declarations without changing their visibility or cascade rules.

Keep auth/approval/sandbox policy, normal child and write settlement,
transcript/user-data durability, public signatures and Phase E unchanged.
Production reduction: 147 net lines across ten old-only files.

Best-effort tradeoffs accepted

- MCP list_changed during held sibling discovery: #138694 added a synthetic
  forced-overlap replay, not a cited human incident. The next load refreshes
  the catalog instead; retirement and execution authority remain enforced.
- Competing catalog producer finalization: the same private owner forbids a
  replacement while its promise is present, so the identity recheck is an
  internal invariant, not a realistic concurrency boundary.
- Local-service post-readiness exit: #154133 describes synthetic parallel
  qualification, not a human report requiring another health check. The
  following request reports an exit after readiness; normal shutdown still
  joins the child, streams and pending termination work.
- Local-process stop identity: replacement starts only after the retained
  authoritative process finishes stopping. The duplicate process reference
  and identity comparisons cannot observe another production replacement;
  failed-stop retry and the retiring marker remain intact.
- Synchronous presentation self-drain: #156187 extracted this reservation
  without a cited human incident. Production adapters drain after projection;
  callbacks return their own work instead of reserving it before invocation.
- Quarantine recovery overlap: #161579 explicitly introduced per-key and
  generation fencing for synthetic before-dispatch/after-reply controls.
  Same-key overlap can leave a stale or missing status warning until a later
  failing run or existing TTL. Actual tool exclusion, logs/events, accepted
  writes, stored shapes and worker/SQL contracts remain unchanged.
- Primary-probe cache insertion order: #82707 introduced duplicate pruning.
  Post-write expiry and capacity bounds remain; refreshing an expired key
  can retain an earlier insertion position and permit an earlier reprobe
  after capacity eviction. This is a bounded best-effort throttle cache.
- Preview host-prototype pollution: #147278 added own-property gates as part
  of result retention, not a human inherited-property failure report; linked
  #147105 proposes the feature. The sole caller passes freshly parsed JSON.
  A polluted host Object.prototype can affect bounded descriptive samples;
  retained JSON, reference identity and execution authority remain unchanged.

* test(agents): warm MCP sibling before held discovery

The discovery/revocation fixture held HTTP tools/list while cold-starting
its stdio sibling. Slow startup could exhaust the existing ten-second
listing deadline before the test reached revocation, producing a timeout
diagnostic or an empty healthy-tool list instead of exercising its overlap.

Warm the non-held sibling through its actual runtime owner first, then hold
the other server's discovery across revocation. Keep every assertion,
deadline, runtime authority check, and cleanup path unchanged.

The two affected cases pass through the production materialization path;
focused lint, format, and the owning test type graph also pass. The earlier
four short-deadline MCP runtime failures remain separately unattributed.

* refactor(apple): simplify source resources and microphone permission

Use cancellation of owned source-resource tasks instead of a revision
counter. Use native async microphone permission APIs instead of manual
authorization-state switches and callback continuations.

Best-effort tradeoffs accepted:
- Resource revision tracking (#148906, feature request #148850, not a
  human invalidation-race incident): invalidation between prepared context
  and favicon task admission may allow one lookup with that snapshot;
  later lookups rediscover. Live route authority and Gateway disabled-fetch
  policy remain enforced.

No protocol, persisted shape, config, permission-prompt or signing changes.
Net production reduction: 26 lines (+10/-36); no test changes. Phase E
untouched. Pager/notification changes were excluded after #171772 made
their files recent under the seven-day rule. BELOW-500 coordinator bundle.

Remaining source is byte-identical to the independently reviewed checkpoint.
macOS/iOS Simulator/watchOS Simulator arm64 platform builds passed.
Actual production-package focused tests passed: 17 VoiceNote XCTest cases
and 18 source-resource SwiftTesting declarations including parameters.
SwiftFormat, SwiftLint, runtime/madge cycles (zero), lint-suppressions,
native-state guard and localization verification passed.

Broad check-changed is not green: one bounded reproduction retained ten
20-second artifact-fixture subprocess timeouts and one 120-second signing
fixture timeout. Unchanged tooling paths do not run these Swift sources;
these are unresolved local failures, not proven hosted-main-red.
Intel execution, app-hosted native UI tests requiring an OS sandbox and
live microphone effects are not proven. No release_gate or remote lease.

* refactor(apple): consolidate activity refresh and watch connection paths

* refactor(agents): retain recent MCP contracts in old-code bundle

Keep the recently edited reload regression file and its current combined-catalog implementation unchanged from main. Preserve the final source-lane trees for quarantine and Live Activity while retaining newer main behavior.

This supersedes the historical source-commit inventories and MCP/quarantine/activity timing tradeoffs. Final bundle: 162 production lines removed; 112 net lines removed including tests (+166/-278, 14 files). Credit source lanes q10, q01 and q02. Fresh final-index review found no actionable P0-P2 defects. Focused proof and exact-head PR CI remain the landing gates.

* fix(test): synchronize MCP connection invalidation fixture

Hold sibling initialization across client-observed catalog invalidation. Preserve the existing assertions and deadlines; isolate scenario setup so the oversized runtime test does not grow.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…aw#172002)

* refactor(agents): simplify old runtime bookkeeping

Use one catalog discovery pass, local-process stop promise, presentation
completion path, diagnostic recovery batch, and generated-media rollback
owner. Reuse directory parameter declarations and keep sandbox validation
at its existing boundary without repeating the same blocked-path checks.
Remove the duplicate full-map primary-probe prune.
Trust JSON-normalized result previews and group identical session-export
style declarations without changing their visibility or cascade rules.

Keep auth/approval/sandbox policy, normal child and write settlement,
transcript/user-data durability, public signatures and Phase E unchanged.
Production reduction: 147 net lines across ten old-only files.

Best-effort tradeoffs accepted

- MCP list_changed during held sibling discovery: openclaw#138694 added a synthetic
  forced-overlap replay, not a cited human incident. The next load refreshes
  the catalog instead; retirement and execution authority remain enforced.
- Competing catalog producer finalization: the same private owner forbids a
  replacement while its promise is present, so the identity recheck is an
  internal invariant, not a realistic concurrency boundary.
- Local-service post-readiness exit: openclaw#154133 describes synthetic parallel
  qualification, not a human report requiring another health check. The
  following request reports an exit after readiness; normal shutdown still
  joins the child, streams and pending termination work.
- Local-process stop identity: replacement starts only after the retained
  authoritative process finishes stopping. The duplicate process reference
  and identity comparisons cannot observe another production replacement;
  failed-stop retry and the retiring marker remain intact.
- Synchronous presentation self-drain: openclaw#156187 extracted this reservation
  without a cited human incident. Production adapters drain after projection;
  callbacks return their own work instead of reserving it before invocation.
- Quarantine recovery overlap: openclaw#161579 explicitly introduced per-key and
  generation fencing for synthetic before-dispatch/after-reply controls.
  Same-key overlap can leave a stale or missing status warning until a later
  failing run or existing TTL. Actual tool exclusion, logs/events, accepted
  writes, stored shapes and worker/SQL contracts remain unchanged.
- Primary-probe cache insertion order: openclaw#82707 introduced duplicate pruning.
  Post-write expiry and capacity bounds remain; refreshing an expired key
  can retain an earlier insertion position and permit an earlier reprobe
  after capacity eviction. This is a bounded best-effort throttle cache.
- Preview host-prototype pollution: openclaw#147278 added own-property gates as part
  of result retention, not a human inherited-property failure report; linked
  openclaw#147105 proposes the feature. The sole caller passes freshly parsed JSON.
  A polluted host Object.prototype can affect bounded descriptive samples;
  retained JSON, reference identity and execution authority remain unchanged.

* test(agents): warm MCP sibling before held discovery

The discovery/revocation fixture held HTTP tools/list while cold-starting
its stdio sibling. Slow startup could exhaust the existing ten-second
listing deadline before the test reached revocation, producing a timeout
diagnostic or an empty healthy-tool list instead of exercising its overlap.

Warm the non-held sibling through its actual runtime owner first, then hold
the other server's discovery across revocation. Keep every assertion,
deadline, runtime authority check, and cleanup path unchanged.

The two affected cases pass through the production materialization path;
focused lint, format, and the owning test type graph also pass. The earlier
four short-deadline MCP runtime failures remain separately unattributed.

* refactor(apple): simplify source resources and microphone permission

Use cancellation of owned source-resource tasks instead of a revision
counter. Use native async microphone permission APIs instead of manual
authorization-state switches and callback continuations.

Best-effort tradeoffs accepted:
- Resource revision tracking (openclaw#148906, feature request openclaw#148850, not a
  human invalidation-race incident): invalidation between prepared context
  and favicon task admission may allow one lookup with that snapshot;
  later lookups rediscover. Live route authority and Gateway disabled-fetch
  policy remain enforced.

No protocol, persisted shape, config, permission-prompt or signing changes.
Net production reduction: 26 lines (+10/-36); no test changes. Phase E
untouched. Pager/notification changes were excluded after openclaw#171772 made
their files recent under the seven-day rule. BELOW-500 coordinator bundle.

Remaining source is byte-identical to the independently reviewed checkpoint.
macOS/iOS Simulator/watchOS Simulator arm64 platform builds passed.
Actual production-package focused tests passed: 17 VoiceNote XCTest cases
and 18 source-resource SwiftTesting declarations including parameters.
SwiftFormat, SwiftLint, runtime/madge cycles (zero), lint-suppressions,
native-state guard and localization verification passed.

Broad check-changed is not green: one bounded reproduction retained ten
20-second artifact-fixture subprocess timeouts and one 120-second signing
fixture timeout. Unchanged tooling paths do not run these Swift sources;
these are unresolved local failures, not proven hosted-main-red.
Intel execution, app-hosted native UI tests requiring an OS sandbox and
live microphone effects are not proven. No release_gate or remote lease.

* refactor(apple): consolidate activity refresh and watch connection paths

* refactor(agents): retain recent MCP contracts in old-code bundle

Keep the recently edited reload regression file and its current combined-catalog implementation unchanged from main. Preserve the final source-lane trees for quarantine and Live Activity while retaining newer main behavior.

This supersedes the historical source-commit inventories and MCP/quarantine/activity timing tradeoffs. Final bundle: 162 production lines removed; 112 net lines removed including tests (+166/-278, 14 files). Credit source lanes q10, q01 and q02. Fresh final-index review found no actionable P0-P2 defects. Focused proof and exact-head PR CI remain the landing gates.

* fix(test): synchronize MCP connection invalidation fixture

Hold sibling initialization across client-observed catalog invalidation. Preserve the existing assertions and deadlines; isolate scenario setup so the oversized runtime test does not grow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant