Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24dd782fc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const keys = targets.map((_, index) => keyAt(index)); | ||
| return prepareSessionRowSubagentArchive(keys).then((archive) => { | ||
| subagentArchive = archive; | ||
| subagentArchiveKeys = keys; | ||
| }); |
There was a problem hiding this comment.
Reuse archive preparation across unchanged session-row reads
For repeated list, describe, or event reads on an already-clean projection, subagentArchive starts unset on each invocation, so this unconditionally issues another archive worker read. The sessions branch of loadSubagentArchivedRunsInDatabase then loads and indexes the entire archive topology and, when any archive exists, the entire hot topology—even for a single unrelated session. Consequently, routine polling becomes proportional to all retained run history instead of the selected page, reintroducing recurring database and allocation costs as history grows. Retain a bounded, owner-invalidated prepared view across clean reads rather than rebuilding it for every request. This violates the clean-projection no-SQL requirement in src/gateway/AGENTS.md.
AGENTS.md reference: src/gateway/AGENTS.md:L50-L50
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The full-registry scan is fixed in the archive read owner. Session scopes now walk indexed requester/controller relationships, then include every archived generation of the selected children. The regression preserves returned records while reducing unrelated identities fetched across four reads from 256 to zero; an empty archive also returns before reading hot identities. The store and public-read files pass all 19 tests.
Prepared archive records and topology remain request-owned under the accepted cold-storage contract. The existing bounded derived display-output cache remains in use; retaining a prepared run map across requests would reintroduce archive residency. The Gateway guide now states the cold-history preparation boundary explicitly. Indexed on-demand SQL is the chosen tradeoff, and the required full Gateway comparison with matching controls is still pending; I will report its cost in the PR rather than treating the focused work-count proof as sufficient.
This comment has been minimized.
This comment has been minimized.
|
Codex review: needs real behavior proof before merge. What this changesThis PR archives settled kept subagent runs after 30 days while preserving historical reads and follow-ups. Example: A kept subagent completed 31 days ago with all delivery and cleanup obligations settled.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 8 items remain Keep open: this maintainer-authored performance change addresses retained registry growth, but introduces compatibility, cancellation-ordering, and read-path regressions that need repair before merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe subagent registry owns durable run records and publishes resident facts consumed by agent tools, admission, cancellation, restart recovery, and Gateway session projections. flowchart TD
A[Registry sweeper] --> B[Existing registry writer]
B --> C[Hot run storage]
B --> D[Archived run storage]
C --> E[Prepared registry reads]
D --> E
E --> F[Tools and Gateway projections]
F --> B
Technical reviewBest possible solution: Keep archival in the existing registry writer, preserve cancellation holds and private-memory isolation, align native schema support, and serve unchanged projection reads without repeated archive queries. Do we have a high-confidence way to reproduce the issue? Current main explicitly gives settled kept run-mode records an infinite sweep deadline; the introduced native-version mismatch and cancellation ordering are also source-verifiable and supported by exact-head CI annotations. Is this the best way to solve the issue? A durable archive behind the existing writer is a coherent solution, but request-scoped global rescans undermine its performance goal and the cutover must preserve native, cancellation, and memory-session contracts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 225af953d1b1. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was established, but restored archive ancestry needs final-effect rejection proof for foreign and replaced controllers. EvidenceSecurity concerns:
What I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 12:10 PM ET / 16:10 UTC. |
75ff2ab to
0d0da61
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d0da6104a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const archived = decodeSubagentRegistryRows( | ||
| readSubagentSessionListRows( | ||
| scope.kind === "children" ? { childSessionKeys: scope.sessionKeys } : {}, | ||
| database, | ||
| "subagent_run_archives", |
There was a problem hiding this comment.
Filter archived run-ID lookups before decoding history
When the scope is ids without exact, this passes an empty filter to readSubagentSessionListRows, projects and decodes every archived record, and only then selects matching IDs through SubagentSessionReadLookup. subagents.wait reaches this branch through prepareSubagentRunsSnapshotForRunIds even when its requested runs are all hot. Consequently, waiting on a single current task now incurs database JSON processing and worker allocations proportional to the entire indefinitely retained archive. Apply the run-ID/alias selection in storage before projecting and decoding historical records, while preserving alias lookup behavior.
Useful? React with 👍 / 👎.
0d0da61 to
067e03b
Compare
dbe2bcd to
693ecd1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89666efc78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const archive = await prepareSubagentArchiveSessionListRead({ | ||
| kind: "sessions", | ||
| sessionKeys: [requesterSessionKey], | ||
| descendants: true, | ||
| liveTopology: getSubagentSessionReadLookup(runs).captureTopology(), |
There was a problem hiding this comment.
Limit capacity preparation to history connecting pending work
For a long-lived requester with many archived completed children, every ordinary non-collector spawn now reloads and decodes that requester's entire archived descendant closure, even when no pending children exist and the capacity count is zero. Both subagent-spawn-request.ts and acp-spawn.ts call this preparation during admission; the session-scoped archive reader enumerates all matching historical generations and projects their metadata. Previously, capacity counting consumed resident metadata without repeating database history reads. Restrict historical preparation to ancestry needed by currently pending work, including skipping it when no pending work exists, so indefinitely retained history does not impose growing database and allocation costs on every new spawn.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6db7808f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(await listSubagentSessionListRunsForControllers([query.key])).map( | ||
| (run) => run.childSessionKey, | ||
| ), |
There was a problem hiding this comment.
Keep incognito child discovery on the memory path
For every existing incognito row, this now calls the asynchronous historical reader, which unconditionally prepares the persisted registry cache and reads the archive through the shared-state worker in production—even when the session has no children. Consequently, describing an actor-backed incognito session now depends on SQLite admission and worker availability instead of consuming its memory-owned facts. Use actor-owned or bounded live child metadata here without entering archive preparation for incognito rows.
AGENTS.md reference: src/gateway/AGENTS.md:L57-L57
Useful? React with 👍 / 👎.
d6db780 to
fa8fab0
Compare
fa8fab0 to
89a9dd0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89a9dd0606
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .selectEntries({ key: exactKey }, true) | ||
| .map((row) => row.key), | ||
| } | ||
| : undefined, |
There was a problem hiding this comment.
Scope parent-filtered list history to the requested tree
For a paginated sessions.list({ spawnedBy: parent }) request without an exact key, needsBroadArchive() forces this branch, but passing undefined requests { kind: "all" }. The archive worker consequently projects and decodes every retained archived run, including unrelated trees, before applying the parent filter. The indexed session-reader repair does not cover this path because this caller bypasses that scope, so repeated child-list polling still grows with total retained history. Prepare an indexed scope for the requested parent and any additional child identities needed for presentation instead.
AGENTS.md reference: src/gateway/AGENTS.md:L51-L51
Useful? React with 👍 / 👎.
Bind synthetic plugin hosts to the ingress owner resolver and retain their cleanup lifecycle. Account for every synchronous list-preparation phase.
Keep archive results request-owned while reusing prepared progress queries. Remove the separate publication identity and redundant source copies.
Only complete broad archive reads can replace exact-page relationship preparation. Preserve live physical-child activity when owner-count selection uses history scoped to one key and registry descendants move elsewhere.
8b8b8ef to
94c5798
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94c5798d3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| do { | ||
| await projection.prepareSelection({ yieldForCatalog: true }); | ||
| await projection.prepareMembership(); | ||
| subagentArchive = await prepareSessionRowSubagentArchive(); |
There was a problem hiding this comment.
Skip archive preparation on cached plugin-facts reads
When a plugin repeats a session-facts selection with unchanged roster and facts, this still prepares the entire archive before reaching the existing !wanted.size cache-hit return. Calling prepareSessionRowSubagentArchive() without a scope selects { kind: "all" }, so even a no-op cached read now projects and decodes all retained historical runs. This introduces database and allocation costs proportional to indefinitely retained history on every poll. Check the unchanged-cache path before preparing history, and scope archive preparation to the identities actually needing selection or refreshed facts.
AGENTS.md reference: src/gateway/AGENTS.md:L51-L51
Useful? React with 👍 / 👎.
|
Parking this as a draft. The retention win is real, but the read-path cost is adverse, so it doesn't meet the landing bar. Retained heap (10k-record fixture, 7,000 records archived): 27.14 → 9.53 MiB after archival (−64.9%), 30.19 → 11.32 MiB after reads (−62.5%). Cost, 16 ten-minute stress arms (640 turns/tools, zero RPC errors, all records conserved):
Owner reads alone are +14% CPU and +2.7% allocation. The lane's profiles put the extra work in session filtering and search over archived runs, and in the archive adapter cloning row descriptions and rebuilding presentation on every list. What a revival would need: archived runs must stay off the sessions.list hot path. For example, a list read that never consults the archive unless the query explicitly asks for archived history, plus presentation built once at archive time. The schema 36→37 step itself is cheap (an empty table, table-scoped backup of |
## What Problem This Solves A repeat captured Doctor still performs two full generation observations around shared-state readability even when no catalog or orphan repair is needed. Its readability helper also opens two empty immediate transactions on that clean path. The existing schema-repair owner now returns its prepared `needed` fact with `apply`. The prepared schema-repair owner owns its catalog repair transaction and exposes the same prepared apply operation to the generator. The generator consumes the needed fact once. Clean, artifact-free readability can finish without an attributed write phase; retained WAL/journal still use the original initial envelope, and catalog/orphan repair still resumes through capture before writing. The superseded forwarding helper is deleted. Full Doctor still invokes `apply` unconditionally inside its write transaction, retaining the ownership check after `BEGIN`. Actual repair still checks live authority at effect; original generation baseline, untouched-path final comparison, source custody, cancellation, awaited credentials and closure, and separate state/agent commits remain. No `capture.accept`, `openedSqlitePaths` shortcut, new cache, schema, generation, dependency or finalizer change. ## Acceptance rule (before count runs) Flow: repeat captured Doctor through committed `scripts/perf/doctor-captured-pass.mts`, starting from the same migrated four-agent/4096-session synthetic fixture at the same absolute path. Baseline must contain landed B1; candidate differs only by the readability owner simplification. Keep the retained-WAL native update flow as a separate compatibility cohort. Counts first, one matched base/candidate pair: clean no-companion readability removes one before/after generation observation pair (2 generation workers and 2 size workers), its 22 inspection SQL statements, and two empty immediate transactions; measure the remaining SQL/read/request deltas rather than assigning all totals to the deletion. Existing WAL or journal retains the initial envelope. Dirty catalog/orphan repair still enters the original capture before its first write; no skipped path calls capture.accept or marks itself opened. Full Doctor still executes the prepared ownership check unconditionally after BEGIN. Win: at least the two redundant readability observations removed in the actual repeat flow, total SQL/requests and runtime Gateway MAIN hold or improve, source/refusal/restoration/cleanup behavior unchanged, production net <=0 and test net <=0. Counts for main threads across child processes are labeled separately from runtime Gateway MAIN. No timing result from an instrumented profile is treated as a speedup. Timing: the campaign timing deadline expired at 2026-11-05T07:08:34Z. This PR uses deterministic worker/SQL/copied-byte counts only; it claims no CPU or wall-time speedup. The retained-WAL native update is a distinct compatibility cohort and is not timed for performance acceptance. Proof: red/green clean readability transaction/worker counts adapted into existing tests; retain same/different-content outside-write refusal, empty reader transition, malformed catalog plus preserved orphan recovery, synchronous and asynchronous behavior, and full Doctor post-BEGIN authority. Two isolated reviews, PG checklist and approval for exact head, matched native retained-WAL update, exact-head CI including three PG shards and published-driver cell, peer overlap audit. Expected remaining generation observations after the bounded cut: inventory 3; quick-index 2; readability 0; shared-state/credential opens 6; additive-agent schemas 8; legacy/schema/credential repair 6; total 25. Confirm with the production run; do not infer savings from source alone. The parameterized migration tests retain direct full-Doctor and readability-first routes for both synchronous SDK and asynchronous Doctor entrypoints. Malformed catalog, preserved orphan payload/BigInt/export, integrity, current version, refusal, and repeat-repair idempotency assertions remain. Production net -8 LOC; tests net -5 LOC. ## Evidence Current integration head: `e489ad6e51aa7775961d485eda51d7e501e4035a`. Merged current main `f34fb556b7ba6abdeedf102730b9214d61db299d` once to include the auth fake-clock fixture fix from #193451. All six B2 file blobs and B2’s diff against main are identical to the reviewed `e5ede773` patch. Count, native-update and published-driver evidence below therefore carry forward; the new normal pull-request [CI run42024239906](https://github.com/openclaw/openclaw/actions/runs/42024239906) passed, including all three PostgreSQL shards, static checks and the affected Node test groups. Required `openclaw/ci-gate`, dependency-review and security-sensitive-review are successful on this exact head. The prior auth-timer failure did not recur; no rerun was needed. No bypass will be used. Exact-head PostgreSQL review was carried by the coordinator after verifying the unchanged six B2 blobs. One matched repeat-Doctor pair on Node26.12.1/macOS restored the same pristine four-agent/4096-session synthetic fixture at its original absolute path (1,190files/428,490,104bytes; SHA256 `38f500c594546a577e093b58b3956dc42e3e85ef6d593b6acf15a84c98eadd34`). Both arms passed product/restoration checks and cleaned the fixture. | Scope | SQL base → candidate | Process-main SQL | Worker SQL | Requests | Copied bytes | |---|---:|---:|---:|---:|---:| | Doctor | 118,284 → 117,672 | 117,696 → 117,084 | 588 → 588 | 271 → 271 | 1,066,041,712 → 1,062,633,960 | | Parent/other | 4,321 → 4,321 | 4,302 → 4,302 | 19 → 19 | 18 → 18 | 427,888,640 → 427,888,640 | | Whole | 122,605 → 121,993 | 121,998 → 121,386 | 607 → 607 | 289 → 289 | 1,493,930,352 → 1,490,522,600 | Doctor generation/size27/27→25/25; whole32/32→30/30; process starts184→180. Open/close/execute/task request deltas all0. Process-main is CLI/child thread0, not runtime Gateway MAIN. SQL−612 is the observed pair result; the fixed deletion is22 inspection statements plus two empty transactions, with remaining authority/lease work dependent on elapsed progress. After normalizing elapsed busy_timeout values,34 SQL shapes decrease and none increases. Doctor main copy−3,428,352bytes, WAL prefix+20,600bytes, journal unchanged; total−3,407,752bytes. No timing saving is inferred. Remaining25 observations: inventory/settlement3, quick-index2, shared-state/credential opens6, additive-agent schemas8, legacy/schema/credential repair6. Readability pair2→0; other categories unchanged. No process/SQL ancestry gaps or PID reuse. The offline comparator initially omitted the four source .ts generation workers per arm; an independent spawn/lifetime audit confirmed them, and accepting only the exact .js/.ts entrypoints fixed comparison without changing raw records or rerunning either product arm. Historical B1 SQL totals are not directly comparable because this baseline includes inherited plugin-preparation work. The separate retained-WAL native update pair passed exact activation/build identity, deferred-to-completed retirement, real Gateway transport, process stop and zero cleanup errors. Both arms started with identical main/WAL byte counts and identical three Doctor WAL/SHM boundaries. | Native scope | SQL base → candidate | Requests base → candidate | Generation / size processes base → candidate | |---|---:|---:|---:| | Whole flow | 296,063 → 294,567 | 155,714 → 155,716 | 68 / 65 → 64 / 61 | | Preflight Doctor | 3,608 → 3,580 | 119 → 119 | 0 / 0 → 0 / 0 | | Installed Doctor | 146,880 → 146,269 | 351 → 351 | 32 / 32 → 30 / 30 | | Final Doctor | 121,076 → 120,464 | 166 → 166 | 21 / 21 → 19 / 19 | Direct runtime Gateway MAIN holds: canary 44→44; final Gateway 53→53 (startup/readiness48 + shutdown5). Whole process-main SQL290,019→288,520 is a different metric; workerSQL6,044→6,047. Whole-flow SQL is cadence-dependent, not a fixed per-invocation saving. Native copied bytes are unmeasured, not zero; no CPU/wall speedup or warm-steady claim. All adverse native movements remain counted: one Doctor lease heartbeat; a shutdown plugin-catalog cache task/read; one canary sandboxRegistry.list schema-version read; and a final startup-integrity completion followed by its database open. Outside-Doctor cache scan0→1 and cache_size2→3 are disclosed. All12 relevant owners are blob-identical base/head. These are timing-dependent background progress differences, cause not proven. The coordinator explicitly accepted +2requests/+3workerSQL and the new cells after source attribution; none is subtracted as noise. Two raw macOS leaf PIDs were each reused in disjoint process lifetimes. A strict offline split preserves all2,850 process events and62 affected SQL records, every raw hash and total. An isolated independent audit reconciles294,567SQL/155,716requests. Unobserved shell parents leave an ancestry coverage gap; all observed children remain counted (598SQL/0requests each arm, before Doctor). Validation:132 owner tests passed on the production-equivalent head, including retained artifacts, outside-write refusal, empty readers, credential preparation/close and retirement. The B1 red control performs2 observations versus expected0; B2 passes. Final4 ownership cases, typed lint, format and line-cap pass. Two full isolated Codex reviews plus required production-delta/test corrections are clean. Exact-head PostgreSQL approval is recorded. Local broad check:changed was canceled143 and is not a pass; CI supplies broad gates. Original proof-head CI run [42003968887](https://github.com/openclaw/openclaw/actions/runs/42003968887) passed all three PostgreSQL shards, types, typed lint, source contracts, ratchets, SDK API diff and the [published-driver/native-systemd cell](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127173500397). The run is not reported green: its original auth timer, deferred-project marker and UI timeout failures remain recorded. The single approved projects retry [127208432932](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127208432932) passed (11:08:56–11:34:54Z). The original marker ENOENT remains disclosed; no source fix or weakened assertion was introduced. The corrected PR body also passed its context/evidence check [127216156959](https://github.com/openclaw/openclaw/actions/runs/42018847897/job/127216156959). The auth retry reproduced a leftover fake timer at `auth-controller.test.ts:226` and a separate cleanup-authority timeout. After the single Testbox allocation queued and was stopped without executing tests, the coordinator authorized one exact 19-file Node24.22.1/macOS replay per arm, with CI's three workers and isolation configuration unchanged. Both base and candidate reproduce the same timer assertion (base377pass/1fail; candidate382pass/1fail); all other18files pass, and worker cleanup completes. All source archive bytes verified before/after. This establishes matching-signature baseline evidence on macOS, not a Linux result, a fix, or a green suite. The follow-up #193451 attributed this timer to tsx disk-cache initialization captured by the fake clock and prepares it before the clock starts, retaining all assertions. That test-only fix is now included by the main merge; the new normal CI must confirm it on this integration head. The source-identical90s cleanup timeout remains disclosed. No assertion or timeout was weakened. The UI timeout has no assertion failure and is coordinator-dispositioned as unrelated. Knip's sole `handleUpgradeRequest` export finding is independently reproduced in scheduled main run41994726590/job127135524057, then fixed on main by73145; the prospective merge retains the exact fixed blob. No new static findings are accepted. Production net−8 LOC; tests net−5 LOC. Benchmark +12 lines adds a freshly created explicit scratch root so arms run at the same absolute path; default path and cleanup are unchanged. No B2 file changes followed final review; the current head additionally contains the unchanged main merge described above. Overlap refreshed on the integrated head through the shared PR index: #193393 at `f545ae3d` merges cleanly both before and after B2; #192228/#188492/#166475/#149882/#146868 add no conflicts (7/34/18/92/7 inherited paths respectively). #192698 retains 2,751 conflicting paths in both arms and no new conflict relation. The repair-owner block is resegmented inside its already-conflicted file, covered by the coordinator’s explicit standing disposition for that draft. The previous 2,912-path count belonged to the earlier base. No per-PR census was used. Acceptance marker: `DOCTORGEN-B2-COUNTS-e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`. Measured candidate: `e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`; exact base: `ef81b2545c8cf6f20f1b2723628fc5291d45bde0`. The same existing migrated fixture is restored at one path for each count arm; the native retained-WAL cohort is separately restored at its own fixed path. Final test-only correction restores the baseline DatabaseSync.exec descriptor capture after typed lint rejected the direct unbound method reference. Four ownership-injection cases pass; an isolated delta review is clean. Production is byte-identical to the PostgreSQL-approved 24a93d8 head. The earlier CI runner also hit a documented 8 GiB fixture disk requirement with only 7.2–7.3 GiB free; this is retained as environment evidence, not claimed as a passing test. The final exact-head CI outcomes and their dispositions are recorded above. Count setup correction (before the replacement pair): the first baseline ran 39 generation/size processes because moving the byte-identical migrated fixture invalidated its existing absolute-path daemon-runtime-pin receipt, adding six migration envelopes. That attempt is excluded from repeat-Doctor acceptance. Candidate attempts stopped before repair because the temporary artifact observer matched only a single-line repair initializer. B2 emits that initializer over multiple lines; the observer crashed the child during import, and its parent correctly refused the exited process identity. A small direct module import reproduced the observer error. The corrected bounded multiline observer imports both exact repair-owner modules successfully; no product authority behavior changed. The replacement pair restores the unchanged pristine fixture at its original path for both arms. The original 27→25 projection and all acceptance thresholds remain unchanged. The canceled second attempt stopped during preflight and executed no Doctor. Final landing check: current main includes #193393. Its additive standing-advisories benchmark changes merge cleanly with B2; all five reviewed production/test files remain byte-identical. This is main-owned benchmark integration only; B2 head and its own diff have not changed.
…193360) ## What Problem This Solves A repeat captured Doctor still performs two full generation observations around shared-state readability even when no catalog or orphan repair is needed. Its readability helper also opens two empty immediate transactions on that clean path. The existing schema-repair owner now returns its prepared `needed` fact with `apply`. The prepared schema-repair owner owns its catalog repair transaction and exposes the same prepared apply operation to the generator. The generator consumes the needed fact once. Clean, artifact-free readability can finish without an attributed write phase; retained WAL/journal still use the original initial envelope, and catalog/orphan repair still resumes through capture before writing. The superseded forwarding helper is deleted. Full Doctor still invokes `apply` unconditionally inside its write transaction, retaining the ownership check after `BEGIN`. Actual repair still checks live authority at effect; original generation baseline, untouched-path final comparison, source custody, cancellation, awaited credentials and closure, and separate state/agent commits remain. No `capture.accept`, `openedSqlitePaths` shortcut, new cache, schema, generation, dependency or finalizer change. ## Acceptance rule (before count runs) Flow: repeat captured Doctor through committed `scripts/perf/doctor-captured-pass.mts`, starting from the same migrated four-agent/4096-session synthetic fixture at the same absolute path. Baseline must contain landed B1; candidate differs only by the readability owner simplification. Keep the retained-WAL native update flow as a separate compatibility cohort. Counts first, one matched base/candidate pair: clean no-companion readability removes one before/after generation observation pair (2 generation workers and 2 size workers), its 22 inspection SQL statements, and two empty immediate transactions; measure the remaining SQL/read/request deltas rather than assigning all totals to the deletion. Existing WAL or journal retains the initial envelope. Dirty catalog/orphan repair still enters the original capture before its first write; no skipped path calls capture.accept or marks itself opened. Full Doctor still executes the prepared ownership check unconditionally after BEGIN. Win: at least the two redundant readability observations removed in the actual repeat flow, total SQL/requests and runtime Gateway MAIN hold or improve, source/refusal/restoration/cleanup behavior unchanged, production net <=0 and test net <=0. Counts for main threads across child processes are labeled separately from runtime Gateway MAIN. No timing result from an instrumented profile is treated as a speedup. Timing: the campaign timing deadline expired at 2026-11-05T07:08:34Z. This PR uses deterministic worker/SQL/copied-byte counts only; it claims no CPU or wall-time speedup. The retained-WAL native update is a distinct compatibility cohort and is not timed for performance acceptance. Proof: red/green clean readability transaction/worker counts adapted into existing tests; retain same/different-content outside-write refusal, empty reader transition, malformed catalog plus preserved orphan recovery, synchronous and asynchronous behavior, and full Doctor post-BEGIN authority. Two isolated reviews, PG checklist and approval for exact head, matched native retained-WAL update, exact-head CI including three PG shards and published-driver cell, peer overlap audit. Expected remaining generation observations after the bounded cut: inventory 3; quick-index 2; readability 0; shared-state/credential opens 6; additive-agent schemas 8; legacy/schema/credential repair 6; total 25. Confirm with the production run; do not infer savings from source alone. The parameterized migration tests retain direct full-Doctor and readability-first routes for both synchronous SDK and asynchronous Doctor entrypoints. Malformed catalog, preserved orphan payload/BigInt/export, integrity, current version, refusal, and repeat-repair idempotency assertions remain. Production net -8 LOC; tests net -5 LOC. ## Evidence Current integration head: `e489ad6e51aa7775961d485eda51d7e501e4035a`. Merged current main `5166bef057aecf7c139598ad0d1ce3ac53cbd626` once to include the auth fake-clock fixture fix from openclaw#193451. All six B2 file blobs and B2’s diff against main are identical to the reviewed `e5ede773` patch. Count, native-update and published-driver evidence below therefore carry forward; the new normal pull-request [CI run42024239906](https://github.com/openclaw/openclaw/actions/runs/42024239906) passed, including all three PostgreSQL shards, static checks and the affected Node test groups. Required `openclaw/ci-gate`, dependency-review and security-sensitive-review are successful on this exact head. The prior auth-timer failure did not recur; no rerun was needed. No bypass will be used. Exact-head PostgreSQL review was carried by the coordinator after verifying the unchanged six B2 blobs. One matched repeat-Doctor pair on Node26.12.1/macOS restored the same pristine four-agent/4096-session synthetic fixture at its original absolute path (1,190files/428,490,104bytes; SHA256 `38f500c594546a577e093b58b3956dc42e3e85ef6d593b6acf15a84c98eadd34`). Both arms passed product/restoration checks and cleaned the fixture. | Scope | SQL base → candidate | Process-main SQL | Worker SQL | Requests | Copied bytes | |---|---:|---:|---:|---:|---:| | Doctor | 118,284 → 117,672 | 117,696 → 117,084 | 588 → 588 | 271 → 271 | 1,066,041,712 → 1,062,633,960 | | Parent/other | 4,321 → 4,321 | 4,302 → 4,302 | 19 → 19 | 18 → 18 | 427,888,640 → 427,888,640 | | Whole | 122,605 → 121,993 | 121,998 → 121,386 | 607 → 607 | 289 → 289 | 1,493,930,352 → 1,490,522,600 | Doctor generation/size27/27→25/25; whole32/32→30/30; process starts184→180. Open/close/execute/task request deltas all0. Process-main is CLI/child thread0, not runtime Gateway MAIN. SQL−612 is the observed pair result; the fixed deletion is22 inspection statements plus two empty transactions, with remaining authority/lease work dependent on elapsed progress. After normalizing elapsed busy_timeout values,34 SQL shapes decrease and none increases. Doctor main copy−3,428,352bytes, WAL prefix+20,600bytes, journal unchanged; total−3,407,752bytes. No timing saving is inferred. Remaining25 observations: inventory/settlement3, quick-index2, shared-state/credential opens6, additive-agent schemas8, legacy/schema/credential repair6. Readability pair2→0; other categories unchanged. No process/SQL ancestry gaps or PID reuse. The offline comparator initially omitted the four source .ts generation workers per arm; an independent spawn/lifetime audit confirmed them, and accepting only the exact .js/.ts entrypoints fixed comparison without changing raw records or rerunning either product arm. Historical B1 SQL totals are not directly comparable because this baseline includes inherited plugin-preparation work. The separate retained-WAL native update pair passed exact activation/build identity, deferred-to-completed retirement, real Gateway transport, process stop and zero cleanup errors. Both arms started with identical main/WAL byte counts and identical three Doctor WAL/SHM boundaries. | Native scope | SQL base → candidate | Requests base → candidate | Generation / size processes base → candidate | |---|---:|---:|---:| | Whole flow | 296,063 → 294,567 | 155,714 → 155,716 | 68 / 65 → 64 / 61 | | Preflight Doctor | 3,608 → 3,580 | 119 → 119 | 0 / 0 → 0 / 0 | | Installed Doctor | 146,880 → 146,269 | 351 → 351 | 32 / 32 → 30 / 30 | | Final Doctor | 121,076 → 120,464 | 166 → 166 | 21 / 21 → 19 / 19 | Direct runtime Gateway MAIN holds: canary 44→44; final Gateway 53→53 (startup/readiness48 + shutdown5). Whole process-main SQL290,019→288,520 is a different metric; workerSQL6,044→6,047. Whole-flow SQL is cadence-dependent, not a fixed per-invocation saving. Native copied bytes are unmeasured, not zero; no CPU/wall speedup or warm-steady claim. All adverse native movements remain counted: one Doctor lease heartbeat; a shutdown plugin-catalog cache task/read; one canary sandboxRegistry.list schema-version read; and a final startup-integrity completion followed by its database open. Outside-Doctor cache scan0→1 and cache_size2→3 are disclosed. All12 relevant owners are blob-identical base/head. These are timing-dependent background progress differences, cause not proven. The coordinator explicitly accepted +2requests/+3workerSQL and the new cells after source attribution; none is subtracted as noise. Two raw macOS leaf PIDs were each reused in disjoint process lifetimes. A strict offline split preserves all2,850 process events and62 affected SQL records, every raw hash and total. An isolated independent audit reconciles294,567SQL/155,716requests. Unobserved shell parents leave an ancestry coverage gap; all observed children remain counted (598SQL/0requests each arm, before Doctor). Validation:132 owner tests passed on the production-equivalent head, including retained artifacts, outside-write refusal, empty readers, credential preparation/close and retirement. The B1 red control performs2 observations versus expected0; B2 passes. Final4 ownership cases, typed lint, format and line-cap pass. Two full isolated Codex reviews plus required production-delta/test corrections are clean. Exact-head PostgreSQL approval is recorded. Local broad check:changed was canceled143 and is not a pass; CI supplies broad gates. Original proof-head CI run [42003968887](https://github.com/openclaw/openclaw/actions/runs/42003968887) passed all three PostgreSQL shards, types, typed lint, source contracts, ratchets, SDK API diff and the [published-driver/native-systemd cell](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127173500397). The run is not reported green: its original auth timer, deferred-project marker and UI timeout failures remain recorded. The single approved projects retry [127208432932](https://github.com/openclaw/openclaw/actions/runs/42003968887/job/127208432932) passed (11:08:56–11:34:54Z). The original marker ENOENT remains disclosed; no source fix or weakened assertion was introduced. The corrected PR body also passed its context/evidence check [127216156959](https://github.com/openclaw/openclaw/actions/runs/42018847897/job/127216156959). The auth retry reproduced a leftover fake timer at `auth-controller.test.ts:226` and a separate cleanup-authority timeout. After the single Testbox allocation queued and was stopped without executing tests, the coordinator authorized one exact 19-file Node24.22.1/macOS replay per arm, with CI's three workers and isolation configuration unchanged. Both base and candidate reproduce the same timer assertion (base377pass/1fail; candidate382pass/1fail); all other18files pass, and worker cleanup completes. All source archive bytes verified before/after. This establishes matching-signature baseline evidence on macOS, not a Linux result, a fix, or a green suite. The follow-up openclaw#193451 attributed this timer to tsx disk-cache initialization captured by the fake clock and prepares it before the clock starts, retaining all assertions. That test-only fix is now included by the main merge; the new normal CI must confirm it on this integration head. The source-identical90s cleanup timeout remains disclosed. No assertion or timeout was weakened. The UI timeout has no assertion failure and is coordinator-dispositioned as unrelated. Knip's sole `handleUpgradeRequest` export finding is independently reproduced in scheduled main run41994726590/job127135524057, then fixed on main by73145; the prospective merge retains the exact fixed blob. No new static findings are accepted. Production net−8 LOC; tests net−5 LOC. Benchmark +12 lines adds a freshly created explicit scratch root so arms run at the same absolute path; default path and cleanup are unchanged. No B2 file changes followed final review; the current head additionally contains the unchanged main merge described above. Overlap refreshed on the integrated head through the shared PR index: openclaw#193393 at `f545ae3d` merges cleanly both before and after B2; openclaw#192228/openclaw#188492/openclaw#166475/openclaw#149882/openclaw#146868 add no conflicts (7/34/18/92/7 inherited paths respectively). openclaw#192698 retains 2,751 conflicting paths in both arms and no new conflict relation. The repair-owner block is resegmented inside its already-conflicted file, covered by the coordinator’s explicit standing disposition for that draft. The previous 2,912-path count belonged to the earlier base. No per-PR census was used. Acceptance marker: `DOCTORGEN-B2-COUNTS-e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`. Measured candidate: `e5ede7735ee5d56033c3a5a8f36383190fcbcaa3`; exact base: `3a560c82e47ad5d8283886b4a17601a0dc8ddf67`. The same existing migrated fixture is restored at one path for each count arm; the native retained-WAL cohort is separately restored at its own fixed path. Final test-only correction restores the baseline DatabaseSync.exec descriptor capture after typed lint rejected the direct unbound method reference. Four ownership-injection cases pass; an isolated delta review is clean. Production is byte-identical to the PostgreSQL-approved 24a93d8 head. The earlier CI runner also hit a documented 8 GiB fixture disk requirement with only 7.2–7.3 GiB free; this is retained as environment evidence, not claimed as a passing test. The final exact-head CI outcomes and their dispositions are recorded above. Count setup correction (before the replacement pair): the first baseline ran 39 generation/size processes because moving the byte-identical migrated fixture invalidated its existing absolute-path daemon-runtime-pin receipt, adding six migration envelopes. That attempt is excluded from repeat-Doctor acceptance. Candidate attempts stopped before repair because the temporary artifact observer matched only a single-line repair initializer. B2 emits that initializer over multiple lines; the observer crashed the child during import, and its parent correctly refused the exited process identity. A small direct module import reproduced the observer error. The corrected bounded multiline observer imports both exact repair-owner modules successfully; no product authority behavior changed. The replacement pair restores the unchanged pristine fixture at its original path for both arms. The original 27→25 projection and all acceptance thresholds remain unchanged. The canceled second attempt stopped during preflight and executed no Doctor. Final landing check: current main includes openclaw#193393. Its additive standing-advisories benchmark changes merge cleanly with B2; all five reviewed production/test files remain byte-identical. This is main-owned benchmark integration only; B2 head and its own diff have not changed.
What Problem This Solves
Completed kept subagent runs currently remain resident indefinitely. This change moves settled run-mode records strictly older than 30 days out of the resident registry and hot table while keeping their results, status, aliases and ancestry readable through the existing APIs. It does not delete sessions, transcripts, attachments or worktrees. Session-mode bookkeeping retains its existing five-minute retirement policy.
DO NOT MERGE: exact-head CI and correctness/storage checks pass, but the completed 160-minute controlled Gateway campaign fails the CPU and allocation performance gates: main-thread CPU +32.40%, allocation +37.69%. Matching A/A controls are +10.30% CPU and +0.01% allocation. Retained heap improves; latency and GC remain inconclusive under the control rules. Earlier adverse results remain below.
4f5c80371653d74babd77502ac098646e3e21e79; OPEN and ready; latest GitHub read is CONFLICTING after main advanced40b332d1a8a97ab955a08b17e27554f5fa7b94cd; 23 lane commits929c693f7250b0deeaa448670df87b4bd0c64e49on mainc504abf10afae7c25c9943744622f106ff6a9b2cImplementation and storage checkpoint
Peter accepted this contract on 2026-10-30, relayed by the performance lead: a new shared-state
subagent_run_archivestable; consecutive shared schema 36→37; an empty-table migration through normal SQLite/PostgreSQL startup and Doctor; older-version refusal and backup rollback; bounded archival; archive-aware public reads; and exact-generation follow-up restoration. The material database-change checkpoint and worker-access rules were reviewed before implementation. Pinned integration base40b remains shared36/agent39; this lane remains shared37/agent39. No further version bump is introduced by the latest integration.The existing minute sweeper and registry writer transfer at most 128 rows and approximately 1 MiB of canonical payload per transaction, admitting one oversized row for progress. Unfinished cleanup, delivery, cancellation, requester and collector obligations defer archival. Durable commit receipts precede resident eviction; retries and uncertain acknowledgements use the existing mutation owner. The first 10k-record drain is bounded per pass and restart-safe. Follow-ups restore the exact archived generation before advancing execution. Cancellation promotes only the ancestry anchors required by the current cancellation owner. Explicit deletion removes either storage location.
Historical reads are request-owned and do not repopulate resident registry caches. Indexed identity traversal selects matching rows before decoding archived payloads. The cutover includes aliases and latest generations, tools, active-capacity admission, delivery, follow-ups, restart ancestry and Gateway presentation. Exact pages include physical child links and expanded ancestors. Search collects history only when the existing predicate reaches unresolved historical status/model vocabulary; metadata matches avoid that work.
spawnedByand non-idle owner counts retain broad lineage. New keys, live work or source changes after an await retry existing preparation. Child-only search history never substitutes for a page’s complete relationship view.The final presentation path reuses immutable resident row sources and tags nonempty archive contexts as transient. Transient reads bypass both lookup and population of retained run-state caches; registry eviction forgets old prepared facts. The redundant publication identity is removed. No additional cache, configuration option or authority owner is introduced. The exact-key repair allows only genuinely broad history to substitute for page relationship preparation.
Two conservative discovery snapshots are intentional: admitted group planning may still count selected settled history after concurrent deletion, and registration discovery may retain a deleted archive-only candidate until its next scope. Fresh FIFO mutation admission omits deleted candidates and cannot resurrect them. Neither snapshot creates execution authority or active-capacity reservations; public historical reads still invalidate on archive revision.
The migration performs no bulk rewrite. A verified pre-migration backup preserves original hot records; an older binary refuses schema 37. Rollback restores that backup with its matching binary, rather than downgrading in place while preserving later writes.
Evidence
All fixtures and Gateways are synthetic and isolated. No Team load, process or state was touched.
52fbfb7d989207a4f82544f58b5bb9ee75782fe9replay fails the resident assertion before archive-only SQL (1 failed, 6 skipped, 43.28 s wrapper); an earlier red at6ac91adabcc273e76a2d652a5aefc9955b0600f8is separate. Focused worker proof covers exact day 30, pending obligations, 10k backlog, oversized progress, transaction rollback, committed-but-unacknowledged archival, restart and deletion.holdSubagentExecutioncustody and first proves zero registry descendants plus active physical child state. Original 749 condition: valid RED 1 failed/15filtered,42.77 s. Fixed condition: GREEN 1passed/15filtered,60.47 s; full 26 tests and static gates pass.[email protected]synthetic shared 20 stores upgrade through startup and Doctor to 37, preserving payloads and initially empty archives. The released version guard refuses 37; verified backup recovery restores 20. At 3748, startup 1,269.8 ms/Doctor 1,322.0 ms; all 14owned processes exited without signals. This tests the old-version guard, not a full old-Gateway launch or agent 39 restart.pnpm tsgo:test:rootproof across four partitions was reused. Current 94c adds clean integration review 46 and guard review 48,88 integration tests plus 32 affected replays, and final targeted static gates.The current integration includes incoming main typing and config-reload/catalog behavior. Registration now starts the upstream typing owner; exact row preparation can rebind a stale catalog once before consumer execution. These changes are included in review46 and in the completed40b/94c runtime comparison reported below. The prior 3748→929c storage audit found all 69generated catalogs, canonical SQL, migration/backup/integrity-worker paths, generator inputs, package and lockfile unchanged; the subsequent 40b audit also confirms the storage/upgrade/rollback inputs remain unchanged. Reviews and checks are attributed to the exact source/patch they captured; no incomplete review is called clean.
Completed canonical Gateway comparison — current production candidate
Already-built base
40b332d1a8a97ab955a08b17e27554f5fa7b94cd→ candidate94c5798d3f95100a536660f00fcf59a29b71da37; final head4f5c80371653d74babd77502ac098646e3e21e79differs only in two test-routing entries. Runtime equivalence is verified. Entry SHA256 base1fbeece8a4e16509ec2f4cf8c14319cc74bd35070d2e756df517965e2ee3f0ea, candidate13702304304d55738b857fadda5103c1d1f0ba156243dbb3fa80b773e6e610e2.The canonical campaign completed 16 ten-minute arms / 160.0287 measured minutes: two AB/BA comparisons and two matching A/A pairs in each of untraced timing and sampled allocation modes. Each arm used 10,800 sessions,65WebSocket clients,40 enabled catalog entries (10 active catalog modules plus memory-core;30 lazy),four concurrent native mock-provider turns with tool calls,25-second polling,6-second churn,60-second rounds and warmup,128MiB fixture transcripts,four agents,seed1711,kept-run age100days. Every arm completed40 turns and40 tool calls: 640/640 total, zero RPC errors, all4,300 seeded records conserved. The candidate finished with1,408 archived in three arms and1,280 in its second allocation arm; no count is assumed from cadence. Timing and allocation use separate passes; allocation is sampled JavaScript allocation, not promotion/native allocation.
Gate assessment: CPU and allocation are adverse. Untraced CPU rises 7.3343→9.7109%, +2.3766percentage points/+32.40%; paired changes +10.42%/+54.84%. Matching timing A/A rises+10.30% overall, with +12.44%/+7.77% pairs, so it does not trigger the CPU gate. The first comparison CPU delta does not exceed its matching control; the second has substantial host-load drift, retained explicitly. Allocation rises 19.6330→27.0316MiB/s, +7.3987MiB/s/+37.69%; both pairs rise (+39.42%/+36.03%), versus essentially unchanged allocation A/A (+0.01%). The owner retained-heap benefit does not clear these gates.
Latency remains inconclusive, not an independent adverse verdict: client loop/list and server-handler A/A results themselves trigger noise thresholds; comparison timing tail deltas also change sign. GC remains inconclusive: timing delta −1.73/+536.81ms/min is mixed, and only two A/A pairs per mode were collected, fewer than the four required before GC/promotion/max-pause rejection. No extra latency/GC pair is used to manufacture an acceptance; CPU/allocation already fail independently. Instrumented timing/GC values are context only. Host load and all pauses are retained, including allocation-base2 mean85.86/max116.41. No maintenance window or outlier is excluded.
Independent read-only audit recomputed all16 raw identities, CPU/allocation/GC arithmetic, signed means, client tails/counts, duration-weighted host load, and first-to-last server histogram deltas/bounds; all match. Server histogram samples are1172–1174, client list1188–1204, loop17056–28094. Timing has40scrapes/arm, allocation41 except its second baseline42; the actual last scrape is used. RSS covers the Gateway process including worker threads, not all subprocesses. Main-isolate heap, final scraped native major-GC gauge, explicit post-window settled old space, and the owner benchmark's empty-baseline-subtracted retained heap are distinct measurements.
Captured allocation stack attribution consistently points to archive-backed presentation and historical index preparation. Archive-overlay inclusive deltas are+4.230/+4.693MiB/s and topology self+0.506/+0.739MiB/s; presentation/serialization and IPC also rise. Inclusive paths overlap and must not be added. Endpoint
.heapprofilefiles include some collector-finalization allocation after the sealed summary; these normalized endpoint rates locate work but are not the canonical allocation gate. The current immutable row/source reuse already removes nonswarm row copies. Read-only source review found no small safe deletion that credibly removes the whole regression: request topology preserves latest-generation veto and relationship traversal, and parent child-activity revisions preserve changed-child-fact freshness. An immutable historical-read construction path inside the existing topology owner is a potential next design target, not an implemented or proven fix. No global archived-record cache or weakened freshness contract was added to chase the result.Separate matching three-minute CPU diagnostics also completed on frozen40b/94c:12native turns/tools each,362/365list RPCs,27,765.202→30,422.393ms recorded main-thread CPU. Measured host load differs materially: base71.79[62.66,79.32],candidate59.94[56.64,62.92]. Inspector sample weights are elapsed intervals, not exact per-function CPU: list/filter/search self+2,896.748ms, archive/index/read self+437.155ms, presentation self+103.145ms, parent child-activity self+14.276ms. Different inclusive families overlap. The canonical
--workload-cpu-profileoption installs its standard profiling preload; no ad-hoc preload or source patch was used. Candidate ended at384archived records, earlier than the full comparison's1,280–1,408. These diagnostics do not override the untraced gates. Both wrappers and all verified owned children exited0, with no signals; no runtime work remains.Cleanup confirms no surviving verified lane-owned identities and no signals. macOS reused historical PID numbers during this long campaign; the monitor corrected ownership to current ancestry plus start time before cleanup. No unrelated process was acted on. Canonical temp cleanup returned successfully per arm; exact temp paths were not independently enumerated, so no stronger deletion claim is made. The full comparison, per-arm data and cleanup receipts are preserved under
team-stress-comparison-94c5798d3f95/.16 complete ten-minute arms recorded. Timing and allocation modes are separate; only complete pairs are aggregated. Exact frozen runtime identity and all raw counts are in campaign.json and extra-summary.json.
Interpretation requires the paired signed absolute deltas, matching A/A spread and host load. This generated table makes no adverse verdict. Before rejection on GC/promotion/max-pause, at least four matched A/A pairs in the same instrumentation mode are required. Major tails below50 collections and p99 below1000/p95 below200 samples are context only. No pauses were trimmed or host-load/maintenance windows excluded.
Server p99 is interpolated within Prometheus histogram buckets using first-to-last scrape deltas, not exact raw handler quantiles. Host-load means weight telemetry windows by duration. RSS includes workers; heap is main-isolate; settled old generation is post-GC native heap-space measurement. Raw per-minute metrics remain preserved.
Newest completed owner measurements — production 929c
Registry:
c504abf10afae7c25c9943744622f106ff6a9b2c→929c693f7250b0deeaa448670df87b4bd0c64e49, pinned Node 26.12.1. Each fresh store has 10,000 runs aged 1–100days and 2,000 deterministic exact-ID task/result reads. Two counterbalanced pairs separately for timing and allocation provide 4,000 timing reads and 4,000 allocation reads per side. Both initial CPU deltas had the same sign, so no extra pair ran.This is a retained-main-heap benefit with real measured costs, not an RSS or exact-read CPU win. Main CPU pairs are 924.864→931.159 ms (+0.68%) and 1,281.943→1,587.941 ms (+23.87%); process CPU +2.77%/+26.13%; wall +5.76%/+104.31%. Allocation pairs are 362.655→372.537 MiB (+2.72%) and 360.445→370.092 MiB (+2.68%). After-read RSS pairs rise 106.634 MiB (+14.02%) and 86.570 MiB (+11.14%); after-archive RSS rises 71.178/73.052 MiB (+10.93%/+11.11%). Sampled-pass CPU is separately contextual:1,176.233→1,460.519 ms (+284.286 ms,+24.17%), with pairs+1.19%/+59.62%.
All payload/no-repopulation assertions pass; every candidate moves 7,000 records in 55 batches of at most 128 and retains 3,000after reads. Exact-day 30 stays hot. One-time transfer costs are 84.792/161.676 ms main CPU,5,599.991/6,943.659 ms process CPU; allocation passes sample 64.096/65.705 MiB. These are separate from steady reads. Retained heap is forced-GC main-isolate heap above the same-process empty-owner baseline; the empty baseline varies approximately 5 MiB between some arms. Raw heap/RSS are reported separately. Timing and sampled allocation use fresh separate processes; sampled JS allocation excludes native/external bytes.
All arms, including higher-load windows, remain included. Load is context, not an excuse or exclusion. No final Gateway verdict follows from these owner results.
Archived-leaf repair:
62aeea2bf7a05d20758152ff27b044289e150491→929c693f7250b0deeaa448670df87b4bd0c64e49, both with archives on the same upstream base. Each arm performs 2,000 public lists after 48 warmups over 100proven archived leaves in 10,000 sessions: 4,000 timing lists and 4,000 allocation lists per side.CPU pairs improve 38.67%/35.48%, allocation 35.51%/34.82%, wall 20.03%/17.20%. Every arm reuses 100row identities, matches payload goldens and conserves 750 resident/1,738 archived runs. No extra pair ran; all arms remain. Main-isolate heap and process RSS snapshots supplement the separate registry proof. Raw identities, counts, loads and hashes are in
owner-comparison-929c693f7250/summary.mdandarchive-transient-owner-comparison-929c693f7250/summary.mdunder the lane evidence directory.Previous owner results — retained context, not current-runtime proof
The same registry workload used 4,000 timing/4,000 allocation reads per side at 89;3748 and 17ee each included their one predeclared extra timing pair after mixed signs, totaling 6,000 timing/4,000 allocation reads per side. Every candidate retained 3,000of10,000 runs after reads. Values below preserve the unfavorable results as well as retained-heap gains.
8c69e8b71d3be0a8543e3480161e8e01f4fd9e5c→3748c5f4300b166d7367b8fe051ca44efb192f6d2bf9cb68e2a81891789055a4183fe60454235b60→17ee5c10114fe6ca7d75e72844be59cd2c9d035d7d5130f74c226ef71ce4858f9e3f95b166447586→89a9dd0606ed06785a3a8deac6ab67192bf532e53748 CPU pairs were−29.15%,+0.27%,+7.49%, not a consistent win; loads 8.93–14.03.17ee CPU pairs were+2.37%,−0.84%,+21.41%; its third pair is retained, with host load base 30.10→30.37 and candidate 33.27→43.30 versus approximately 15.66–16.15 in the first two pairs.89 CPU pairs improved 3.09%/3.04%, but sampled-pass CPU rose 13.33%; raw main heap 121.619→105.295 MiB (−16.325,−13.42%). Its one-time archival costs were 88.688/92.172 ms main CPU,3,126.138/3,489.221 ms process CPU and 66.017/65.549 MiB sampled allocation; loads 10.83–12.93. These are retained costs, not normalized away.
Earlier registry observations:
1bf930c8e40a547f0e2eda87f895b2a7a00e644a→fa8fab07122647857bc6d805240db5b92940f896: after-read retained heap 25.244→10.482 MiB, CPU−15.04%, allocation+1.93%, RSS+99.300 MiB.b39e2d09329cc81b09cf55980a2506623236ea59→f676a2af40fce5144bf21df41886fb127329ddad: heap 25.393→8.851 MiB, CPU−16.15%, allocation+2.19%, RSS+91.141 MiB.All leaf comparisons below used 4,000 timing and 4,000 allocation lists per side,2,000lists/arm after 48 warmups,100 archived leaves in 10,000 sessions. Both sides already implement archives; they isolate presentation changes.
fe0eef28994ef419544e3c55d70c2e4d0df9c62a→3748041435e1b8a8219d2a176dbddd37aacf033b5207→17ee4a262dc1857e10430b29981c48987a0db8629675→7a86a101d3f53e940acc63167645a041a98b316dEvery leaf arm preserved golden payloads and 750 resident/1,738 archived runs. The old intermediate publication-identity machinery measured at 7a has since been replaced by immutable resident-source reuse; the historical improvement is not claimed as the final whole-Gateway result.
Gateway stress history — all adverse/stopped comparisons retained
The canonical synthetic workload uses 10,800 sessions,65WebSocket clients, concurrent native mock-provider turns/tools, sidebar/list/search churn and 4,300kept runs. The plugin fixture enables 40bundled catalog entries; before workload 11runtime plugins are active, including additional memory-core, and 30catalog entries are lazy. This is not a claim of 40active modules. Required acpx/codex/diagnostics-prometheus/openai plugins are active. Every full timing arm below lasts 10 minutes; complete windows, failed-arm logs, sample counts and host load are retained. No maintenance/pause window is trimmed after results. These are earlier revisions, not final acceptance.
7d5130f74c226ef71ce4858f9e3f95b166447586→7a86a101d3f53e940acc63167645a041a98b316d4a262dc1857e10430b29981c48987a0db8629675(7695 adds only diagnostics)1bf930c8e40a547f0e2eda87f895b2a7a00e644a→fa8fab07122647857bc6d805240db5b92940f896af8ab7089f6555497abb30b36a460e890ba3e537→89666efc783019a35695ac73575c6349933a26a7b39e2d09329cc81b09cf55980a2506623236ea59→f676a2af40fce5144bf21df41886fb127329ddad52fbfb7d989207a4f82544f58b5bb9ee75782fe9→4df64377f9873ca43b8200ac4ca8d19129d2f83fThe 3748 paired 30-second setup smoke passed:65 clients/10,800 sessions,4 native-subagent turns+4 tools/results,59 sessions.list calls per arm,0RPCerrors. Candidate moved 128 of 4,300 runs; total conserved. All 17owned processes exited. Its full 16-arm campaign never started because the next actual merge conflict required integration. This smoke is not a10-minute performance comparison. No 929c whole-Gateway result is claimed. The completed 94c campaign is reported separately above.
CI and performance disposition
Exact-head required CI is green for
4f5c80371653d74babd77502ac098646e3e21e79: run41207959008,148successful jobs/19skipped, including all three PostgreSQL shards. Preflight proves tested merge884acd18038624edd17b8959d74e63529bed82bbagainst maindbc102dde5301dfccc5ef9d4e997d415912f9c18. The post-campaign PR read confirms the same head, OPEN/ready, but CONFLICTING after main advanced. CI remains green:194successful check runs,59skipped,1neutral(CodeQL),one cancelled older PR-context check superseded by a successful same-head replacement; all three legacy contexts (openclaw/dependency-review,openclaw/security-sensitive-review,openclaw/ci-gate) are SUCCESS. Mergeability is separate from CI. The reviewed/measured candidate is preserved under the adverse performance STOP/REJECT rule; it is not represented as landable or as validated against newer main.The repaired40tests passed locally through their unchanged assertions and canonical database-worker route; exact CI aggregate and routing-plan proof passed. Individual named CI execution of those tests or the restart/terminal/native E2E files was not independently located and is not inferred from shard names. No CI rerun or dispatch was requested. Do not merge: the completed controlled Gateway comparison fails the CPU and allocation gates.
Current 94c passed 88 integration tests across reload/prepared-read/archive-index and scheduled-turn/restart consumers. The combined source exceeded its line cap; merging two adjacent early-return conditions removed three production lines without weakening either check. Review 48 is clean, and the32affected reload/prepared-read cases pass after that simplification. Final six-file lint/format, core/Gateway-root/messaging type graphs, diff check and pinned 40b test/max-line ratchets pass. The 32 cases are a focused replay, not 32 additional unique contracts. The final test-routing repair also reruns
pnpm tsgo:test:rootacross all four partitions. Captured and committed guard patches match exactly. Storage audit 40b passes with unchanged migration/upgrade/rollback inputs.Prior94c CI 41206172772 tested merge
c77555f26e724bbc27baf14bbe6a67b7da4ec412against mainfab8e58a7f818eaa626664780c1f9038b5555850. Two consumers failed: retained-send15 assertions and memory-flush8 assertions. Original full-file replays on frozen40b and94c matched exactly: retained sends15failed/10passed each, memory flush8failed/7passed each. These prove inherited behavior on40b; exactfab8 was not replayed. Logs and paired source/runtime receipts remain in the lane evidence directory.The final repair adds those two files to the existing database-worker test inventory. Their real SQLite paths require the canonical host-admission owner missing from raw-thread dispatch. No production guard, assertion, timeout or skip changed. Review49 is clean; all40 original tests,12 registry tests and one plan case pass, along with lint/format, all four
pnpm tsgo:test:rootpartitions and ratchets. Exact4f CI now passes; the old red run remains recorded below. Main40b/candidate94c builds are complete and final4f changes only two routing entries, so the completed full16-arm controlled Gateway comparison uses those builds with the candidate production-identical to final4f. Its complete results are reported above. Prior8b/5663 CI were blocked by actual conflicts. No rerun or dispatch chased green.71a922b16c68e1b46f5a092c9a95406298de2cca/ main298b86c81fa0efa8eab67fa5eddb94232dd69ef6cc6c858249d6f8bce99b7d632dd11206083a1e01/ main7293e892728aef27996d8a15626e006e2d537dcc0a9e3072c90a43a99afa7f9a60f4adfd80414cff/ main261e0e2466e1d15bb47784d077bb85eff2874f49Earlier896 CI passed 144 jobs/19 skipped, and 7695's exact CI passed required jobs including restart 2/2 (73.01 s), terminal/native and 3PG jobs. These are prior heads, not current green. The prior 4a restart failure passed its first exact-merge local replay 2/2 (87.89 s); added marker/rejection diagnostics passed 2/2 (78.70 s), without a runtime fix or relaxed assertion. Our earlier missed perf-script argument and registration cohort defect were repaired with focused proof. Unrelated duplicate fixture repairs were dropped when upstream supplied them. All once-fetched failure logs remain available.
Executed with Node26.12.1 from the frozen40b tooling checkout;
<base>,<candidate>and<isolated-output>stand for the captured absolute lane paths. Completed performance protocol: canonical tooling at or aftered32fdcd, including later loader fixes, against already-built exact revisions:The complete AB/BA comparison and matching A/A timing/allocation passes ran, retaining every completed window. The current report includes main-thread CPU, allocation rate, GC s/min by kind and both maximum pauses, event-loop p99, client sessions.list p99, server-handler latency, RSS/heap, sample counts and per-arm host load. Client list/loop tails alone do not reject; p99 needs 1,000 samples, p95 needs 200; major-GC tails below 50 collections are context. GC/promotion/max-pause rejection needs at least 4 matched controls in the same instrumentation mode. Honor absolute materiality/noise rules, including+50 ms/min GC or+1 ms/op, sub-ms tail context and predeclared extra pairs for mixed signs. No local checks overlap measured windows; never load Team. The adverse CPU/allocation gates and earlier unfavorable outcomes are not waived by owner improvements.
Size and evidence retention
Pinned source comparison
40b332d1a8a97ab955a08b17e27554f5fa7b94cd...4f5c80371653d74babd77502ac098646e3e21e79reports 93 files,+2,960/−717=net+2,243 under the prescribed filter:This includes generated catalogs, perf tooling and some test-support/Swift files, not a manually classified production-only count. Growth implements the accepted schema/migration, bounded atomic transfer and complete read/mutation cutover; a sweeper-only change would hide results, ancestry, capacity or recovery facts. Source reuse deletes the extra identity and two net production lines. The test-line ratchet passes at 6,343,781 / 6,368,259 (24,478 lines of headroom); this final diff changes neither the shared ceiling nor per-lane allocation files. There are no new config options or benchmark lint suppressions, and benchmark usage lives in script headers/per-script documentation rather than appended shared README sections.
This body consolidates repeated chronology without discarding measurements. Complete raw reports, hashes and per-arm telemetry remain under
.local/buf626/:owner-comparison-{929c693f7250,3748c5f4300b,17ee5c10114f,89a9dd0606ed}, matchingarchive-transient-owner-comparison-*,archive-leaf-owner-comparison-7a86a101d3f5-v2, and eachteam-stress-comparison-*checkpoint. Corrected-premise evidence, upgrade receipts, cleanup/PID manifests, review reports and CI logs remain alongside them. The previous full body is preserved aspr-body-3ef6-pending.md(SHA256 21890bb6d74c485b79f801342f5ed5d4ec59625386f83b343a2bb7daff46a2df). Public CI links above provide execution evidence; local artifacts are not public attachments.