Skip to content

perf(runtime): release completed callers from lifecycle resources - #164465

Merged
steipete merged 10 commits into
mainfrom
steipete/perf-micro-census-followups-lifecycle-creation-20260919
Oct 4, 2026
Merged

steipete merged 10 commits into
mainfrom
steipete/perf-micro-census-followups-lifecycle-creation-20260919

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Long-lived Gateway resources created during a request can keep that completed turn's prompt, transcript, and tool results alive. This completes the measured lifecycle-creation follow-ups from #164370: completed callers can collect while reusable workers, local provider services, parked Code Mode continuations, and background owners remain usable.

Doctor's maintenance preflight also needs trustworthy lease evidence before repairing state. A damaged lookup index can hide a fresh Gateway claim or allow conflicting claims. The maintenance inspection now runs in the existing shared-state read worker, reads the physical table without the damaged index, and refuses active or ambiguous claims before repair. It preserves the source database, quarantine receipt, and current maintenance authority.

User Impact

Completed callers can collect while their reusable resources remain active. Per-task authority, FIFO order, cancellation, parked continuations, scheduled work, and cleanup custody stay with their existing owners. There are no configuration, schema, stored-data-format, or operator migration changes.

Why This Change Was Made

The lifecycle changes reuse one neutral async-context owner with prepared launch facts. Browser-shared consumers import its browser-safe module, and all affected callers move together. SQLite listeners keep launch and cleanup facts instead of the opening caller's options frame; completed admission callbacks are released. Provider startup owns both the child and pooled readiness connection. Timers and continuous queue drains no longer inherit the first caller, while each admitted task restores its own authority. The redundant LLM configuration call and manual initialization cache are removed. Two module-global Error sentinels discard their import-time stacks, which otherwise retain an importer's closures even when async context is detached.

Doctor lease inspection has a narrower admission contract than an ordinary runtime read. Its existing doctor.gatewayOwnerLease.read command takes an early worker branch after the existing request/freshness guards. The worker-only helper opens the captured read connection and exact Doctor schema-read admission before runtime schema validation, so newer and quarantined databases remain inspectable. It carries the expected source identity and private snapshot root, scans state_leases NOT INDEXED with LIMIT 2, and uses the shared lease decoder. Successful replies record sourceAdmitted: true; failed replies retain whether admission actually completed. Ordinary indexed lease reads keep their existing path. No new wire command, general quarantine bypass, or main-thread SQL site is introduced.

The host captures its source and read context before yielding, rechecks physical custody and captured admission across awaits, and refreshes process liveness after cleanup. Native retirement must finish before the private snapshot read pin is released. Disposable snapshot-removal warnings and retry custody remain with the canonical snapshot owner; actual cleanup rejections stay visible and retain finite source custody for retry. Doctor's legacy-root drainage also runs under its still-live parent maintenance owner.

Production source is 427 lines added / 205 removed, +222 net, excluding tests, support files, and src/test-utils. The requested filter (:!*.test.ts :!*test-support* :!docs/*) reports 472 added / 221 removed, +251 net, because it also counts fixture infrastructure and wrapper inventory. The lifecycle cutover contributes +58 lines to preserve per-task authority, independent provider startup/cancellation, and parked/scheduled-work ownership. The remaining +164 lines implement the bounded worker inspection and shared decoding, pre-runtime Doctor admission, truthful reply facts, cancellation, and native/snapshot cleanup contracts. These replace the old synchronous maintenance read; they do not add a competing fast path or lifecycle manager. The staging allocation adapter moves into a sibling module with complete caller cutover to preserve its lazy boundary and line cap.

Settled fulfilled promises and tails did not retain the tested ALS callers on Node 24/26. Their speculative changes and baseline-passing tests were removed. The resource table records these unchanged rows and the remaining unproven owners.

Evidence

These are historical, source-pinned measurements of the lifecycle cutover, not measurements of the final rebased Doctor integration. The isolated Linux rig used Node 26.8.1, baseline 6cae5628b09a2e3893a02dc018f182ba6442e854, and measured candidate 5f78f6aef9d3632e8d9ac8436545f44e73c4d806. Real resources use named 1 MiB caller graphs, forced GC, a collectible control, and reuse/ownership assertions. Fixed resources fail their retention assertion before the change and pass afterward. Unchanged rows below collected on the original implementation.

Resource Before retained bytes After retained bytes Mechanism / disposition
Snapshot staging native resource 1,049,000 0 Neutral owner creation; per-preparation authority preserved
Shared-state writer opening and slot callbacks 2,098,000 0 Drop settled admission callback; prepare launch/cleanup facts outside retained listener closures
Native-source pending completion 1,049,104 0 Create deferred and pending rejection reaction in lifecycle context
Subagent registry sweeper timer 1,049,000 0 Neutral timer creation; fresh sweep admission unchanged
LLM initialization 1,048,880 0 Neutral process initialization; release private sentinel stack captures
Provider child/readiness connection 1,048,880 0 Lifecycle-owned startup, including pooled health connection
Provider idle timer 1,048,880 0 Neutral timer creation
Code Mode expiry timer 1,049,000 0 Neutral timer; parked continuation remains owned
Gateway scheduler wake timer 1,049,000 0 Neutral timer only; scheduled job authority retained
Question delivery cleanup 1,049,104 0 Lifecycle-owned cleanup scheduling; late-delivery finalization retained
Session event wake/retry timer 1,049,104 0 Neutral timer; payload and generation fences retained
Terminal upload cleanup timer 1,049,104 0 Neutral timer; upload artifacts and drain barriers retained
Bounded serial queue continuous drain 1,049,104 0 Neutral orchestration; each task restores its own context
Command queue continuous drain 1,049,104 0 Neutral orchestration; task callbacks restore enqueue authority
Store-writer continuous drain 1,049,104 0 Neutral orchestration; task admission unchanged
SQLite input-admission settled tail 0 0 Unchanged: original real-owner fixture collects caller; FIFO/join contract retained
Successful lazy/keyed cached promises 0 0 Unchanged: original fulfilled promises release caller; cached value/error payload lifetimes preserved
Host account name/avatar cached promises 0 0 Unchanged: both original real-resource fixtures collect callers
System disk cached snapshot 0 0 Unchanged: original real-resource fixture collects callers
Successful history-worker prewarm promise 0 0 Unchanged: original real-worker fixture collects callers
Config reload serialization tail 0 0 Unchanged: original caller-authority refusal fixture collects callers
Session suspension write tail 0 0 Unchanged: original FIFO no-config operation collects callers
Worker-environment projection tail 0 0 Unchanged: original creation/mutation fixture collects callers
Native binding exclusive tail 0 0 Unchanged: original real SQLite mutation fixture collects callers
Bounded queue settled prefix 0 0 Unchanged: original idle queue fixture collects caller
Generic native resource descriptors not measured separately unchanged Intentional callback authority; only the staging creation caller is detached
Native supervisor, lease heartbeat, writer idle timers, transcript physical workers not measured separately unchanged Existing detached lifecycle creation preserved
Dispatcher/socket pool, session MCP transport, warm CLI callbacks unproven unchanged Separate transport/owner heap proof required; no blanket clearing
Lease renewal, source readers, publication facades, finite followup/approval timers intentional unchanged Live authority and finite-operation custody retained

Retained bytes include the marker object, Buffer/ArrayBuffer, and 1,048,576 payload bytes. Different resource fixtures are independent synthetic measurements and must not be summed into a production saving. The 15 fixed resource rows include two separately marked shared-state opening graphs. scripts/heap-snapshot-diff.mjs reports named strong paths and dominators from same-process snapshot pairs. The candidate releases every named fixture graph while the resource remains usable.

Representative dist Gateway

The same historical rig comparison used synthetic state/provider, loopback-only ports, two completed turns, and clean Gateway shutdown. Its sourcePerformance builds passed in 1m28.2s before / 1m19.3s after. The pair includes the staging allocation extraction and heartbeat import cutover.

After the first turn, the baseline agent-writer path slot → receiveReply → context → options reached an options graph of 72,981 B; the shared-state slot reached 2,755 B. Both options edges are absent in the candidate, whose callbacks keep only carrierUrl, exited, slot, and replyOwner. The options objects had other strong paths, so these figures are not exclusive whole-heap savings.

Post-GC process totals were 262,306,208 → 262,014,936 B after one turn and 264,849,736 → 264,658,800 B after two. These single-run totals are context, not throughput or hourly leak-slope measurements. LLM initialization was already neutral during this representative Gateway startup; its cold-request defect is proved by the separate real initializer fixture. Other cold resources are likewise measured at their actual owner entry points, not claimed to have all activated during one Gateway turn. Independent provider HTTP sockets still expose request-context paths and remain a separate transport follow-up.

Validation

Final head 2df48c3c345a821a5439cb98074c41f110b6fd5d, tree 677773b94b9bb044bb6e0611889198ced078732d, pinned main base 4bac1493291e7d931c0eea48b8ed07e98dc37ce0. GitHub records merge 65829ead96bb115b69782e6357e8b619b3add8bf at 2026-10-04T06:01:05Z; its ancestry on main was verified. Independent reviews passed through P2, including each final correction. The lifecycle/Doctor code replayed unchanged during the final integration, and main supplied the duplicate formatter fix. There is no production UI diff.

Current-head proof ran on blacksmith-testbox / openclaw-check, lease tbx_01m42qfrjxbr0vyyxa4502eaja, Node 24.19.0, four logical CPUs, verified Testbox run. One active command at a time; source identities and a clean tree were checked around every phase.

Current-head command / scope Result
Original core-runtime-config-hosted-6 CI cohort with old cleanup, via the canonical shard runner 183 passed / 1 existing skip, 14-file original order and two workers, 109.018s. One run only: the recorded lock failure did not reproduce. Candidate restored afterward.
Same cohort with awaited cleanup 183 passed / 1 existing skip, 106.564s. No retries, sleeps, worker changes, or relaxed assertions.
MCP cursor test through jsdom and real InMemoryTransport 1 passed, 2.281s; opaque cursor round trip retained.
pnpm tsgo:test:ui All six UI test graphs and extension declarations passed, 275.308s. Complete focused command: 389.517s.
pnpm check:architecture Passed in 144.273s (remote command 148.103s), including Kysely guardrails and five declaration-generator tests.
node scripts/check-changed.mjs --base 5ba176891779e0a655d2bfcd6d977b29c08d749c --head 2df48c3c345a821a5439cb98074c41f110b6fd5d --timed Four-test repair gate passed in 237.515s (remote command 241.325s); selected UI E2E, agent-session and UI-component test graphs plus relevant guards, exports, i18n and lint.
pnpm build:ci-artifacts Passed in 110.01s.
node scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog ... Passed in 49.49s, including inventory and import-graph integrity.
Published 2026.9.8 updater × candidate through scripts/e2e/published-driver-update-docker.sh Passed in 215.13s; update 176.845s, exit 0, durable phase finished, readiness 200, and exact serving build-ID match. Build/package/driver command: 378.778s.
Exact-head CI 109 successful jobs, 19 skips. All repaired Windows, UI, Node and typecheck boundaries passed.
PR context and evidence Passed after restoring the required problem/evidence section headings.

Current package SHA-256: 3b9d80464b118fceb7801ee0c3bbee581511e9d6809d8279d3961c111553f823. Packaged and running build ID: 2026.9.8-2df48c3c345a-2026-10-04T06-16-15.874Z. The updater test verifies this exact build, not only the unchanged version string. It was refreshed after integration because main changed canary progress-writer admission.

The complete build log reported the TypeScript 7 experimental-API notice and a CSS advisory: 50,590 B gzip, 610 B below the hard ceiling. Startup JavaScript was 372,648 B, below its 373,454 B enforced limit. No budget was changed or waived; no matched-base attribution is claimed.

CI repairs and limits

The first full CI run exposed a misplaced existing Kysely annotation and an inherited native-Node formatter import regression. The annotation now attaches to the SQL expression the guard inspects, without changing SQL, types or bindings. The formatter dependency already existed; its native .ts import repair was subsequently inherited from main. Both original jobs passed on the next run.

That next run exposed three stale UI tests after main shared spinner keyframes and changed the MCP capability signature, plus a raw SQLite fixture cleanup race. The UI tests now require actual animation effects in the expected running/paused states and use the current capability call, retaining reduced-motion, interaction, geometry, accessibility and cursor assertions. The fixture now awaits the existing retirement owner only after the expected lineage refusal; the synchronous invalidation inside the mutation callback remains. Its original lock holder is unproven, and the single old-code cohort did not reproduce it. No production lock-leak claim is made.

All task-owned Testbox leases are stopped and confirmed absent; all rig worktrees have been removed. The final Testbox workflow's lease-holder check is cancelled after the intentional stop; all proof commands above completed successfully before teardown. No local heavy validation ran, and no operator Gateway was modified or restarted. The updater cell does not force Btrfs or legacy-root relocation; focused Doctor regressions cover those paths. No production deployment, hourly heap-slope, or throughput proof is claimed. Generic provider HTTP socket retention remains a separate follow-up.

Retained complete lifecycle checkpoint on 3d7d2fc

Full lifecycle proof used reviewed head 3d7d2fc4584ca0632f05165d554f397bca9925e0, tree 5bcd08a5f6ff504165c35d17ef01ca18a4dee2a2, pinned main base 8a0b0c458bbdac520a8f99b4735144722f698be7. Independent review passed through P2, including the final transcript-import and admission-reply corrections. At that checkpoint, all eight retained commits replayed patch-identically during its conflict-driven rebase; upstream's replacement fixture repair superseded our duplicate commit.

That checkpoint used blacksmith-testbox / openclaw-check, lease tbx_01m42htwn445f41jd4n4r1n4nn, Node 24.19.0, verified Testbox run. One command ran at a time, with exact source checks before and after. The earlier rig gate was interrupted after its base was superseded and is not counted as a passing gate.

Full lifecycle proof on 3d7d2fc Result
Older generic Doctor route, selected newer-schema case Intended failure: expected foreign-owner refusal, received schema 21/support 20 refusal; 1 failed/36 filtered skips, 21.908s. Exact candidate restored afterward. The evidence parser was corrected for Vitest's multiline diff using the saved log; the resource test was not rerun.
Focused suites via pnpm test and node scripts/run-vitest.mjs 69 files, 927 passed, 1 existing Windows-only skip; 619.328s. Includes all 14 GC cases, all 37 lease cases, original 26-file/350-test Doctor order (238.530s), 120 worker/lock siblings, 95 transcript cases, and 215 retention/caller cases.
node scripts/check-changed.mjs --base 8a0b0c458bbdac520a8f99b4735144722f698be7 --head 3d7d2fc4584ca0632f05165d554f397bca9925e0 --timed Passed in 1565.916s (remote command 1569.482s): production types, all 27 core and four root test graphs, three zero-entry export scans, SQL ownership, first-party mock exports, lint, schema, import-cycle, and remaining selected guards. Exact head/tree verified clean afterward.
pnpm build:ci-artifacts Passed in 112.46s, including runtime/plugin assets, SDK declarations, UI output, and build metadata.
node scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog ... Passed in 48.87s, including tarball inventory and dist import-graph integrity.
Published 2026.9.8 updater × candidate through scripts/e2e/published-driver-update-docker.sh Passed in 210.52s; update 172.768s, durable phase finished, readiness 200, update exit 0, and exact serving build-ID equality. Build/package/driver command completed in 376.497s.
Initial GitHub CI on 3d7d2fc Run 37178932454: 106 successful jobs, 20 skipped, two root failures plus their aggregate gate. Both root causes are addressed in the current head below.

Candidate package SHA-256: 2fd9f12ca45766abccaf28572b9322868188c4562a0267d18017f37d683fcd25. Packaged and running build ID both equal 2026.9.8-3d7d2fc4584c-2026-10-04T04-55-54.399Z; this same-version test verifies the installed build, not only its version string.

The complete build log reported the TypeScript 7 experimental-API notice and a startup-CSS advisory: 50,756 B gzip, with 444 B hard-ceiling headroom. Startup JavaScript was 372,866 B, below the 373,454 B enforced limit. No budget was changed or waived, and no matched-base attribution is claimed. A bounded full-log warning extraction passed in 4.387s on the same lease.

Regression evidence and test cost

Real damaged-index fixtures exposed both missing fresh claims and conflicting claims; the indexed maintenance implementation failed both counterexamples. The replacement requires refusal without changing source bytes or quarantine, and still accepts genuinely dead/stale owners. Existing tests preserve ordinary runtime quarantine refusal and inspection of current, newer, and quarantined schemas. Native cleanup failures remain fatal; disposable snapshot cleanup follows the snapshot owner's warning/retry contract.

Earlier gates caught a new main-thread SQL site and an oversized dispatcher. The query moved into the existing read worker; the final low-level helper preserves Doctor's distinct pre-runtime schema-admission contract. SQL and size limits were not raised. CI also caught detached-helper export inventory omissions and stale fixtures that assumed global worker counts or always-present empty runtime carriers; those fixtures now assert their actual owner and current request behavior. Upstream fixes were inherited by rebase, not copied or cherry-picked.

Historical one-worker retention proof: six files, 14 tests, 24.83s runner wall, including 14.50s shared cold subprocess compilation. Individual pnpm test <file> --maxWorkers=1 CI-environment wall times were LLM/provider 18.73s (14.59s cold compilation), lifecycle timers 6.96s, SQLite creation 6.38s, queue/timers 6.17s, native-source/question cleanup 5.59s, Code Mode 8.06s, and command queue 8.93s. All 42 command-queue tests passed. Real native resources are required to reproduce async-context retention; bounded GC yields replace sleeps.

Rig proof uses the repository's compiled-subprocess preparation owner, actual resource fixtures with --expose-gc, node --import ./scripts/tsx.mjs scripts/build-all.mts sourcePerformance, and the synthetic two-turn dist Gateway harness. Processes run at low CPU/I/O priority with task-owned state and temporary directories. No heap snapshots or private runtime data were uploaded.

@clawsweeper

clawsweeper Bot commented Oct 3, 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 labels Oct 3, 2026
@steipete
steipete enabled auto-merge (squash) October 3, 2026 18:56
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 2:00 AM ET / 06:00 UTC (Revision 13).

ClawSweeper review

What this changes

The branch releases completed request context from reusable Gateway resources and moves Doctor’s Gateway lease inspection into a worker that detects claims hidden by damaged indexes.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR remains useful: current main does not cover the broader lifecycle fixes or damaged-index lease inspection. No actionable introduced defect was found, and the previous generic compatibility blocker is unsupported by the inspected diff.

Priority: P2
Reviewed head: 2df48c3c345a821a5439cb98074c41f110b6fd5d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has strong source-pinned runtime evidence and a coherent ownership cutover with no blocking correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Recorded real-resource GC/reuse and built-Gateway observations cover lifecycle retention; production Doctor fixtures cover allowed dead owners and forbidden fresh or ambiguous claims before repair. Key production blobs match the completed proof head, with only annotation movement in the worker helper. Published-updater proof is historical; current integration checks are pending. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Recorded real-resource GC/reuse and built-Gateway observations cover lifecycle retention; production Doctor fixtures cover allowed dead owners and forbidden fresh or ambiguous claims before repair. Key production blobs match the completed proof head, with only annotation movement in the worker helper. Published-updater proof is historical; current integration checks are pending. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduction and merge ownership: Reviewed the merge-base 4bac149 to head 2df48c3 delta. Raw test-merge records confirm parents dac9277 followed by the exact PR head; base-only supervisor and Telegram work was not attributed to this PR.
Current main still needs the change: Current main retains synchronous maintenance lease inspection through the indexed lease reader and keeps the detached-context helper in async-work-scope. The merged #164370 addresses reusable SQLite read callers, while this branch implements additional resource owners and corrupted-index inspection. No merged replacement for this broader work was established.
Live authority and cleanup ordering: The maintenance reader checks cancellation, captured admission, and physical maintenance custody before dispatch and after awaits. Native task retirement precedes snapshot-pin release, cleanup errors remain visible, and process liveness is refreshed before accepting the lease result. The Gateway lock caller awaits inspection and revalidates its owner.
Findings None None.
Security None None.

How this fits together

Gateway workers, timers, and queues serve many agent requests and must preserve pending work without retaining completed callers. Doctor checks Gateway ownership before allowing database maintenance.

flowchart TD
  A[Agent requests] --> B[Per-task authority]
  B --> C[Reusable workers and queues]
  D[Neutral lifecycle context] --> C
  C --> E[Completed callers released]
  F[Doctor maintenance request] --> G[Worker lease inspection]
  G --> H[Refuse active claims or allow maintenance]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus regression growth production +222 net; tests/support +1,000 net Production growth is explained by preserving resource ownership and replacing synchronous Doctor inspection with the existing worker boundary.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep reusable resource creation neutral while preserving per-operation authority, and retain Doctor’s bounded physical-table inspection before maintenance.

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

Yes, source and recorded before/after fixtures establish caller retention and indexed lease lookup missing physical claims; this read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes, the patch reuses existing lifecycle, worker, and maintenance owners while preserving task context and cleanup custody.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 42b9aee33a7b.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded runtime-retention and maintenance-correctness improvement without evidence of an urgent user-facing outage.
  • 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 (terminal): Recorded real-resource GC/reuse and built-Gateway observations cover lifecycle retention; production Doctor fixtures cover allowed dead owners and forbidden fresh or ambiguous claims before repair. Key production blobs match the completed proof head, with only annotation movement in the worker helper. Published-updater proof is historical; current integration checks are pending. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real-resource GC/reuse and built-Gateway observations cover lifecycle retention; production Doctor fixtures cover allowed dead owners and forbidden fresh or ambiguous claims before repair. Key production blobs match the completed proof head, with only annotation movement in the worker helper. Published-updater proof is historical; current integration checks are pending. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Reviewed the merge-base 4bac149 to head 2df48c3 delta. Raw test-merge records confirm parents dac9277 followed by the exact PR head; base-only supervisor and Telegram work was not attributed to this PR. (1d534ea645bd)
  • Current main still needs the change: Current main retains synchronous maintenance lease inspection through the indexed lease reader and keeps the detached-context helper in async-work-scope. The merged perf(sqlite): release caller context from reusable read workers #164370 addresses reusable SQLite read callers, while this branch implements additional resource owners and corrupted-index inspection. No merged replacement for this broader work was established. (src/infra/gateway-owner-lease.ts:80, 42b9aee33a7b)
  • Live authority and cleanup ordering: The maintenance reader checks cancellation, captured admission, and physical maintenance custody before dispatch and after awaits. Native task retirement precedes snapshot-pin release, cleanup errors remain visible, and process liveness is refreshed before accepting the lease result. The Gateway lock caller awaits inspection and revalidates its owner. (src/infra/gateway-owner-lease.ts:99, 2df48c3c345a)
  • Forbidden maintenance cases: The production maintenance entrypoint is exercised against current, newer, and quarantined databases, hidden fresh claims, and conflicting physical lease rows. Assertions require refusal before the repair callback, unchanged database bytes, and preserved quarantine; dead and stale owners remain inspectable. (src/infra/gateway-owner-lease.test.ts:294, 2df48c3c345a)
  • Captured proof body inspected: Read the omitted body range through REST and verified the complete body SHA-256 remained 3d6ce812e485b3021b9b814eecb92af39d00ee596822e402ce9cc48640e5032c. It reports real resource before/after collection with reuse, a two-turn built Gateway comparison, 927 passing focused tests on head 3d7d2fc4584ca0632f05165d554f397bca9925e0, and a published 2026.9.8 updater run reaching finished state, readiness 200, exit zero, and exact serving-build identity. Current-head integration validation is explicitly pending rather than claimed complete. (3d7d2fc4584c)
  • Proof continuity verified: GitHub’s complete prior-proof tree and the local head tree have identical blobs for the detached-context owner, provider service, command queue, maintenance lease orchestration, and state-read dispatcher. The prior Doctor worker blob was read directly; its difference is SQL annotation placement, with query and runtime behavior unchanged. Historical measurements retain their original source identities. (src/infra/gateway-owner-lease.worker.ts:49, 3d7d2fc4584c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Harshit Gupta: 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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-04T00:15:50.587Z sha 482cd2720708cb8c8eedf230aac219c6c349d0e9 :: needs changes before merge. :: none
  • reviewed 2026-10-04T00:25:51.814Z sha e33ea90 :: needs changes before merge. :: none
  • reviewed 2026-10-04T02:06:59.083Z sha 73f2494fec15d989b9bac91333576eec654391d7 :: blocked before merge. :: none
  • reviewed 2026-10-04T02:20:27.371Z sha cb2f4266565d2d395cd0d9caccf6f5322fa267c6 :: blocked before merge. :: none
  • reviewed 2026-10-04T03:53:16.421Z sha bb779eb20e3842ec41acb82650193d774e05a8ab :: blocked before merge. :: none
  • reviewed 2026-10-04T04:20:30.129Z sha 3d7d2fc4584ca0632f05165d554f397bca9925e0 :: blocked before merge. :: none
  • reviewed 2026-10-04T05:13:51.256Z sha 3d7d2fc4584ca0632f05165d554f397bca9925e0 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T05:31:28.534Z sha 02707f1d285e553f9e13019eb50b69a0b0334b50 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts commands Command implementations labels Oct 3, 2026
@steipete
steipete force-pushed the steipete/perf-micro-census-followups-lifecycle-creation-20260919 branch from dd4e93b to a8b8897 Compare October 3, 2026 20:40
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 3, 2026
@steipete
steipete force-pushed the steipete/perf-micro-census-followups-lifecycle-creation-20260919 branch from 78074c8 to 482cd27 Compare October 3, 2026 22:34
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Oct 3, 2026
@steipete
steipete marked this pull request as draft October 4, 2026 00:09
auto-merge was automatically disabled October 4, 2026 00:09

Pull request was converted to draft

@steipete
steipete force-pushed the steipete/perf-micro-census-followups-lifecycle-creation-20260919 branch 5 times, most recently from 0162162 to 3d7d2fc Compare October 4, 2026 04:12
@steipete
steipete marked this pull request as ready for review October 4, 2026 05:06
@steipete
steipete enabled auto-merge (squash) October 4, 2026 05:09
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 4, 2026
Doctor could miss an active Gateway lease when its lookup index was damaged.
Inspect table rows through the shared-state read worker and reject ambiguous
claims before repair, preserving the original database and quarantine receipt.

Keep physical and captured read authority across awaits. Retire native work
before removing the private snapshot, and retain cleanup custody on failure.
Route this inspection through the existing diagnostic reader.
@steipete
steipete force-pushed the steipete/perf-micro-census-followups-lifecycle-creation-20260919 branch from 02707f1 to 2df48c3 Compare October 4, 2026 05:50
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 4, 2026
@steipete
steipete merged commit 65829ea into main Oct 4, 2026
189 of 192 checks passed
@steipete
steipete deleted the steipete/perf-micro-census-followups-lifecycle-creation-20260919 branch October 4, 2026 06:01
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…enclaw#164465)

* perf(runtime): release completed caller contexts from lifecycle resources

Create persistent native resources, timers, and queue orchestration in the lifecycle context while preserving per-operation authority and cleanup ownership. Drop opening callback captures and private sentinel stacks; retain measured-clean settled promise owners unchanged.

* perf(runtime): migrate the new Gateway heartbeat to lifecycle context owner

* test(runtime): satisfy lifecycle retention fixture lint

* fix(tooling): include lifecycle helpers in PR wrapper archives

* test(state): identify workers by their lifecycle owner

* fix(doctor): retain maintenance authority while draining databases

* fix(doctor): preserve Gateway lease authority through index corruption

Doctor could miss an active Gateway lease when its lookup index was damaged.
Inspect table rows through the shared-state read worker and reject ambiguous
claims before repair, preserving the original database and quarantine receipt.

Keep physical and captured read authority across awaits. Retire native work
before removing the private snapshot, and retain cleanup custody on failure.
Route this inspection through the existing diagnostic reader.

* fix(runtime): complete lifecycle import and admission cutover

* fix(ci): preserve native imports and SQL guard attribution

* test(runtime): follow lifecycle and UI owner contracts
RomneyDa pushed a commit that referenced this pull request Oct 13, 2026
…ed the MCP loopback ends (#165432)

Backport of fdcbcf5 (#165432) adapted for 2026.10.3.

Ports the 16-line src/shared/detached-async-context.ts owner from #164465 (absent on 10.3).
Vitest routing keeps only this PR's two database-worker entries; the regression expects
10.3's live-authority refusal text instead of main's later "requester authority changed".

(cherry picked from commit fdcbcf5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant