Skip to content

fix: curb Gateway memory growth after large fleets start - #150354

Merged
steipete merged 5 commits into
mainfrom
upd/fleet-postready-worker-rss
Sep 17, 2026
Merged

steipete merged 5 commits into
mainfrom
upd/fleet-postready-worker-rss

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #149538

What Problem This Solves

Fixes Gateway memory growth after readiness on large fleets when background catalog discovery retains a separate worker isolate for each agent.

User Impact

Configured Gateway agents share one catalog worker and one transcript-reconciliation worker across the fleet. Pending work reuses those workers, and shutdown drains accepted transcript writes and lease recovery before retiring them. No operator action or configuration change is required. Total process memory still depends on the workload and Node's allocator.

Why This Change Was Made

Thanks to @609NFT for the measurements and constructor-attributed rerun. The constructor-attributed trace identifies prepared-model-catalog.worker.js as every post-ready application worker. Catalog tasks already ran serially, but their idle isolates remained attached to individual agents. A single pool now owns the configured Gateway's plugin-inventory lifetime, while each task carries its agent/auth facts. Source capture, auth isolation, failure recovery, and native-exit settlement remain with their existing owners. Standalone callers with custom environments retain their isolation contract.

Transcript title prewarming had a separate per-dirty-database constructor. It now uses a fleet-wide pool with the same bound of one, task-specific message channels, parent write acknowledgements, and exact deletion leases. Its native promise timers keep accepted reconciliation runnable when a caller replaces its timer globals, so lifecycle drainage can finish. Gateway status and startup memory.ready expose owner-recorded capacity, worker, creation, active-task, and pending-task counts.

The branch builds on main's credential-owner publication and fresh-store snapshot handoff, now integrated through #150026. The retained integration assertions verify one discovery request per credential publication while catalog pools preserve agent and source-generation isolation.

The production growth supports shared lifetime ownership, stale-generation fencing, and recovery across previously independent agents. There are no schema, dependency, CLI, config, or V8-flag changes.

Evidence

The isolated 200-agent fixture reproduces the reported catalog growth with synthetic credentials, real transcript rows, and a 2,560 MiB parent heap setting. Constructor stacks and per-isolate memory sampling identify the workers; an external sampler records process RSS and threads.

200-agent fixture, Node 24.21 Before After
RSS nearest readiness sample (MiB) 1,474.5 1,593.7
RSS at +120 seconds (MiB) 3,619.2 1,844.2
Growth from readiness sample (MiB) +2,144.7 +250.5
Peak external RSS after readiness (MiB) 3,841.5 1,895.0
Catalog workers created, total 7 1
Catalog workers created after readiness 6 0
Reconciliation workers created 200 1
Validation workers created 200 200
Live workers at +120 seconds 10 4
Successful post-ready health probes 115 / 121 117 / 121

The predeclared 512 MiB RSS allowance fails on the baseline and passes on the candidate. Readiness values above are the nearest preceding in-process samples; the candidate's owner-emitted memory.ready RSS was 1,436.9 MiB, and even its peak external RSS stayed within 512 MiB of that value. Both runs completed the full 120-second window and shut down cleanly. Both preserved 1,600 searchable rows and left zero dirty projections. Four five-second health deadlines remain on the candidate, all from probes started in the first five seconds after readiness.

The single pooled catalog isolate reached a 611 MiB physical-heap peak; the baseline's seven separate catalog isolates peaked at 259–395 MiB each. In the five complete baseline intervals between post-ready catalog constructions, external RSS rose by 247–384 MiB per interval; these are whole-process deltas, not exclusive per-worker allocations. RSS retention remains observable after catalog exit: the last positive external samples before process exit were 3,365 MiB before and 1,781 MiB after. The candidate's final in-process sample was 1,002 MiB. This macOS run does not identify a glibc allocator cause.

The baseline used its preserved built package; the candidate used the supported source wrapper, which performed its normal runtime-freshness build before launching. Both use the same fixture content, Node version, heap setting, and samplers; comparisons above start at Gateway readiness. These measurements were captured at 03f9ef225b3. The subsequent auth-publication repair and scheduler correction preserve worker bounds and pool retirement policy, so the 200-agent run was not repeated. These are prior-head measurements, not a fresh RSS measurement of the scheduler correction. Both runs recorded the fixture's existing missing-system-agent cron warning.

The dirty baseline seeded 200 sessions with 1,600 real message rows (1,800 transcript rows including headers) and dirty projection state. Startup repaired them before readiness, creating 200 reconciliation workers. Post-ready title reconciliation requires projection state to become dirty or unavailable after startup has awaited its repair; seeding dirty databases before boot alone does not produce that transition. The deterministic multi-agent regression exercises deferred reconciliation directly, including queued writes and lease settlement.

Reporter evidence, runtime constraint, and worker audit

Reporter measurements (MB as reported):

Run At readiness Later After worker exit
Original, 632 agents RSS 1,851; 3 workers +74 s: RSS 3,204; 8 workers RSS 2,992
Attributed main rerun RSS ~1,448; 3 workers +73 s: RSS ~2,996; 12 workers RSS ~2,782; 3 workers

The attributed rerun created one catalog worker just before readiness and nine afterward. Its shutdown-timer worker is not a new post-ready application owner. The main isolate's heap fields omit worker heaps.

Node 24 probe results with requested old-generation 64 MiB / young-generation 8 MiB:

Parent / worker launch Effective worker heap limit
No parent heap override 76 MiB
Parent --max-old-space-size=2560 2,572 MiB
Same parent, worker execArgv: [] and empty worker NODE_OPTIONS 2,572 MiB
Worker-specific heap CLI argument ERR_WORKER_INVALID_EXEC_ARGV

The parent setting is process-global in this runtime. A per-isolate override belongs to the Node/V8 runtime owner as a follow-up; resetting V8 flags from concurrent JavaScript worker construction is unsafe. No flag reset or operator setting is introduced here.

The three small startup/steady workers do not copy a full config, plugin bundle, or catalog: SQLite broker startup has no worker payload (opens carry locator/admission facts); lease heartbeat carries identity/timing/locator facts and a 24-byte shared buffer; macOS CA warmup uses a small fixed TLS evaluation source. The broker already bounds its Node workers at four. No production constructor in the audited core/plugins requests resourceLimits.

Other audited owners retain their existing bounds: transcript context/export/history/branch pools (one each), memory retrieval/index preparation (one each), disk measurement (one), Git lanes (1/2/2/1/1), cron matching (two), compaction/code-mode compute admission, and request-owned native-copy/history/image/document workers. Telegram ingress is per polling account; oversized Claude history parsing is per requested line; the hard-exit timer is shutdown-only. Archive validation reuses a worker across batches for each database since #150188; it still creates workers for distinct databases.

Duplicate-discovery regression

The production repair and fresh-store regression described here are now on main via 515f424cbac (#150026). The PR retains the catalog-pool request-count integration assertions; the earlier source files are byte-identical after rebase.

CI on 03f9ef225b3 found two /models requests after login and account replacement. Constructor/task tracing showed one worker receiving two successful catalog tasks under different generations, with no recovery failure. There were two publication defects: refresh emitted a forced mutation after the real owner had already published, and first-login bootstrap left empty runtime views bound to the previous shared store until secrets activation rebound them. The repair deletes the forced notification and completes that fresh-store binding handoff at its producer; it adds no request-path deduplication cache.

Both integration files passed 10/10 repetitions on Node 24.21: 20 file runs, 30 case executions, zero failures. Each login delay (0 and 7,000 ms), same-account renewal, and replacement keeps the expected request count; added assertions observe the real pool's creation/completion facts. The fresh-store regression also verifies a failed first credential transaction, successful retry, external-profile preservation, and unrelated-root isolation. Restoring the old snapshot owner reproduced the two-request login and stale-binding failures; the fixed source was restored and verified.

The auth-publication repair at a7eb51d79a4429edbbc7fafd74258176a550204d passed 242 focused tests, changed-file checks with the documented lint substitute, build, and P1 branch review. Current candidate validation is listed below.

The SDK call-site edit selected whole-tree extension lint although no extension sources changed. Its wrapper hit Declaration input escapes checkout from the ancestor install. The direct substitute covered the full extension tree with node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions (exit 0). Canary and restoration proof:

extensions/openai/index.ts:1:1: error eslint(no-debugger): `debugger` statement is not allowed
Restored canary: original SHA-256; exit 0; no diagnostics.
Full extension tree: exit 0; two pre-existing max-lines warnings in unchanged files.

The unchanged warnings are 711/700 lines in extensions/memory-core/src/memory/manager.ts and 1,031/1,000 in extensions/codex/index.test.ts. Every other planned check passed, including core/extension production and test types, SDK exports/surface, dead-code scans, core lint, schema, import cycles, and the remaining guards. CI remains the authority for packaged extension lint.

Auth-publication follow-up LOC: production +36, tests/support +140, documentation +4. The net production addition is the missing fresh-store ownership handoff; the duplicate notification and unused internal operation argument were removed. No pool lifecycle, public RPC/SDK signature, config, CLI, dependency, schema, or persistence-format change was introduced.

CI teardown follow-up

The exact-head session shard stalled after all 228 cases passed because two reset-policy cases discarded their fake setImmediate callbacks after reconciliation had already registered its operations. The final singleton drain then waited forever for those operations. Constructor/handle diagnostics recorded two pending reconciliation operations, no reconciliation or catalog worker, no catalog rotation, and only Vitest's MessagePort active.

Reconciliation now uses Node's native promise timers for yields and retry backoff. The existing drain still waits for accepted operations, parent writes, and lease release. No publication policy, worker bound, pool retirement policy, operator setting, schema, or dependency declaration changes in this follow-up.

Pre-edit comparison, Node 24.21.0 Standalone file ×3 Exact non-isolated 11-file shard ×3
PR head a7eb51d79a4429edbbc7fafd74258176a550204d 228 cases pass, then 300-second stall; exit 143 each time Same stall before the neighboring files; exit 143 each time
Pinned main 79121743a16969fd86dfd88fcd5422dacea88ac3 228 tests pass each time 11 files / 332 tests pass each time

A boundary regression removes a derived search row, withholds the caller's immediate callback, restores the caller timer, and requires the real rebuild and public pool close to complete. It fails on the original source with Test timed out in 30000ms; the fixed owner passes locally in 947 ms. The failing test's cleanup releases its withheld callback, so the negative proof exits cleanly.

An initial parallel validation hit existing 120-second cold-start deadlines; serial reruns passed unchanged tests and deadlines, including the initial session reset in 79.3 seconds and first catalog login in 80.4 seconds. The complete passing proof is listed below.

Scheduler follow-up LOC: production −6, tests +72. Pool bounds remain one worker each.

Boundary regressions and validation
  • Pre-fix reconciliation: eight dirty agents created eight simultaneous workers; the bound-one assertion fails. Candidate coverage asserts recorded pool facts, reuse, correct per-agent transcript output, and exact lease settlement.
  • Pre-fix catalog constructor proof: the four-agent workload created three additional live workers during the observation window; the bound-one assertion fails. Candidate coverage exercises multi-agent auth/source isolation, source-file changes, environment retirement, native failure recovery, and queued timeout retry.
  • A rejected task-input factory no longer retires a healthy shared worker and poisons queued siblings; the regression fails with the old behavior.
  • Final Gateway reconciliation close is covered with accepted direct/deferred work, native exit, lease recovery, stale callers, and a fresh lifecycle.

Prior scheduler candidate: 239ffb8e7ea447e66a8cb104a8b6d445824fe043.

Validation completed locally on that scheduler candidate:

  • Exact non-isolated CI shard: 11 files / 332 tests passed.
  • Scheduling and reconciliation lifecycle: 3 files / 15 tests passed.
  • Gateway, including both catalog login delays and account replacement: 6 files / 130 tests passed.
  • Remaining auth, pool, transcript, SDK, and embedded-runner owners: 16 files / 270 tests passed.
  • Shared-auth bootstrap regression: 1 test passed separately. Total selected passing proof: 748 tests across 37 files.
  • Every selected changed-check step passed with the canary-proven nested-checkout extension-lint substitute described above. No suppressions or baselines changed.
  • Fresh pnpm build: exit 0 in 1052.99 seconds; source hashes unchanged through build and commit.
  • Pre-commit isolated Codex review: scoped-clean at P1.
  • Fresh autoreview --mode branch --base origin/main --max-priority P1: scoped-clean on 239ffb8e7ea447e66a8cb104a8b6d445824fe043, with no accepted/actionable findings.

Whole-PR LOC against the final main anchor: production +712 / −200 (net +512); tests/support +1,319 / −338 (net +981); docs +33 / −2 (net +31). Growth establishes shared catalog recovery and complete reconciliation-operation shutdown ownership; obsolete per-agent constructors and test-only task injection are removed.

Fixture lifecycle regression follow-up

The native-timer change broke a sibling test on 92589e36bfa06d5e6f34a4a17b450b334e8d8dc6: the fixture cleanup test tried to capture a global setImmediate callback that reconciliation no longer schedules. The full unchanged file reproduced the CI assertion failure (28 passed, one failed). Both that test and the scoped-drain sibling now pause the existing reconciliation-pool operation runner while retaining real operation registration, execution, and drainage. They observe the reconciler's running owner and await its existing drain; no production API or runtime change was added. The explicit timer-retirement and retry-backoff regressions remain intact.

The database non-recreation contract is preserved: temporarily removing only the cleanup owner's state-directory reconciliation drain made the rewritten test fail because reconciliation recreated the fixture directory after cleanup returned. The owner was restored byte-for-byte before the passing shard run.

Validation on Node 24.21.0 (behavioral and static checks preceded the final mechanical rebase; branch review ran on the final head):

  • Full fixture, reconciliation lifecycle, and prior stall regression: 42 tests passed across three files.
  • Exact retained CI subshard core-unit-fast-isolated-hosted-2: 66 files passed; 976 tests passed, 24 skipped, clean process exit. It used the CI runner, isolate: true, and two workers. Five additional host skips versus Linux CI are unavailable PowerShell completion cases; the other 19 match CI.
  • Every changed-check step passed with the authorized nested-checkout extension-lint substitute. Core and extension production/test types passed. All eight guards after extension lint passed.
  • Fresh canary: the injected first-line debugger produced eslint(no-debugger) (plus import-order diagnostics from that deliberate first line), exit 1. Exact original bytes were restored; full extension lint then exited 0 with the same two pre-existing warnings described above.
  • Pre-commit P1 review: scoped-clean. Final autoreview --mode branch --base origin/main --max-priority P1 on 683cb4b09343c950e89e19573a9acba83f66b637: scoped-clean, no accepted/actionable findings.

The four-commit stack is rebased onto main b0b74411163a98e810ad3f07f9f6991f4f1b4063. One adjacent-import conflict retained both the pool import and main's immutable-config fingerprint import. All four commits preserve identical per-file added/removed lines; range-diff differs only in upstream import context. Landing-wrapper files match the pinned anchor, and pnpm install --frozen-lockfile passed after the final rebase. The follow-up is production 0; tests +29 / −19 (net +10). No pool lifecycle or runtime boundary changed, so build and 200-agent measurements remain explicitly prior-head proof.

Prior fixture follow-up head: 683cb4b09343c950e89e19573a9acba83f66b637.

Catalog retirement follow-up

CI exposed two ordering defects on 683cb4b09343c950e89e19573a9acba83f66b637. In prepared-model-catalog-worker.ts, the cache-abort listener escaped before process-lifetime registration completed. Shutdown could reject that registration, leaving its release binding permanently uninitialized; later cache retirement called it at line 213 and emitted the retirement warning. Registration now completes before the listener is exposed. Separately, prepared-model-runtime.catalog-access.ts now checks publication currency before retaining a plugin generation or joining auth work, preserving the typed superseded outcome for stale callers.

The existing rotation test covers both successful publication and shutdown while real native termination is pending. With only the stale-auth guard applied, normal rotation passed and the shutdown case failed specifically on the Cannot access 'release' before initialization warning. After the registration fix, both pass, including zero workers/tasks after shutdown and no retirement warning. No production test seam was added.

  • Focused proof: 53 owner/metadata/lifecycle tests and 3 Gateway auth integration cases passed. An initial concurrent Gateway run hit the existing 120-second cold-start limits; serial runs passed unchanged assertions and deadlines, including initial login in 74 seconds.
  • Exact CI shard: 691 passed, one Linux-only test skipped; 37 files passed, one skipped. The pre-fix shard reproduced the rotation failure and a subsequent fixture-marker wait failure; both passed afterward without changing the queued-deadline test.
  • Every changed-check step passed with the authorized extension-lint substitute: fresh no-debugger canary failed as intended, exact original bytes were restored, full extension lint passed with the same two existing warnings, and all eight remaining guards passed.
  • Fresh pre-commit and final autoreview --mode branch --base origin/main --max-priority P1 reviews: scoped-clean.

The retirement follow-up is production +4 / −2 (net +2), tests +115 / −43 (net +72). It rebased patch-identically onto main 5a7843743b0463e249df338c93514bc028acbe82; the older auth commit shrank because its production fix was already on main. Previously touched source stayed byte-identical except for main's independent startup cron-argument change. Scripts and dependency manifests match the pinned anchor, and the final frozen install passed. Behavioral/static proof preceded the rebase; final branch review covered the rebased head. No imports, worker payloads, serialization boundaries, capacity, or normal pool reuse policy changed in this repair, so build and RSS evidence remain explicitly prior-head proof.

Current head: 40cdb969512cdf299e0d11f0a8caba91e6d6f8c5. Exact-head CI status is available in the PR checks.

ClawSweeper review disposition

Reviewed ClawSweeper revision 2 on a7eb51d79a4429edbbc7fafd74258176a550204d: no concrete introduced correctness defect or actionable code finding was identified.

The published-updater transition rank-up move is skipped for this candidate under the maintainer-directed landing scope. This records a candidate-specific validation exception, not passing upgrade evidence: the v2026.9.4 updater → candidate restart/session-continuity transition was not run. The landing evidence is the measured 200-agent runtime improvement, preserved searchable rows and clean shutdown, worker-lifecycle regressions, repeated auth integration proof, and required exact-head CI. No schema, persistence-format, config, CLI, or dependency change is introduced; the remaining uncertainty is the installed transition across the changed worker/shutdown lifetimes.

The 632-agent Linux incident and allocator retention remain outside the measured claim. The four early health-probe deadlines remain disclosed above. This PR addresses the constructor-attributed post-ready worker-memory component of #149538 and does not claim to resolve every fleet startup or allocator symptom.

@clawsweeper

clawsweeper Bot commented Sep 16, 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 agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 22:39
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 1:00 AM ET / 05:00 UTC (Revision 6).

ClawSweeper review

What this changes

Shares model-catalog and transcript-reconciliation workers across Gateway agents, preserves task-specific state and cleanup, and exposes worker-pool diagnostics.

Merge readiness

✅ Ready for maintainer review

This remains a useful, distinct fix for fleet-wide worker retention. No actionable introduced defect was found; the recorded lifecycle corrections address the latest failures, and the documented validation exception does not warrant another proof blocker.

Priority: P1
Reviewed head: 40cdb969512cdf299e0d11f0a8caba91e6d6f8c5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused ownership repair with convincing fleet measurements and lifecycle coverage; no blocking correctness finding remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The matching captured body documents real Gateway execution with 200 agents, constructor attribution, reduced post-ready RSS growth, preserved searchable rows, and clean shutdown. Later scheduler and retirement corrections have targeted failure/recovery evidence; the RSS figures remain prior-head measurements, and the published-updater transition has an explicit candidate-specific maintainer exception.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The matching captured body documents real Gateway execution with 200 agents, constructor attribution, reduced post-ready RSS growth, preserved searchable rows, and clean shutdown. Later scheduler and retirement corrections have targeted failure/recovery evidence; the RSS figures remain prior-head measurements, and the published-updater transition has an explicit candidate-specific maintainer exception.
Evidence reviewed 9 items Pinned patch and merge ownership: The verified test merge records main 68663e6 followed by head 40cdb96. Its comparison against main contains the introduced worker-pooling changes, without the unrelated main-only Codex, CI, and Gateway maintenance changes.
Current main still retains separate catalog workers: Current main creates a pool inside each catalog-worker owner, with idle retirement disabled. The branch introduces the shared Gateway inventory owner; the related merged scheduling and auth fixes do not supply this pooling behavior.
Complete captured proof body inspected: The retrieved body matches the supplied snapshot exactly: 22,324 UTF-16 units, SHA-256 0bc0ca4e89232ea8114aa7c91a68ee7a5ee5ff39f452022d4abb95b54623d6f7. Its real 200-agent Node 24.21 Gateway comparison reports post-ready RSS growth falling from 2,144.7 to 250.5 MiB, preservation of 1,600 searchable rows, and clean shutdown. Measurements belong to 03f9ef2, not the final head.
Findings None None.
Security None None.

How this fits together

The Gateway prepares model catalogs and repairs searchable transcript indexes for configured agents. These background workers consume agent-specific credentials or transcript data and return catalog results or projection changes to their existing owners.

flowchart TD
  A[Configured agents] --> B[Catalog tasks and credentials]
  A --> C[Dirty transcript indexes]
  B --> D[Shared catalog worker]
  C --> E[Shared reconciliation worker]
  D --> F[Current model catalogs]
  E --> G[Guarded transcript writes]
  D --> H[Pool diagnostics and shutdown]
  E --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +512, Tests +981, Docs +31. Total +1524 across 35 files.

View PR surface stats
Area Files Added Removed Net
Source 13 712 200 +512
Tests 19 1319 338 +981
Docs 3 33 2 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 35 2064 540 +1524

Review metrics

Metric Value Why it matters
Worker retention 200-agent proof: catalog workers 7 → 1; reconciliation workers 200 → 1 Constructor-attributed prior-head measurements directly support the intended fleet-memory improvement.
Production versus test growth Production net +512 lines; tests/support net +981 lines Production growth implements shared recovery and shutdown ownership, with regressions covering isolation and settlement.

Technical review

Best possible solution:

Keep fleet-wide worker ownership bounded while preserving per-agent catalog facts, guarded transcript writes, and complete shutdown settlement.

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

Yes: current main retains a catalog-worker pool per agent, and the recorded real Gateway fleet comparison demonstrates the resulting worker and RSS growth. This read-only review did not rerun that workload.

Is this the best way to solve the issue?

Yes: moving worker lifetime ownership to the fleet level directly addresses the measured retention while reusing existing publication, write, and lease owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 68663e6c648a.

Labels

Label justifications:

  • P1: The linked fleet incident reports post-ready memory growth and loss of Gateway responsiveness affecting an existing deployment.
  • 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): The matching captured body documents real Gateway execution with 200 agents, constructor attribution, reduced post-ready RSS growth, preserved searchable rows, and clean shutdown. Later scheduler and retirement corrections have targeted failure/recovery evidence; the RSS figures remain prior-head measurements, and the published-updater transition has an explicit candidate-specific maintainer exception.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching captured body documents real Gateway execution with 200 agents, constructor attribution, reduced post-ready RSS growth, preserved searchable rows, and clean shutdown. Later scheduler and retirement corrections have targeted failure/recovery evidence; the RSS figures remain prior-head measurements, and the published-updater transition has an explicit candidate-specific maintainer exception.

Evidence

What I checked:

  • Pinned patch and merge ownership: The verified test merge records main 68663e6 followed by head 40cdb96. Its comparison against main contains the introduced worker-pooling changes, without the unrelated main-only Codex, CI, and Gateway maintenance changes. (a157dd4ba297)
  • Current main still retains separate catalog workers: Current main creates a pool inside each catalog-worker owner, with idle retirement disabled. The branch introduces the shared Gateway inventory owner; the related merged scheduling and auth fixes do not supply this pooling behavior. (src/agents/prepared-model-catalog-worker.ts:280, 68663e6c648a)
  • Complete captured proof body inspected: The retrieved body matches the supplied snapshot exactly: 22,324 UTF-16 units, SHA-256 0bc0ca4e89232ea8114aa7c91a68ee7a5ee5ff39f452022d4abb95b54623d6f7. Its real 200-agent Node 24.21 Gateway comparison reports post-ready RSS growth falling from 2,144.7 to 250.5 MiB, preservation of 1,600 searchable rows, and clean shutdown. Measurements belong to 03f9ef2, not the final head. (03f9ef225b3e)
  • Re-review dispositions and validation limits: The matching full body explicitly records a candidate-specific maintainer exception for the published v2026.9.4 updater transition. It also reports failing-before/passing-after scheduler and retirement regressions, including native termination during shutdown. The reporter's 632-agent Linux outcome and final-head RSS remain outside the measured claim; these historical limitations are not newly discovered findings. (40cdb969512c)
  • Catalog isolation and retirement: The shared pool retains inventory-owned source captures while task envelopes carry agent/auth facts. Dispatch checks publication currency, queued stale borrowers reject without poisoning siblings, and process-close registration precedes cache-retirement subscription. The new integration coverage exercises separate agent credentials, queued retirement, source replacement, deadlines, and shutdown during native termination. (src/agents/prepared-model-catalog-worker.ts:159, 40cdb969512c)
  • Transcript write and lease settlement: Reconciliation tracks complete accepted operations, closes admission before drainage, and permits their exact lease-recovery tasks to finish. Parent handlers retain the existing guarded SQLite writer path; worker failure settlement precedes recovery and Gateway resource retirement. (src/config/sessions/session-transcript-reconcile.ts:451, 40cdb969512c)

Likely related people:

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

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-16T22:48:57.211Z sha 03f9ef2 :: blocked before merge. :: none
  • reviewed 2026-09-17T00:06:46.000Z sha a7eb51d79a4429edbbc7fafd74258176a550204d :: blocked before merge. :: none
  • reviewed 2026-09-17T00:18:09.213Z sha a7eb51d79a4429edbbc7fafd74258176a550204d :: blocked before merge. :: none
  • reviewed 2026-09-17T03:12:17.134Z sha 92589e36bfa06d5e6f34a4a17b450b334e8d8dc6 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T03:59:47.472Z sha 683cb4b :: blocked before merge. :: none

@steipete
steipete requested a review from a team as a code owner September 16, 2026 23:58
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 17, 2026
@steipete
steipete force-pushed the upd/fleet-postready-worker-rss branch from 239ffb8 to 92589e3 Compare September 17, 2026 03:00
@fuller-stack-dev

Copy link
Copy Markdown
Member

Coordination for #150026 required-CI repair: head c4787b7890e4959c4cd1b797f53ef181a9f30a3e failed large-29 job105058163717 in models-auth-login.catalog.integration.test.ts: the 7000-ms endpoint case reports “Login did not start automatic catalog discovery” at the existing 10000-ms synchronization bound. The 0-ms case passed and observed its automatic request about 3207 ms after login. Current main has the same login-refresh owner and fixture.

Your existing auth-publication/fresh-shared-store changes touch that exact owning chain. I am inspecting those existing corrections for prerequisite reuse, not editing your branch or duplicating the pool work. The test timeout, latency assertion, and single-discovery assertion remain unchanged. I will prefer your canonical correction and keep its provenance; a separable published auth correction can be consumed without pulling unrelated pool changes into the channel repair.

fuller-stack-dev added a commit to LiuwqGit/openclaw that referenced this pull request Sep 17, 2026
Apply the independent auth correction from published security-owner commit
2721b8bbc6530944c75a35283839fdf0c9020176 (PR openclaw#150354).
Preserve runtime snapshot ownership through fresh shared-store bootstrap and
join actual credential publication instead of fabricating another mutation.
Leave worker pooling and its pool-count fixtures to the source PR. Existing
catalog integration timeouts and assertions remain unchanged.

Co-authored-by: Peter Steinberger <[email protected]>
@steipete
steipete force-pushed the upd/fleet-postready-worker-rss branch from 92589e3 to 683cb4b Compare September 17, 2026 03:50
steipete added a commit that referenced this pull request Sep 17, 2026
Use Node's native promise timers for reconciliation yields and backoff so
caller timer cleanup cannot strand accepted operations in the pool drain.
Preserve the existing write and lease cleanup order, and cover the failure
with a real projection-rebuild and shutdown regression.

Thanks to @609NFT for the fleet-memory report behind #149538 and #150354.
Reuse one configured Gateway catalog worker per plugin inventory and one
transcript reconciliation worker across dirty agent databases. Preserve
source and auth generations, exact leases, and shutdown settlement while
reporting pool capacity from the owning lifecycle.

Thanks to @609NFT for the memory measurements and constructor-attributed
rerun in #149538. The 200-agent fixture reduces RSS at readiness +120s from
3619 MiB to 1844 MiB, with no post-ready worker creations after pooling.
Remove the forced mutation after auth refresh and hand existing runtime
snapshots to the freshly initialized shared-store owner before credential
persistence. Preserve external overlays and bindings across a failed first
credential write so the retry uses the committed owner.

Both catalog integration files pass ten repetitions on Node 24 (30 case
executions), alongside 242 focused tests. Worker-pool lifecycles are unchanged.
Use Node's native promise timers for reconciliation yields and backoff so
caller timer cleanup cannot strand accepted operations in the pool drain.
Preserve the existing write and lease cleanup order, and cover the failure
with a real projection-rebuild and shutdown regression.

Thanks to @609NFT for the fleet-memory report behind #149538 and #150354.
Keep fixture cleanup and scoped-drain regressions independent of timer
scheduling while preserving the database non-recreation contract.
Register process cleanup before subscribing to cache retirement so refused
admission cannot leave a listener with an uninitialized release callback.
Reject stale auth calls before retaining plugin resources or joining work.
Exercise both normal rotation and shutdown during native worker retirement.
@steipete
steipete force-pushed the upd/fleet-postready-worker-rss branch from 683cb4b to 40cdb96 Compare September 17, 2026 04:51
@steipete
steipete merged commit 349aef7 into main Sep 17, 2026
211 of 213 checks passed
@steipete
steipete deleted the upd/fleet-postready-worker-rss branch September 17, 2026 05:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…0354)

Bound Gateway post-ready memory growth on large fleets by sharing one catalog worker and one transcript-reconciliation worker across configured agents. Preserve task-specific credentials, source generations, guarded transcript writes, exact lease recovery, and complete shutdown drainage. Expose owner-recorded worker-pool diagnostics without new operator settings.

Keep duplicate catalog discovery removed through the credential snapshot handoff and publication joining already integrated on main via openclaw#150026, with pool-level request-count integration coverage. Register catalog worker retirement before installing its listener, and reject stale publication before retaining generations or joining auth work.

Related: openclaw#149538. Thanks to @609NFT for the fleet measurements and constructor-attributed rerun that identified retained catalog isolates.

Validation: exact-head CI passed for 40cdb96 (https://github.com/openclaw/openclaw/actions/runs/35183530133); the authorized review of record and exact-head ClawSweeper review found no actionable defects. Recorded 200-agent prior-head measurements reduced post-ready RSS growth from 2144.7 to 250.5 MiB while preserving 1600 searchable rows and clean shutdown. Later lifecycle corrections have targeted regression proof. The candidate-specific published-updater transition remains explicitly excepted; final-head RSS and the reporter's 632-agent Linux allocator outcome are outside the measured claim.
obviyus added a commit that referenced this pull request Sep 18, 2026
## What Problem This Solves

Model discovery with a custom `agentDir` inferred the wrong database owner and rejected saved credentials before discovery. Refs #150354.

## Why This Change Was Made

Restore captured identity in the existing registry. The other writer of this state is agent-directory resolution; serialized worker requests remove only membership they added. Existing holders and database-owner checks remain intact.

## User Impact

Custom-directory agents can list models without moving data or changing selection.

## Evidence

- `node --import tsx scripts/ci-run-node-test-shard.mts`: pinned-main worker tests failed four custom cases; default passed. Candidate: 29/29 selected cases passed.
- An older package failed installed discovery; the new canonical package passed `models auth paste-api-key --agent main` → authenticated Gateway `models.list` in a custom directory.
- Eight source checks and native type/lint/protocol preflight passed.

## Compatibility

No schema, config, protocol or public SDK change; no migration.

## Consumers

Existing registry callers ignore the insertion result. Gateway and standalone requests share the handler.

## Invalidation

Request-added membership ends on success or failure; existing membership survives.

## Tests

Real workers cover two path shapes, isolation, rejection and reuse. Installed proof preserves profiles/config/selection; no inference calls.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…1458)

## What Problem This Solves

Model discovery with a custom `agentDir` inferred the wrong database owner and rejected saved credentials before discovery. Refs openclaw#150354.

## Why This Change Was Made

Restore captured identity in the existing registry. The other writer of this state is agent-directory resolution; serialized worker requests remove only membership they added. Existing holders and database-owner checks remain intact.

## User Impact

Custom-directory agents can list models without moving data or changing selection.

## Evidence

- `node --import tsx scripts/ci-run-node-test-shard.mts`: pinned-main worker tests failed four custom cases; default passed. Candidate: 29/29 selected cases passed.
- An older package failed installed discovery; the new canonical package passed `models auth paste-api-key --agent main` → authenticated Gateway `models.list` in a custom directory.
- Eight source checks and native type/lint/protocol preflight passed.

## Compatibility

No schema, config, protocol or public SDK change; no migration.

## Consumers

Existing registry callers ignore the insertion result. Gateway and standalone requests share the handler.

## Invalidation

Request-added membership ends on success or failure; existing membership survives.

## Tests

Real workers cover two path shapes, isolation, rejection and reuse. Installed proof preserves profiles/config/selection; no inference calls.

Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Oct 11, 2026
## What Problem This Solves

Agent runtime bookkeeping repeatedly restarted otherwise valid work when configuration, plugin, or catalog metadata changed during an asynchronous operation. This maintainer-requested simplification removes that speculative retry machinery.

## User Impact

Normal model selection, tool execution, credential checks, FIFO scheduling, and shutdown settlement remain. A request racing a reload may fail visibly and be retried by the caller; passive metadata may remain at its captured version until the next refresh. No configuration, protocol, SDK, schema, durability, retention, or permission contract changes.

## Why This Change Was Made

Prepared runtime acquisition and remote catalog adoption now take one preparation path rather than repeatedly rebinding and rebuilding. Admission still handles the concrete drain, retirement, and failed-activation recovery stages. Cache publication keeps its final currentness check; tool and credential effects keep their authority checks. Steering and Tool Search retain their actual owner, FIFO, and settlement contracts without comparing unrelated metadata.

Production: **519 net lines removed**. Tests that exclusively required the removed synthetic interleavings were removed with them. Open-parent borrowing, pending-auth cancellation, explicit MCP acquisition config, and queued-tool implementation checks remain. No new lint suppressions, timeouts, retries, or skips were added.

Scope proof also caught two nearby correctness issues: an earlier MCP reload could overwrite a new caller's explicit configuration, and snapshot reconciliation could prepend a separator to a later text block. Both are fixed with their existing boundary tests. Bootstrap fixtures now test the no-clobber fallback already shipped by the pinned fs-safe version; no dependency or storage policy changed.

## Best-effort tradeoffs accepted

| Removed guard | Provenance and accepted result |
| --- | --- |
| Per-batch context projection cancellation | #119607 measured the value of cooperative yielding; its mid-batch cancellation callbacks were synthetic coverage. Yielding and the final publication check stay; obsolete pure computation may finish unused. |
| Mixed-version module/cache repair | #119607 seeded an old global singleton inside a synthetic process. Normal upgrades restart the process; unsupported mixed-version module replacement no longer repairs that marker. |
| Runtime acquisition retry/rebind loop | #128138/#127217 exercised forced reload timing. A racing request now returns a visible supersession error; the next request uses the current owner. The actual no-spin incident in #153313 remains addressed. |
| Configured-generation re-admission | 171df4e / #168410 adds re-admission for a gated Docker reproduction with a catalog publication 0.3s after admission, not a human-user incident. A superseded request now fails visibly. Parent confinement remains fail-closed, with its security test retained. The retry-only WeakSet and two retry-specific tests are removed. |
| Repeated passive owner selection | a718c1c / #162484 added recursion alongside the real self-drain fix; that incident did not require recursive reselection. The self-drain refusal stays. Reads use one captured owner or fail visibly, rather than recursively trying later publications. |
| Remote catalog config reread/per-attempt cancellation | #158000 used synthetic config/auth churn. Adoption reads once and prepares once; an overlapping change can defer adoption until the next normal catalog check. |
| Parent-generation cancellation subscriptions during adoption | 504d290 / #158000 used the same synthetic churn. Parent replacement may leave bounded preparation running until its final owner/config check rejects it. Shutdown cancellation, candidate-retirement aborts, cleanup, and the final serialized effect check remain. |
| Three-attempt catalog adoption settlement recovery | The same synthetic churn caused a second retry protocol around owner publication. One attempt remains, with one final checked atomic rows/pricing commit. |
| Duplicate early publication checks/error relabeling | Same-tick checks and concurrent-change relabeling did not guard an effect. The final effect check stays; failures retain their actual reason. |
| Auth-batch sibling retry after supersession | f3c52bd / #152467 used synthetic tests that superseded one owner during a sibling build. The operation now settles with its original error instead of selectively rebuilding siblings. Credential authority checks remain. |
| Post-await cache-stale generation check | No human incident supports fencing this metadata flag. A config/auth change during discovery can let the older load clear a reused owner's stale marker; discovery may remain stale until another explicit refresh/reload. This does not grant credentials or execution authority. |
| Passive harness catalog cancellation | #134524 fixed the actual availability report #134460; replacement/closure guards were additional synthetic hardening. Completed discovery rows are retained, and later discovery observes replacement. |
| Native binding clock-only rechecks after worker waits | #158396 used clock-jump fixtures. An expired but unreplaced exact row can finish its prepared bookkeeping mutation; CAS takeover detection and current mutation authority still gate commit. One exact, unexpired lease check gates protected callback entry, and live effect assertions remain. |
| Tool Search ancestor reentrancy tracking | #140767 covered synthetic nested control calls, not a reachable production control target. FIFO/exclusion and real implementation settlement remain. |
| Complete steering metadata fingerprint | #163195 recorded a real production ordering/ownership incident. Its owner, pending-row, result-authority, and lease checks stay; metadata-only edits no longer invalidate already-captured prompt bytes. |
| Repeated MCP acquisition/reload replay | #138694 used synthetic crossed-publication choreography. A new runtime catches up once; later reloads target the published owner. A racing creation can fail and reconnect on the next acquisition. |
| MCP tools/list invalidation generations and replay | #125541/#125564 describe isolated protocol stress fixtures. A notification inside tools/list no longer triggers immediate replay; the next notification or explicit refresh replaces the inventory. Normal exit/reconnect, bounds, validation, and cleanup remain. |
| Failed-start replay crossed by config publication | #158088's test forces a config publication into an in-flight failed initialization. That request may now report its first failure; ordinary backoff and explicit-refresh retry remain. |

## Evidence

Candidate head: `d72afea0c17a45c677977e23937049d7c7fc43ec` (tree `51daca08d7288e906188bc25ec3d1896bf841349`).

Final exact-head CI: [run 38132644989](https://github.com/openclaw/openclaw/actions/runs/38132644989) completed successfully; all 82 jobs terminal with no failed or cancelled jobs. Full head-bound check census also confirms the CI gate and applicable security checks passed. Earlier failed/cancelled attempts are described below, not represented as passing proof.

- Independent P2 reviews completed. The catalog-staleness, duplicate steering metadata fingerprint, and auth-sibling retry findings are explicitly accepted tradeoffs listed above; steering result facts and destination eligibility remain checked at their owners. The latest native-lease callback-entry finding was accepted and fixed with one live lease check instead of restoring per-write expiry callbacks. Its new fake-clock regression failed before the fix by entering the protected callback after expiry.
- Conflict-only integration kept main's three repaired test fixtures byte-for-byte. All **22 conflict tests** passed (cursor, sandbox, bootstrap publication, lint suppressions); affected root/tools test graphs, core types, typed lint and both cycle checks passed. Runtime and Madge cycles remain **0**.
- The native callback-entry fix passed fresh P2 review and **24 focused tests** (21 native binding tests plus 3 lint-suppression tests), wrapper 212.01s; native test project 164.77s including 113.11s compiled-worker preparation. The added fake-clock case performs no real wait; the existing native suite exercises authority and worker settlement. Final affected types and typed lint are checked before push.
- CI run `38125430266` found one owned stale expectation: the remote-catalog integration still forced config/auth replacement while pricing was paused and demanded the removed immediate retry. Only that scenario was removed; both schema variants retain normal publication, pinned pricing, input validation, worker recovery and disable coverage and pass locally (141.35s project), with gateway test types, typed lint, lint suppressions (3/3), and fresh P2 review passing.
- The other root failure, `checks-node-changed-compact-small-11`, independently reproduced on clean main `fd1fd2ce0ef8cb7e9c4074c8f855eff8992a54c2`: `embedded-agent-runner.prompt-cache.test.ts` responses and in-history both raised `SqliteTranscriptMutationConflictError` in the session actor append path (2 failed / 2 passed). Investigation found a cold actor snapshot prevented the existing implicit-watermark retry. Fixed directly on main as `e65bd3be4134f1453bb4ab26e68704c678086b58` and integrated here: all 4 prompt-cache cases and 35 session-manager siblings plus lint-suppressions pass, including explicit stale rewrite refusal. The repair passed types, typed lint and fresh P2 review.
- Follow-up CI `38127338915` reached one more synthetic-only case: compaction's `mutate=input` row changes an internal selection object after starting acquisition. Removed only that row/branch under the campaign rule; five remaining compaction cases pass, along with lint-suppressions, affected types, typed lint and fresh P2 review. Its provenance is `c131ec041e1` / #139429, not a human report of post-call input mutation. The final conflict repair keeps main's equivalent streaming/steering refactors, removes the obsolete retry predicate, and passes 49 owner tests plus lint-suppressions. Cancelled jobs are not counted as passing; final-head hosted CI remains the gate. No CI job was rerun.
- CI `38130432441` had one inherited fixture failure: three `sessions-mutations.catalog-queue` cases selected their configured default while expecting override fields, after #169030 intentionally made that selection a default reset. Integrated main's existing fixture-only correction `194a08e59632`, retaining all assertions. The corrected file passes all 14 cases on clean main under Node and Bun; the three affected cases also pass under Bun on this branch (249.87s project, mostly transformation). Exact-head hosted CI remains the final gate.
- Focused effects suites: **43 passed** across inbound-registry, remote-publication, hot-reload-dispatch and tool-search-scheduling. This includes cancellation, parent confinement, ordinary rollback/failed-activation recovery, and queued implementation replacement. Single-worker wrapper 752.15s including 142.017s compiled-worker preparation; infra 432.15s and agents-core 115.09s. Final restored remote-publication file: **7 passed**, including first reply crossing catalog adoption and exact derived-parent confinement; wrapper 372.77s (184.30s worker preparation; 131.87s Vitest). These loaded-host timings are not a performance claim.
- Integrated native-binding suites: **20 passed**, including exact token cleanup, successor protection, and revocation. The same command passed all **3 lint-suppression tests**. Single-worker wrapper 354.47s including 145.31s worker preparation.
- Current core types and native-binding test graph passed; runtime cycles **0**, Madge cycles **0**; changed-file typed lint passed. The full changed-check run reached an old-base UI duplicate-import error already fixed on main by `48588a65222`; that fix was integrated and the affected UI graph passed. Remaining type graphs and static guards were completed separately without changing baselines.
- Isolated Linux scope run and canonical remaining projects exercised **19,900 passing tests**. Eight failures were investigated: three pinned removed synthetic retry paths and were deleted; five exposed the correctness/fixture issues described above and were repaired with focused proof. Existing platform skips were unchanged. This is combined incremental proof, not a claim that one final-head all-scope invocation was green.
- Final repair suites: **71 passed** across passive runtime, SSE recovery, startup backoff, bootstrap, stream reconciliation/markup/phase coverage; **12 passed** across sandbox/cursor coverage, followed by **2 passed** for the real-append cursor fixture. Final MCP regression retained stdio-exit recovery and HTTP failure semantics; it passed 64 cases but hit two unchanged local child-start deadlines (1s/2s). Those initial-start paths passed on the isolated Linux run; no timeout, retry, or skip was changed to mask the local failures.
- Full-core Linux lint passed with 13 existing max-lines warnings, none in changed files. Deadcode identified and drove removal of the unused owner-publication helper. Remaining findings were in unmodified config/state/Gateway/UI files. A separate fresh current-main checkout (`f4d601a006`) passed production deadcode and failed full-tree deadcode only on the unrelated `readActiveGatewayLockPortMock` export. The PR does not change any deadcode baseline.
- Blacksmith Testbox did not admit a runner within 15 minutes; AWS quota pressure supplied an undersized instance, which was released. The authorized Hetzner fallback supplied the Linux proof above. All owned remote leases are stopped. Hosted CI on the exact final head remains the landing gate; no CI jobs were rerun.

<details>
<summary>Audit coverage ledger and retained boundaries</summary>

| Mechanism (base lines) | Scenario and provenance | Decision |
| --- | --- | --- |
| context-cache-projection.ts:145-213, context.ts:87-109,146-169 | Cancellation/replacement during pure batched metadata computation. bf7840f / #119607 fixed a measured multi-second RPC stall by yielding and atomic publication. Mid-batch authority callbacks were extra cancellation machinery; no effect occurs in projection. | REMOVE repeated projection/early checks; KEEP cooperative yields and the caller's check immediately before publication. |
| context-runtime-state.ts:33-38 | bf7840f / #119607 seeds an old global singleton and new cache module in a synthetic child process; no human report of mixed code versions within one live process. | REMOVE old-module/cache-pair normalization, its only reuse flag, and the synthetic migration test. Ordinary process startup and same-version bundled singleton sharing remain. |
| prepared-model-runtime-lease.ts:149-164 | 8720fbf / #153386. Human report #153313 by stackingrockss includes the deployed Docker version, profiler samples, and repeated boot-loop observations. Its infinite retry was caused by non-idempotent runtime selection normalization. | KEEP normalized owner selection and a visible error when a settled replacement never published; REMOVE the acquisition retry loop entirely, so it cannot spin. |
| prepared-model-catalog-worker.ts:71-220 | 349aef7 / #150354. Human report #149538 by 609NFT describes copied production fleet state, 632 agents, 504 failed health probes and growing RSS. #161738 by matthematics1137 reports 92 worker lifetimes, OOMs and 1.285 TB written. | KEEP one bounded shared worker, borrower cleanup, failure logging, and ordinary crash recovery. These are measured resource and real concurrency contracts, not permission to retain unrelated reload fences. |
| prepared-model-runtime.refresh-scope.ts:240 | d56279c / #151597 by obviyus describes a controlled worker crash and synthetic Gateway regression, not a human production report. Later #161738 independently establishes actual recurring worker failures. | KEEP source-bound failure reporting and bounded recovery to avoid reintroducing the observed restart/discovery amplification. The #151597 PR alone is not accepted incident evidence. |
| prepared-model-runtime.resources.ts:30-127 | 73b4086 / #143109 contains native regressions and synthetic compiled CLI/Gateway proof, no linked human incident. | KEEP physical resource claims until ordinary concurrent borrowers settle and shutdown joins their cleanup; these are required cleanup mechanics, not a blanket historical-incident exemption. Inspected the complete resource owner; no extra reload retry protocol lives here. |
| prepared-model-runtime.plugin-lifetime.ts:230-319 | 382c987 / #159448 links #157842 by highfly-hi: five-agent Linux deployment with catalog-worker heap increasing 70-80 MB per scheduled turn, watchdog restarts and before/after version evidence. | KEEP final registry-reference release, current execution authority, and ordinary borrowed-resource settlement. Retained memory claims are scoped to physical lifecycle, not all historical publication machinery. |
| prepared-model-runtime.lifecycle.ts:101-164 | a718c1c / #162484 by jalehman records actual lossless-claw maintenance calls stuck about 45 minutes during reload until restart. a3e4005 / #162301 explicitly says synthetic Gateway, no production deployment. | KEEP refusal of plugin work waiting on its own drain and process-close settlement. #162301 is synthetic evidence, not an independent incident exemption. |
| prepared-model-runtime-lease.ts acquisition loop and borrowed-generation branch | 79e6755 / #128138 and related #127217 describe synthetic QA-channel/config replacement tests; #127217 explicitly reports that its pre-fix real-Gateway run still delivered replies. Retained inbound-registry tests exposed ordinary nested selected-parent borrowing as a distinct contract. | REMOVE retry/rebind loop. KEEP exact open-parent borrowing and selection confinement; a reload during new acquisition may fail that request visibly. |
| prepared-model-runtime.published-owner.ts:91-203 | a718c1c / #162484 added retry/recursive rereads alongside the real plugin-drain repair. That incident justifies self-drain refusal and ordinary settlement, not recursive passive owner reselection. | REMOVE repeated rereads/retries; wait once, then project or activate once. Pure catalog-stale bookkeeping no longer revalidates generation after its await. |
| prepared-model-runtime.configured-refresh.ts remote catalog adoption | 504d290 / #158000 has explicitly synthetic config/auth churn and fixture-provider proof; no human incident cited for the reread loop, per-attempt controllers or three-attempt owner settlement recovery. | REMOVE those race-specific retries, plus early duplicate currentness checks/error relabeling. KEEP the final owner/authority check, atomic rows/pricing commit, current catalog ordering, and ordinary cancellation/disposal. |
| prepared-model-runtime.configured-refresh.ts:396-430 parent subscriptions | 504d290 / #158000; same synthetic churn proof. Parent-generation subscriptions duplicate the final owner/generation/config check. | REMOVE parent-generation early cancellation listeners. KEEP shutdown and candidate-retirement cancellation, bounded work, cleanup, and the final serialized effect check. |
| prepared-model-runtime.owner.ts:612-631 batch supersession retry | f3c52bd / #152467. Tests force one auth owner to supersede while a sibling is building. No independent human incident identified for sibling retry. | REMOVE retry of the surviving batch; retain source-bound credential/current-owner checks and report the original publication failure. |
| prepared-model-runtime.owner.ts:124-134 unused publication probe | dd2d66c / #130856 introduced a helper returning matching/pending publication facts for acquisition retries. Its callers are gone; full-repository search finds only the definition. | REMOVE the dead helper/export. Credential-refresh cancellation remains supported by the direct, abortable configured-owner wait and its unchanged regression tests. |
| sandbox/registry.kernel.ts:396,420; sandbox/registry.ts:295 | 2889a99 / #151172 is not treated as an incident report. Read-only admission accepts older schemas; tableExists consumes admitted schema.tables facts, not repeated SQL/format validation. | KEEP the existing absent-table empty/null contract. No runtime foreign-commit or repeated validation probe exists in these calls. |
| harness/native-session/binding-leases.ts | cfef174 / #158396 moved writes to workers; elapsed-time rechecks were covered by synthetic clock-jump tests. 283d5e6 / #164197 supplies native successor authority behavior, not a blanket exemption. | REMOVE prepared callback plumbing and post-worker wall-clock-only rechecks. KEEP exact-row CAS, token/phase/failure checks, current mutation authority, bounded acquisition, renewal, and write settlement. |
| harness/context-engine-logical-turn.ts | #143491/#140023 supply synthetic lifecycle tests, not qualifying human incident evidence. The owner actually holds resources used by outstanding context-engine work. | KEEP ordinary work completion and deferred disposal until implementation settlement; no extra synthetic reload retry was retained here. |
| harness/model-catalog.ts:168-177,242-284,353 | 6c44634 / #134524 repairs human availability report #134460. Passive replacement/closure branches were additional maintainer hardening and synthetic variants, not that report's failure. | REMOVE passive isCurrent callbacks and ambient registry replacement checks. KEEP exact owned registry/config, provider outcomes, discovery, selection and the actual availability repair. |
| auth-profiles/oauth-refresh-peers.ts | #166183/#167002/#166659 are not claimed as human incident evidence. Refresh credentials rotate/revoke and carry account identity; copied historical peers must not replay spent tokens or inherit another account. | KEEP these credential/identity effect boundaries and ordinary uncertain-write settlement. No auth-profile schema, secrets, permissions or durability changes. |
| worktrees lifecycle/removal | Audited run-lease-owner.ts, service-preparation.ts, eviction.runtime.ts and gc-removal.ts. They coordinate destructive removal of user artifacts with live checkout/source handles, exact refs and ordinary parallel sessions. No PR title is treated as incident evidence. | KEEP current-row removal/exclusive source checks and rollback/cleanup custody for writes and deletion. Removing them would risk user artifacts, independently prohibited by the data-loss boundary. |
| tool-search-scheduling.ts | 9b93fc8 / #140767 adds ancestry reentrancy and queued object/mode identity checks with automated interactive/headless regressions. Production catalogs exclude control tools; recursive calls using the same runtime were synthetic only. | REMOVE unreachable nested-call ancestry. KEEP one exact queued implementation/mode check at the effect, catalog-ID authorization, FIFO/exclusion, abort and implementation settlement. |
| agent-steering-queue.ts:194-263 | 3f761a8 / #163195 records Peter's actual three-day production errors. The incident justifies owner/FIFO repair, not a fingerprint of every result label/task/time/outcome/origin/transcript field. | REMOVE full payload fingerprints and deep-equality invalidation. KEEP run-owner identity, prepared result authority, current requester store, pending-row effect checks, FIFO, exact lease/status acknowledgment and release. |
| agent-bundle-mcp-manager.ts and manager-install.ts | 89c1a09 / #138694 reports synthetic fail-before/real-transport proof but no cited actual-use incident for repeated crossed-publication acquisition/reload. | REMOVE the acquisition retry/rebind loop and repeated reload replay. KEEP the runtime-key queue, ordinary cleanup, one postcreation config catchup, requester credentials/authorization and live tool effect checks. |
| agent-bundle-mcp-runtime.ts catalog generations | 1cf8ea4 / #125564 and follow-up 1d03e5d / #167642 have synthetic notifications/listing interleavings, not human reports for replaying tools/list during its own response. | REMOVE catalog invalidation generations, replay of a notification arriving inside tools/list, and the impossible repeated replacement-retirement loop. KEEP listing single-flight, caching, bounds, diagnostics, normal reconnect, one retry for an actually exited previously healthy server, and execution authority. |
| prepared-model-runtime-lease.ts / plugin-lifetime.ts configured-generation re-admission | 171df4e / #168410, landed during this lane, describes a gated Docker reproduction with catalog publication 0.3s after admission, not an actual human-user incident. | REMOVE configured-generation retry and its now-unused WeakSet plus the two retry-only tests. KEEP fail-closed superseded-generation rejection and the new derived-parent confinement security test. |

</details>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…168981)

## What Problem This Solves

Agent runtime bookkeeping repeatedly restarted otherwise valid work when configuration, plugin, or catalog metadata changed during an asynchronous operation. This maintainer-requested simplification removes that speculative retry machinery.

## User Impact

Normal model selection, tool execution, credential checks, FIFO scheduling, and shutdown settlement remain. A request racing a reload may fail visibly and be retried by the caller; passive metadata may remain at its captured version until the next refresh. No configuration, protocol, SDK, schema, durability, retention, or permission contract changes.

## Why This Change Was Made

Prepared runtime acquisition and remote catalog adoption now take one preparation path rather than repeatedly rebinding and rebuilding. Admission still handles the concrete drain, retirement, and failed-activation recovery stages. Cache publication keeps its final currentness check; tool and credential effects keep their authority checks. Steering and Tool Search retain their actual owner, FIFO, and settlement contracts without comparing unrelated metadata.

Production: **519 net lines removed**. Tests that exclusively required the removed synthetic interleavings were removed with them. Open-parent borrowing, pending-auth cancellation, explicit MCP acquisition config, and queued-tool implementation checks remain. No new lint suppressions, timeouts, retries, or skips were added.

Scope proof also caught two nearby correctness issues: an earlier MCP reload could overwrite a new caller's explicit configuration, and snapshot reconciliation could prepend a separator to a later text block. Both are fixed with their existing boundary tests. Bootstrap fixtures now test the no-clobber fallback already shipped by the pinned fs-safe version; no dependency or storage policy changed.

## Best-effort tradeoffs accepted

| Removed guard | Provenance and accepted result |
| --- | --- |
| Per-batch context projection cancellation | openclaw#119607 measured the value of cooperative yielding; its mid-batch cancellation callbacks were synthetic coverage. Yielding and the final publication check stay; obsolete pure computation may finish unused. |
| Mixed-version module/cache repair | openclaw#119607 seeded an old global singleton inside a synthetic process. Normal upgrades restart the process; unsupported mixed-version module replacement no longer repairs that marker. |
| Runtime acquisition retry/rebind loop | openclaw#128138/openclaw#127217 exercised forced reload timing. A racing request now returns a visible supersession error; the next request uses the current owner. The actual no-spin incident in openclaw#153313 remains addressed. |
| Configured-generation re-admission | 8b13535 / openclaw#168410 adds re-admission for a gated Docker reproduction with a catalog publication 0.3s after admission, not a human-user incident. A superseded request now fails visibly. Parent confinement remains fail-closed, with its security test retained. The retry-only WeakSet and two retry-specific tests are removed. |
| Repeated passive owner selection | d92dc37 / openclaw#162484 added recursion alongside the real self-drain fix; that incident did not require recursive reselection. The self-drain refusal stays. Reads use one captured owner or fail visibly, rather than recursively trying later publications. |
| Remote catalog config reread/per-attempt cancellation | openclaw#158000 used synthetic config/auth churn. Adoption reads once and prepares once; an overlapping change can defer adoption until the next normal catalog check. |
| Parent-generation cancellation subscriptions during adoption | 27a0f6d / openclaw#158000 used the same synthetic churn. Parent replacement may leave bounded preparation running until its final owner/config check rejects it. Shutdown cancellation, candidate-retirement aborts, cleanup, and the final serialized effect check remain. |
| Three-attempt catalog adoption settlement recovery | The same synthetic churn caused a second retry protocol around owner publication. One attempt remains, with one final checked atomic rows/pricing commit. |
| Duplicate early publication checks/error relabeling | Same-tick checks and concurrent-change relabeling did not guard an effect. The final effect check stays; failures retain their actual reason. |
| Auth-batch sibling retry after supersession | 4616d20 / openclaw#152467 used synthetic tests that superseded one owner during a sibling build. The operation now settles with its original error instead of selectively rebuilding siblings. Credential authority checks remain. |
| Post-await cache-stale generation check | No human incident supports fencing this metadata flag. A config/auth change during discovery can let the older load clear a reused owner's stale marker; discovery may remain stale until another explicit refresh/reload. This does not grant credentials or execution authority. |
| Passive harness catalog cancellation | openclaw#134524 fixed the actual availability report openclaw#134460; replacement/closure guards were additional synthetic hardening. Completed discovery rows are retained, and later discovery observes replacement. |
| Native binding clock-only rechecks after worker waits | openclaw#158396 used clock-jump fixtures. An expired but unreplaced exact row can finish its prepared bookkeeping mutation; CAS takeover detection and current mutation authority still gate commit. One exact, unexpired lease check gates protected callback entry, and live effect assertions remain. |
| Tool Search ancestor reentrancy tracking | openclaw#140767 covered synthetic nested control calls, not a reachable production control target. FIFO/exclusion and real implementation settlement remain. |
| Complete steering metadata fingerprint | openclaw#163195 recorded a real production ordering/ownership incident. Its owner, pending-row, result-authority, and lease checks stay; metadata-only edits no longer invalidate already-captured prompt bytes. |
| Repeated MCP acquisition/reload replay | openclaw#138694 used synthetic crossed-publication choreography. A new runtime catches up once; later reloads target the published owner. A racing creation can fail and reconnect on the next acquisition. |
| MCP tools/list invalidation generations and replay | openclaw#125541/openclaw#125564 describe isolated protocol stress fixtures. A notification inside tools/list no longer triggers immediate replay; the next notification or explicit refresh replaces the inventory. Normal exit/reconnect, bounds, validation, and cleanup remain. |
| Failed-start replay crossed by config publication | openclaw#158088's test forces a config publication into an in-flight failed initialization. That request may now report its first failure; ordinary backoff and explicit-refresh retry remain. |

## Evidence

Candidate head: `d72afea0c17a45c677977e23937049d7c7fc43ec` (tree `51daca08d7288e906188bc25ec3d1896bf841349`).

Final exact-head CI: [run 38132644989](https://github.com/openclaw/openclaw/actions/runs/38132644989) completed successfully; all 82 jobs terminal with no failed or cancelled jobs. Full head-bound check census also confirms the CI gate and applicable security checks passed. Earlier failed/cancelled attempts are described below, not represented as passing proof.

- Independent P2 reviews completed. The catalog-staleness, duplicate steering metadata fingerprint, and auth-sibling retry findings are explicitly accepted tradeoffs listed above; steering result facts and destination eligibility remain checked at their owners. The latest native-lease callback-entry finding was accepted and fixed with one live lease check instead of restoring per-write expiry callbacks. Its new fake-clock regression failed before the fix by entering the protected callback after expiry.
- Conflict-only integration kept main's three repaired test fixtures byte-for-byte. All **22 conflict tests** passed (cursor, sandbox, bootstrap publication, lint suppressions); affected root/tools test graphs, core types, typed lint and both cycle checks passed. Runtime and Madge cycles remain **0**.
- The native callback-entry fix passed fresh P2 review and **24 focused tests** (21 native binding tests plus 3 lint-suppression tests), wrapper 212.01s; native test project 164.77s including 113.11s compiled-worker preparation. The added fake-clock case performs no real wait; the existing native suite exercises authority and worker settlement. Final affected types and typed lint are checked before push.
- CI run `38125430266` found one owned stale expectation: the remote-catalog integration still forced config/auth replacement while pricing was paused and demanded the removed immediate retry. Only that scenario was removed; both schema variants retain normal publication, pinned pricing, input validation, worker recovery and disable coverage and pass locally (141.35s project), with gateway test types, typed lint, lint suppressions (3/3), and fresh P2 review passing.
- The other root failure, `checks-node-changed-compact-small-11`, independently reproduced on clean main `8d45488ae2075bd14a50c881aff6e18c32182538`: `embedded-agent-runner.prompt-cache.test.ts` responses and in-history both raised `SqliteTranscriptMutationConflictError` in the session actor append path (2 failed / 2 passed). Investigation found a cold actor snapshot prevented the existing implicit-watermark retry. Fixed directly on main as `0fa340c21f484740ec7b4ed1169b7b02439aa970` and integrated here: all 4 prompt-cache cases and 35 session-manager siblings plus lint-suppressions pass, including explicit stale rewrite refusal. The repair passed types, typed lint and fresh P2 review.
- Follow-up CI `38127338915` reached one more synthetic-only case: compaction's `mutate=input` row changes an internal selection object after starting acquisition. Removed only that row/branch under the campaign rule; five remaining compaction cases pass, along with lint-suppressions, affected types, typed lint and fresh P2 review. Its provenance is `44d905388f9` / openclaw#139429, not a human report of post-call input mutation. The final conflict repair keeps main's equivalent streaming/steering refactors, removes the obsolete retry predicate, and passes 49 owner tests plus lint-suppressions. Cancelled jobs are not counted as passing; final-head hosted CI remains the gate. No CI job was rerun.
- CI `38130432441` had one inherited fixture failure: three `sessions-mutations.catalog-queue` cases selected their configured default while expecting override fields, after openclaw#169030 intentionally made that selection a default reset. Integrated main's existing fixture-only correction `a8ef16f77650`, retaining all assertions. The corrected file passes all 14 cases on clean main under Node and Bun; the three affected cases also pass under Bun on this branch (249.87s project, mostly transformation). Exact-head hosted CI remains the final gate.
- Focused effects suites: **43 passed** across inbound-registry, remote-publication, hot-reload-dispatch and tool-search-scheduling. This includes cancellation, parent confinement, ordinary rollback/failed-activation recovery, and queued implementation replacement. Single-worker wrapper 752.15s including 142.017s compiled-worker preparation; infra 432.15s and agents-core 115.09s. Final restored remote-publication file: **7 passed**, including first reply crossing catalog adoption and exact derived-parent confinement; wrapper 372.77s (184.30s worker preparation; 131.87s Vitest). These loaded-host timings are not a performance claim.
- Integrated native-binding suites: **20 passed**, including exact token cleanup, successor protection, and revocation. The same command passed all **3 lint-suppression tests**. Single-worker wrapper 354.47s including 145.31s worker preparation.
- Current core types and native-binding test graph passed; runtime cycles **0**, Madge cycles **0**; changed-file typed lint passed. The full changed-check run reached an old-base UI duplicate-import error already fixed on main by `ef175b247c9`; that fix was integrated and the affected UI graph passed. Remaining type graphs and static guards were completed separately without changing baselines.
- Isolated Linux scope run and canonical remaining projects exercised **19,900 passing tests**. Eight failures were investigated: three pinned removed synthetic retry paths and were deleted; five exposed the correctness/fixture issues described above and were repaired with focused proof. Existing platform skips were unchanged. This is combined incremental proof, not a claim that one final-head all-scope invocation was green.
- Final repair suites: **71 passed** across passive runtime, SSE recovery, startup backoff, bootstrap, stream reconciliation/markup/phase coverage; **12 passed** across sandbox/cursor coverage, followed by **2 passed** for the real-append cursor fixture. Final MCP regression retained stdio-exit recovery and HTTP failure semantics; it passed 64 cases but hit two unchanged local child-start deadlines (1s/2s). Those initial-start paths passed on the isolated Linux run; no timeout, retry, or skip was changed to mask the local failures.
- Full-core Linux lint passed with 13 existing max-lines warnings, none in changed files. Deadcode identified and drove removal of the unused owner-publication helper. Remaining findings were in unmodified config/state/Gateway/UI files. A separate fresh current-main checkout (`401216ac50`) passed production deadcode and failed full-tree deadcode only on the unrelated `readActiveGatewayLockPortMock` export. The PR does not change any deadcode baseline.
- Blacksmith Testbox did not admit a runner within 15 minutes; AWS quota pressure supplied an undersized instance, which was released. The authorized Hetzner fallback supplied the Linux proof above. All owned remote leases are stopped. Hosted CI on the exact final head remains the landing gate; no CI jobs were rerun.

<details>
<summary>Audit coverage ledger and retained boundaries</summary>

| Mechanism (base lines) | Scenario and provenance | Decision |
| --- | --- | --- |
| context-cache-projection.ts:145-213, context.ts:87-109,146-169 | Cancellation/replacement during pure batched metadata computation. 0dd154f / openclaw#119607 fixed a measured multi-second RPC stall by yielding and atomic publication. Mid-batch authority callbacks were extra cancellation machinery; no effect occurs in projection. | REMOVE repeated projection/early checks; KEEP cooperative yields and the caller's check immediately before publication. |
| context-runtime-state.ts:33-38 | 0dd154f / openclaw#119607 seeds an old global singleton and new cache module in a synthetic child process; no human report of mixed code versions within one live process. | REMOVE old-module/cache-pair normalization, its only reuse flag, and the synthetic migration test. Ordinary process startup and same-version bundled singleton sharing remain. |
| prepared-model-runtime-lease.ts:149-164 | 9505286 / openclaw#153386. Human report openclaw#153313 by stackingrockss includes the deployed Docker version, profiler samples, and repeated boot-loop observations. Its infinite retry was caused by non-idempotent runtime selection normalization. | KEEP normalized owner selection and a visible error when a settled replacement never published; REMOVE the acquisition retry loop entirely, so it cannot spin. |
| prepared-model-catalog-worker.ts:71-220 | 9d58cf2 / openclaw#150354. Human report openclaw#149538 by 609NFT describes copied production fleet state, 632 agents, 504 failed health probes and growing RSS. openclaw#161738 by matthematics1137 reports 92 worker lifetimes, OOMs and 1.285 TB written. | KEEP one bounded shared worker, borrower cleanup, failure logging, and ordinary crash recovery. These are measured resource and real concurrency contracts, not permission to retain unrelated reload fences. |
| prepared-model-runtime.refresh-scope.ts:240 | 3e7ca30 / openclaw#151597 by obviyus describes a controlled worker crash and synthetic Gateway regression, not a human production report. Later openclaw#161738 independently establishes actual recurring worker failures. | KEEP source-bound failure reporting and bounded recovery to avoid reintroducing the observed restart/discovery amplification. The openclaw#151597 PR alone is not accepted incident evidence. |
| prepared-model-runtime.resources.ts:30-127 | d70d026 / openclaw#143109 contains native regressions and synthetic compiled CLI/Gateway proof, no linked human incident. | KEEP physical resource claims until ordinary concurrent borrowers settle and shutdown joins their cleanup; these are required cleanup mechanics, not a blanket historical-incident exemption. Inspected the complete resource owner; no extra reload retry protocol lives here. |
| prepared-model-runtime.plugin-lifetime.ts:230-319 | 1233536 / openclaw#159448 links openclaw#157842 by highfly-hi: five-agent Linux deployment with catalog-worker heap increasing 70-80 MB per scheduled turn, watchdog restarts and before/after version evidence. | KEEP final registry-reference release, current execution authority, and ordinary borrowed-resource settlement. Retained memory claims are scoped to physical lifecycle, not all historical publication machinery. |
| prepared-model-runtime.lifecycle.ts:101-164 | d92dc37 / openclaw#162484 by jalehman records actual lossless-claw maintenance calls stuck about 45 minutes during reload until restart. 1f3038b / openclaw#162301 explicitly says synthetic Gateway, no production deployment. | KEEP refusal of plugin work waiting on its own drain and process-close settlement. openclaw#162301 is synthetic evidence, not an independent incident exemption. |
| prepared-model-runtime-lease.ts acquisition loop and borrowed-generation branch | 1977a39 / openclaw#128138 and related openclaw#127217 describe synthetic QA-channel/config replacement tests; openclaw#127217 explicitly reports that its pre-fix real-Gateway run still delivered replies. Retained inbound-registry tests exposed ordinary nested selected-parent borrowing as a distinct contract. | REMOVE retry/rebind loop. KEEP exact open-parent borrowing and selection confinement; a reload during new acquisition may fail that request visibly. |
| prepared-model-runtime.published-owner.ts:91-203 | d92dc37 / openclaw#162484 added retry/recursive rereads alongside the real plugin-drain repair. That incident justifies self-drain refusal and ordinary settlement, not recursive passive owner reselection. | REMOVE repeated rereads/retries; wait once, then project or activate once. Pure catalog-stale bookkeeping no longer revalidates generation after its await. |
| prepared-model-runtime.configured-refresh.ts remote catalog adoption | 27a0f6d / openclaw#158000 has explicitly synthetic config/auth churn and fixture-provider proof; no human incident cited for the reread loop, per-attempt controllers or three-attempt owner settlement recovery. | REMOVE those race-specific retries, plus early duplicate currentness checks/error relabeling. KEEP the final owner/authority check, atomic rows/pricing commit, current catalog ordering, and ordinary cancellation/disposal. |
| prepared-model-runtime.configured-refresh.ts:396-430 parent subscriptions | 27a0f6d / openclaw#158000; same synthetic churn proof. Parent-generation subscriptions duplicate the final owner/generation/config check. | REMOVE parent-generation early cancellation listeners. KEEP shutdown and candidate-retirement cancellation, bounded work, cleanup, and the final serialized effect check. |
| prepared-model-runtime.owner.ts:612-631 batch supersession retry | 4616d20 / openclaw#152467. Tests force one auth owner to supersede while a sibling is building. No independent human incident identified for sibling retry. | REMOVE retry of the surviving batch; retain source-bound credential/current-owner checks and report the original publication failure. |
| prepared-model-runtime.owner.ts:124-134 unused publication probe | e56f825 / openclaw#130856 introduced a helper returning matching/pending publication facts for acquisition retries. Its callers are gone; full-repository search finds only the definition. | REMOVE the dead helper/export. Credential-refresh cancellation remains supported by the direct, abortable configured-owner wait and its unchanged regression tests. |
| sandbox/registry.kernel.ts:396,420; sandbox/registry.ts:295 | 5c7e44c / openclaw#151172 is not treated as an incident report. Read-only admission accepts older schemas; tableExists consumes admitted schema.tables facts, not repeated SQL/format validation. | KEEP the existing absent-table empty/null contract. No runtime foreign-commit or repeated validation probe exists in these calls. |
| harness/native-session/binding-leases.ts | b272376 / openclaw#158396 moved writes to workers; elapsed-time rechecks were covered by synthetic clock-jump tests. ffd0759 / openclaw#164197 supplies native successor authority behavior, not a blanket exemption. | REMOVE prepared callback plumbing and post-worker wall-clock-only rechecks. KEEP exact-row CAS, token/phase/failure checks, current mutation authority, bounded acquisition, renewal, and write settlement. |
| harness/context-engine-logical-turn.ts | openclaw#143491/openclaw#140023 supply synthetic lifecycle tests, not qualifying human incident evidence. The owner actually holds resources used by outstanding context-engine work. | KEEP ordinary work completion and deferred disposal until implementation settlement; no extra synthetic reload retry was retained here. |
| harness/model-catalog.ts:168-177,242-284,353 | 01fd244 / openclaw#134524 repairs human availability report openclaw#134460. Passive replacement/closure branches were additional maintainer hardening and synthetic variants, not that report's failure. | REMOVE passive isCurrent callbacks and ambient registry replacement checks. KEEP exact owned registry/config, provider outcomes, discovery, selection and the actual availability repair. |
| auth-profiles/oauth-refresh-peers.ts | openclaw#166183/openclaw#167002/openclaw#166659 are not claimed as human incident evidence. Refresh credentials rotate/revoke and carry account identity; copied historical peers must not replay spent tokens or inherit another account. | KEEP these credential/identity effect boundaries and ordinary uncertain-write settlement. No auth-profile schema, secrets, permissions or durability changes. |
| worktrees lifecycle/removal | Audited run-lease-owner.ts, service-preparation.ts, eviction.runtime.ts and gc-removal.ts. They coordinate destructive removal of user artifacts with live checkout/source handles, exact refs and ordinary parallel sessions. No PR title is treated as incident evidence. | KEEP current-row removal/exclusive source checks and rollback/cleanup custody for writes and deletion. Removing them would risk user artifacts, independently prohibited by the data-loss boundary. |
| tool-search-scheduling.ts | 49f8d29 / openclaw#140767 adds ancestry reentrancy and queued object/mode identity checks with automated interactive/headless regressions. Production catalogs exclude control tools; recursive calls using the same runtime were synthetic only. | REMOVE unreachable nested-call ancestry. KEEP one exact queued implementation/mode check at the effect, catalog-ID authorization, FIFO/exclusion, abort and implementation settlement. |
| agent-steering-queue.ts:194-263 | 94acbe6 / openclaw#163195 records Peter's actual three-day production errors. The incident justifies owner/FIFO repair, not a fingerprint of every result label/task/time/outcome/origin/transcript field. | REMOVE full payload fingerprints and deep-equality invalidation. KEEP run-owner identity, prepared result authority, current requester store, pending-row effect checks, FIFO, exact lease/status acknowledgment and release. |
| agent-bundle-mcp-manager.ts and manager-install.ts | 1d60d3d / openclaw#138694 reports synthetic fail-before/real-transport proof but no cited actual-use incident for repeated crossed-publication acquisition/reload. | REMOVE the acquisition retry/rebind loop and repeated reload replay. KEEP the runtime-key queue, ordinary cleanup, one postcreation config catchup, requester credentials/authorization and live tool effect checks. |
| agent-bundle-mcp-runtime.ts catalog generations | 140dbbd / openclaw#125564 and follow-up 0818bcb / openclaw#167642 have synthetic notifications/listing interleavings, not human reports for replaying tools/list during its own response. | REMOVE catalog invalidation generations, replay of a notification arriving inside tools/list, and the impossible repeated replacement-retirement loop. KEEP listing single-flight, caching, bounds, diagnostics, normal reconnect, one retry for an actually exited previously healthy server, and execution authority. |
| prepared-model-runtime-lease.ts / plugin-lifetime.ts configured-generation re-admission | 8b13535 / openclaw#168410, landed during this lane, describes a gated Docker reproduction with catalog publication 0.3s after admission, not an actual human-user incident. | REMOVE configured-generation retry and its now-unused WeakSet plus the two retry-only tests. KEEP fail-closed superseded-generation rejection and the new derived-parent confinement security test. |

</details>
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 P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants