Skip to content

perf(agents): move bulk registry work off the Gateway thread - #165684

Merged
steipete merged 7 commits into
mainfrom
steipete/perf-micro-subagent-registry-store-off-main-20260919
Oct 6, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/perf-micro-subagent-registry-store-off-main-20260919

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Large retained subagent registries stall the Gateway during recovery and cold reads while synchronous SQLite access and JSON decoding occupy the main thread.

User Impact

Bulk registry storage work runs in the existing worker. Restore publishes complete rows and cached metadata together, and the synthetic restore/sweep/cold-read rig stays below 50 ms maximum main-thread delay. Physical row-version conflicts, cancellation ownership, and atomic terminal events remain enforced. No configuration, state schema, retention, or migration changes.

Responsiveness has a throughput cost: on the source-code rig, restore wall time is 10.158 → 17.925 s and process CPU is 9.865 → 19.961 s. One of eleven 12 MiB completion-block acknowledgments still exceeds 50 ms. This is synthetic evidence, not a reproduction of the production incident.

Why This Change Was Made

Restore consumes one stable worker snapshot in pages bounded by 128 rows and 1 MiB of stored payload; one oversized record remains whole. Workers decode records and return physical CAS versions. Activation yields and rechecks live ownership; sweeps use resident/scoped facts. The synchronous bulk fallback loaders, parsing/hashing receipts on the caller thread, duplicate preservation interface, and duplicate maintenance publication cache are removed.

Native lifecycle, replacement, and deleted-agent purge capture SQLite data_version on a private live read-only connection before worker preparation and check it immediately before pruning. A foreign commit triggers indexed protection rereads only for candidate child-session keys, in batches of 64. Newly protected candidates roll back pruning; unrelated commits permit it. Source identity, integrity admission, and cleanup custody remain enforced. There is no revision table, trigger, or schema bump.

Restore settles each row's ownership, then notifies readers through its final atomic publication. Cold asynchronous snapshot startup prepares the existing native broker before yielding, revalidates admission, and starts the worker using the same captured owner. Shared retained staging remains synchronously serviceable: the production read and single-flight owners must be able to service retained work without caller timer/microtask progress. Broker cleanup still belongs to that same native source, including cancellation before any task starts.

Evidence

Validated tree bb48da43105a3a4adc5d75e6893607d5f5ff681f was committed unchanged as cba67cba259f4a910f5f78b871296bebbf19530f, against base 1b7dd0b2ac92ff188537f7ec24ccd79bcfe2c22d.

The fixture contains 3,000 rows, about 394.7 MB. All eight standard phases meet the 50 ms target:

Phase Before maximum loop delay After maximum loop delay
Restore 588.775 ms 38.437 ms
Activation 127.926 ms 7.713 ms
Sweep 26.853 ms 17.580 ms
Cold full read 3,900.703 ms 37.945 ms
Cold maintenance 2,476.737 ms 19.546 ms

All 19 recorded outcomes matched. Candidate phases observed zero main-thread registry SQL calls and record JSON parsing. Cold-full parsing fell from 394,671,907 bytes to zero; cold-maintenance parsing from 1,329,942 bytes to zero. Each cold read went from 78 observed SQL calls to zero.

The eleven 12 MiB stress cases measure blockSubagentCompletionDelivery({storeReplaced:true}) with applied=true, not full retirement. Median maximum delay is 124.518 → 30.360 ms; worst is 202.506 → 54.034 ms, with one candidate case above 50 ms.

Remote proof used provider hetzner, lease cbx_b2954fdb4781, Node 26.10.0:

Run / command Result
run_cb2c4ae6af269bc2b30e80923e999de4: new restore-publication test overlaid alone on c6c9752 Fails for the intended behavior: three returned observations expose partial live/cached rows, instead of one complete publication. 26.893 s.
Same run: pnpm test src/agents/subagents/registry/subagent-registry-state.test.ts --maxWorkers=1 34/34 passed, 27.104 s; new regression 10 ms.
run_952670a85936494d0290772a6a7cb258: matched paired rig Passed, 306.872 s; ordinary maximum 38.437 ms.
Same run: node scripts/check-changed.mjs --staged --base 1b7dd0b2ac92ff188537f7ec24ccd79bcfe2c22d --timed 37/37 stages passed, 2,385.488 s; all core/root types, lint, zero unused exports, schema v20, storage and import guards.
Same run: node scripts/run-vitest.mjs <97 remaining registry/announce unit files> 1,702 tests passed, 526.502 s; no skips in this selected batch.
Same run: OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build Passed, 725.668 s.
Same run: node scripts/run-vitest.mjs <announce.format, registry.archive, registry.lifecycle-retry-grace, registry.requester-wake E2E files> 4 files / 123 tests passed, 215.178 s; clean teardown.

Both native commands used crabbox run --provider hetzner --id cbx_b2954fdb4781 --fresh-pr openclaw/openclaw#165684 --apply-local-patch --timing-json --script ..., with .local/lane461/observer-repair-first.sh and .local/lane461/observer-repair-remaining.sh. Exact HEAD, staged-tree, patch, and source-byte checks ran before and after stages. No sync or gate was bypassed. All 1,771 final artifacts and 206 source hashes were verified; an independent audit checked source manifests, profile hashes, equal 3,333 µs profiling, outcomes, and cleanup. The lease was released after capture, exit 0.

The same production bytes also passed 211 focused tests on lease cbx_9326c7a31c41, run run_a144c8d321786acf9f38273c95f4ea95; only the observer test fixture changed afterward. Those passes cover native retained servicing, snapshot identity/cleanup, ownership/ABA, and foreign-commit protection. Thirty-three overlap the current state suite, so the distinct total across current and reused proof is 2,037 passing cases, covering all 105 ordinary registry/announce files plus focused native/state/maintenance coverage. Six live-provider suites and the opt-in entry-reload benchmark remain unrun.

Key behavior proof:

  • rechecks only native maintenance candidates after a foreign worker commit covers insertion, reactivation, and unrelated commits between preparation and pruning. Newly protected children survive and the native transaction rolls back; unrelated commits allow pruning. These cases failed the original pre-fix overlay and pass the focused proof.
  • publishes restored rows together after replacing ownership and cached facts proves synchronous metadata observers see one complete restored publication with superseded ownership. The accepted negative control exposes partial rows on the old code.
  • joins a prepared broker after cancellation before any snapshot task proves actual broker PID death under generation cleanup and rejection of the retired captured owner. It passed in 119 ms and is new lifecycle coverage, not a claimed old-code defect.
  • Detached review of the integrated branch and the final follow-up completed clean through P2. No accepted actionable findings remain. Previously reported inherited unused-export findings are not claimed as fixes from this PR; the final scans are clean.

Cold-full wall time is 3.898 → 17.874 s and process CPU is 2.758 → 18.790 s. Cell-lifetime peak RSS falls from 2,192.5 → 1,291.7 MiB for restore and 1,289.8 → 1,010.7 MiB for cold-full reads; maintenance rises from 443.5 → 763.5 MiB and acknowledgments from 1,267.8 → 1,363.7 MiB. These are single source-runtime pairs with advisory cache eviction, selected-outcome parity, and process-wide CPU/RSS including worker startup. Physical OS cache eviction and bytewise whole-database equivalence are not established. The original superseded-restore incident is not reproduced or attributed.

Earlier candidates missed the ordinary-phase target at 65.6, 68.3, and 59.7 ms. Timestamped profiles identified duplicate maintenance projection/freezing, same-object identity rebuilding, per-row outward notifications, and combined broker/worker startup. Those failures remain separate from the passing candidate; no unchanged-code replay was used to claim a fix.

The requested production stat, excluding *.test.ts, *test-support*, and docs but including test utilities, is +1,328 / −782, net +546. Runtime-only is +1,252 / −721, net +531. Growth preserves the stable snapshot across bounded worker transfers, physical-row CAS and post-await ownership, native synchronous rollback/cleanup with a live foreign-commit witness, and synchronous retained servicing alongside asynchronous broker preparation. Superseded bulk-loading and duplicate-cache machinery is deleted.

Hosted CI status

Previous-head run 37402164985 found an inherited production dependency audit failure: source-map-js 1.2.1, advisory GHSA-68fv-2mgg-jv7q. Main commit c20c6e5822d741c03831cac8ad805aace1735de3 fails identically in run 37402399816. This branch changes neither package.json nor pnpm-lock.yaml; no audit bypass or unrelated dependency change is included.

The changed-test shard also exposed an inherited mock-only activity fixture after the newer workboard projector began consulting real owner inventories. The test now registers and cleans up a real embedded run, retains the sessions.list response assertion, and removes unused progress mocks (net −11 test lines; production unchanged). On provider hetzner, lease cbx_2a877b8bc6f5, run run_518d0a8258d52eb61090067efa14f786, Node 24.21.0:

Command / source Result
node scripts/run-vitest.mjs src/gateway/server-methods/sessions.abort-agent-scope.test.ts on original branch cba67cba 30/30 passed, 49.037 s.
Same command on exact CI merge abe74cbdf41e and its main parent 0c7a83dd65c6 Each reproduces the same zero-call assertion: 29 passed / 1 failed, 50.260 s and 50.187 s.
node scripts/run-vitest.mjs src/gateway/server-methods/sessions.abort-agent-scope.test.ts src/gateway/server-methods/sessions-read-active.test.ts src/gateway/server-methods/session-active-runs.test.ts on the repaired CI merge 71/71 passed, 92.738 s.
pnpm test src/gateway/server-methods/sessions.abort-agent-scope.test.ts --maxWorkers=1 on the repaired branch 30/30 passed, 33.096 s.
node scripts/check-changed.mjs --staged --base cba67cba259f4a910f5f78b871296bebbf19530f --timed 24/24 stages passed, 329.156 s.

The native command was crabbox run --provider hetzner --id cbx_2a877b8bc6f5 --fresh-pr openclaw/openclaw#165684 --timing-json --script .local/lane461/abort-repair-proof.sh. Original-source controls ran before the one-file repair was applied; source and repair hashes were checked. Fresh detached review of the test-only follow-up completed clean through P2. The validated tree 1bc60ed4634fc26a74a6bbc4fe831782e4956a9c was committed unchanged as 06730b772873b8d21db64a05eafffc5cedbe3a07. The lease was released, exit 0. Earlier production/performance proof remains applicable because this follow-up changes only the fixture.

Final-head CI run 37404356765 completed on 06730b772873b8d21db64a05eafffc5cedbe3a07. All test shards, build, type, lint, and other executed checks passed, including the previously failing Gateway shard. The only underlying failure is the same inherited source-map-js production audit; openclaw/ci-gate fails as its aggregate. This PR is open, ready, and mergeable, but CI is not green. No merge or auto-merge command was run.

@clawsweeper

clawsweeper Bot commented Oct 5, 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 5, 2026
@steipete
steipete force-pushed the steipete/perf-micro-subagent-registry-store-off-main-20260919 branch from fafd76d to ff7aa5a Compare October 5, 2026 17:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 5, 2026, 10:36 PM ET / October 6, 2026, 02:36 UTC (Revision 9).

ClawSweeper review

What this changes

Moves bulk subagent registry reads and completion decoding into existing database workers, bounds restoration transfers, and updates callers and tests to consume prepared facts.

Merge readiness

⛔ Blocked before merge - 5 items remain

This PR remains useful: current main retains the synchronous bulk-loading paths it replaces. No concrete introduced correctness defect was found, and the supplied production-path proof is sufficient; the previously identified performance tradeoff still lacks an explicit disposition.

Priority: P2
Reviewed head: 06730b772873b8d21db64a05eafffc5cedbe3a07
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong, scoped production-path evidence supports a coherent implementation with no identified blocking code defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied Hetzner paired rig exercises registry restoration and cold reads through the changed production workers and observes reduced loop delay with matching outcomes; native boundary evidence covers foreign-commit rollback and cancellation cleanup. The final commit is test-only, preserving that proof. No stored-data contract change was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied Hetzner paired rig exercises registry restoration and cold reads through the changed production workers and observes reduced loop delay with matching outcomes; native boundary evidence covers foreign-commit rollback and cancellation cleanup. The final commit is test-only, preserving that proof. No stored-data contract change was identified.
Evidence reviewed 9 items Pinned introduction and current-main necessity: Inspected introduced production hunks against merge base 1b7dd0b. GitHub source at fetched main still imports the synchronous full-registry loader and maintains the separate maintenance cache, so the central optimization is not already implemented there.
Bounded worker reads: The worker selects at most 128 rows and 1 MiB of stored payload per page, allowing one oversized record; the restoration reader retains one snapshot, carries physical versions, and rejects unreadable durable rows.
Admission, ownership, and cleanup safeguards: Fresh snapshot preparation awaits worker admission, rechecks source ownership and cancellation after yielding, and reuses the captured staging owner. Native maintenance samples one private live connection and refreshes only candidate child keys after foreign commits.
Findings None None.
Security None None.

How this fits together

The subagent registry tracks delegated agent runs and their completion delivery. Gateway recovery, cancellation, and session maintenance consume its stored records to resume work and preserve sessions that active runs still need.

flowchart TD
  A[Stored subagent runs] --> B[Database read worker]
  B --> C[Bounded snapshot pages]
  C --> D[Gateway registry publication]
  D --> E[Recovery and completion delivery]
  D --> F[Session maintenance]
  G[Current ownership and foreign commits] --> F
  F --> H[Preserve or prune sessions]
Loading

Decision needed

Question Recommendation
Is the measured increase in restore and cold-full wall time and CPU acceptable in exchange for the demonstrated reduction in Gateway event-loop stalls? Accept the measured tradeoff: Accept the disclosed throughput and oversized-record limits because the ordinary phases substantially improve Gateway responsiveness.

Why: The measurements establish the costs and benefits, but do not determine the acceptable operating balance for large retained registries.

Before merge

  • Resolve merge risk (P1) - The measured responsiveness gain increases restore and cold-full completion time and CPU, while one oversized acknowledgment still exceeds 50 ms; acceptance of this operating tradeoff remains unresolved.
  • Complete next step (P2) - Record whether the measured restore and cold-read overhead and oversized-record latency limit are accepted or must be reduced before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above 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
Responsiveness and throughput Cold-full loop delay 3,900.703 → 37.945 ms; wall time 3.898 → 17.874 s The paired measurements make the principal responsiveness-versus-throughput choice visible.
Production and test growth Production TypeScript +1,328/−776; tests and support +1,777/−997 Production includes test utilities; growth is explained by bounded transfers, source fencing, and retained cleanup, with obsolete bulk paths removed.

Stored data model

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

Merge-risk options

Maintainer options:

  1. Accept slower bulk operations for responsiveness (recommended)
    Record acceptance of the measured restore and cold-read overhead and the remaining oversized-record latency limit.
  2. Reduce overhead before landing
    Optimize the same worker and snapshot owners, then repeat the paired rig to show improved throughput without losing responsiveness or protection parity.

Technical review

Best possible solution:

Preserve the single-worker design and ownership safeguards, with an explicitly chosen balance between Gateway responsiveness and retained-registry recovery throughput.

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

Yes for synthetic retained-registry stalls: current-main bulk-loading source and the supplied paired 3,000-row rig provide a concrete path. The original production incident was not reproduced.

Is this the best way to solve the issue?

Yes: reusing the existing worker and snapshot owners removes main-thread bulk work without introducing a competing storage owner; the remaining question is acceptance of the measured operating cost.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded internal performance improvement for large retained registries, without a demonstrated current production emergency.
  • merge-risk: 🚨 availability: Lower event-loop stalls come with measured increases in recovery and cold-read duration and CPU that ordinary CI cannot settle.
  • 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): The supplied Hetzner paired rig exercises registry restoration and cold reads through the changed production workers and observes reduced loop delay with matching outcomes; native boundary evidence covers foreign-commit rollback and cancellation cleanup. The final commit is test-only, preserving that proof. No stored-data contract change was identified.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Hetzner paired rig exercises registry restoration and cold reads through the changed production workers and observes reduced loop delay with matching outcomes; native boundary evidence covers foreign-commit rollback and cancellation cleanup. The final commit is test-only, preserving that proof. No stored-data contract change was identified.

Evidence

What I checked:

  • Pinned introduction and current-main necessity: Inspected introduced production hunks against merge base 1b7dd0b. GitHub source at fetched main still imports the synchronous full-registry loader and maintains the separate maintenance cache, so the central optimization is not already implemented there. (src/agents/subagents/registry/subagent-registry-state.ts:61, e72e0807acfa)
  • Bounded worker reads: The worker selects at most 128 rows and 1 MiB of stored payload per page, allowing one oversized record; the restoration reader retains one snapshot, carries physical versions, and rejects unreadable durable rows. (src/agents/subagents/registry/subagent-registry.store.worker.ts:87, 06730b772873)
  • Admission, ownership, and cleanup safeguards: Fresh snapshot preparation awaits worker admission, rechecks source ownership and cancellation after yielding, and reuses the captured staging owner. Native maintenance samples one private live connection and refreshes only candidate child keys after foreign commits. (src/state/openclaw-state-db-readonly.ts:148, 06730b772873)
  • Source-linked real behavior proof: The captured PR body reports a paired source-runtime rig on Hetzner with 3,000 retained rows and approximately 394.7 MB. Restore maximum loop delay falls from 588.775 to 38.437 ms and cold-full delay from 3,900.703 to 37.945 ms; all 19 recorded outcomes match. Native proof also observes broker PID death after cancellation and rollback when foreign commits newly protect maintenance candidates. These scenarios exercise the changed storage, staging, and maintenance owners; they do not establish reproduction of the original production incident. (src/config/sessions/session-accessor.sqlite-maintenance-protection.test-support.ts:120, cba67cba259f)
  • Measured operating tradeoff and review continuity: The captured body reports restore wall time 10.158 → 17.925 s and CPU 9.865 → 19.961 s; cold-full wall time 3.898 → 17.874 s and CPU 2.758 → 18.790 s. One of eleven oversized completion acknowledgments reaches 54.034 ms. The previous completed review retained explicit acceptance or reduction of this tradeoff as its sole rank-up move; the available discussion contains no explicit acceptance. (cba67cba259f)
  • Final follow-up preserves production proof: GitHub's exact-head commit patch changes only the session activity test fixture: it registers and cleans up a real embedded run while preserving the sessions.list response assertion. Production bytes from the earlier proof remain unchanged. The body reports 30/30 focused tests and 71/71 repaired-merge sibling tests passing. (src/gateway/server-methods/sessions.abort-agent-scope.test.ts:203, 06730b772873)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • victor-gurbani: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record acceptance or reduction of the measured recovery-throughput and oversized-record latency tradeoff.

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 (8 earlier review cycles)
  • reviewed 2026-10-05T17:16:02.414Z sha ff7aa5a :: blocked before merge. :: none
  • reviewed 2026-10-05T19:05:04.038Z sha 57e9606 :: blocked before merge. :: none
  • reviewed 2026-10-05T20:39:39.565Z sha 57e9606 :: blocked before merge. :: none
  • reviewed 2026-10-05T21:26:00.617Z sha 728a01929bd03e5ef693700e8542707de79028b0 :: blocked before merge. :: none
  • reviewed 2026-10-05T21:59:00.098Z sha ae0f0c1 :: blocked before merge. :: none
  • reviewed 2026-10-05T22:25:41.662Z sha c6c9752 :: blocked before merge. :: none
  • reviewed 2026-10-05T23:43:22.681Z sha c6c9752 :: blocked before merge. :: none
  • reviewed 2026-10-06T02:17:07.247Z sha cba67cb :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 5, 2026
@steipete
steipete marked this pull request as ready for review October 5, 2026 21:18
@steipete
steipete enabled auto-merge (squash) October 5, 2026 21:19
@steipete
steipete marked this pull request as draft October 5, 2026 21:36
auto-merge was automatically disabled October 5, 2026 21:36

Pull request was converted to draft

@steipete
steipete force-pushed the steipete/perf-micro-subagent-registry-store-off-main-20260919 branch from 728a019 to ae0f0c1 Compare October 5, 2026 21:44
Prepare registry reads through the existing worker, page canonical restore,
and consume decoded completion receipts with exact physical row versions.
Preserve cancellation ordering, terminal-event atomicity, and source custody.

Native session maintenance observes foreign commits on one private live
connection and rereads only indexed prune candidates when its worker snapshot
is stale. Remove the superseded synchronous preservation API. No state schema,
configuration, retention, or migration changes are introduced.
Reuse the registry freezer for canonical metadata projections and compact
worker replies, preserving nested immutability and runtime ownership without
repeating generic descriptor and proxy classification during publication.

Move ACP spawn failure mapping into its existing result owner to keep the
spawn module within its line budget while preserving its result contract.
@steipete
steipete force-pushed the steipete/perf-micro-subagent-registry-store-off-main-20260919 branch from ae0f0c1 to c6c9752 Compare October 5, 2026 22:10
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 5, 2026
@steipete
steipete marked this pull request as ready for review October 6, 2026 02:02
@steipete
steipete enabled auto-merge (squash) October 6, 2026 02:05
@steipete
steipete merged commit ecd7875 into main Oct 6, 2026
199 of 203 checks passed
@steipete
steipete deleted the steipete/perf-micro-subagent-registry-store-off-main-20260919 branch October 6, 2026 02:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
…w#165684)

* perf(agents): move bulk registry work off the Gateway thread

Prepare registry reads through the existing worker, page canonical restore,
and consume decoded completion receipts with exact physical row versions.
Preserve cancellation ordering, terminal-event atomicity, and source custody.

Native session maintenance observes foreign commits on one private live
connection and rereads only indexed prune candidates when its worker snapshot
is stale. Remove the superseded synchronous preservation API. No state schema,
configuration, retention, or migration changes are introduced.

* perf(agents): avoid generic classification of registry projections

Reuse the registry freezer for canonical metadata projections and compact
worker replies, preserving nested immutability and runtime ownership without
repeating generic descriptor and proxy classification during publication.

Move ACP spawn failure mapping into its existing result owner to keep the
spawn module within its line budget while preserving its result contract.

* fix(agents): preserve registry admission across worker reads

* fix(agents): preserve registry callback contracts

* test(agents): finish registry reader and startup clock cutover

* perf(agents): bound registry restore startup and publication

* test(gateway): register real owner for session activity
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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