Skip to content

refactor(sessions): reduce SQLite write planning during chat turns - #166674

Merged
steipete merged 4 commits into
mainfrom
dbasync/tb3writes
Oct 7, 2026
Merged

steipete merged 4 commits into
mainfrom
dbasync/tb3writes

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat turns issue separate SQLite preparation requests for fixed internal updates and empty planning work. Exceptional chat cleanup also reacquires source/admission state that the accepted turn already owns.

Builds on #166519.

User Impact

Reduces SQLite work while preserving message durability, acknowledgements, hook visibility, write ordering, and current authority. No schema, retention, permission, public callback, or update migration changes.

The write-group design target of 180 statements / 14 requests is not reached by this PR. The measured partial reduction is intentional; remaining work is described below.

Why This Change Was Made

Fixed fields, embedded writer claims, compaction accounting, and eligible usage accounting reduce against current rows inside the existing writer command. Arbitrary callbacks and row-dependent pricing retain prepare/CAS. Writes keep short synchronous transactions in the existing writer command. Empty turn preparation, lifecycle finalization, and maintenance finalization/deadline work are omitted only where their existing barriers allow it.

Exceptional terminalization retains the original accepted admission and physical source. Transaction-local predicates check the exact session, lifecycle, and recovery claim; acknowledged source publication precedes fallible observers, and accepted writes settle before custody is released. The diagnostic and claim cleanup remain atomic. Failure reporting remains a separate best-effort operation.

The two commands named session.metadata.append persist runtime context before inference and the assistant response after model I/O and hooks. Combining them would cross required durable and observable barriers. Their separate requests remain; this does not claim their SQL kernels are irreducible. Further fixed-operation work includes pending-final bookkeeping, restart-claim cleanup, activity summaries, and lifecycle status. Admission/header cohort integration awaits the selected execution-owner interface.

Evidence

Current landing integration

Current candidate: eaac581083b1384dc62aaa7463e7a1e56a4bd43a, tree 1b883298f24e4c08017e58408643d87fc3e9f9d8. Main 653294c5ed74071e032bf4a18dc4df60ae63eb88 was merged with a merge commit to resolve the real overlap with #166259 and #166690; #166698 is included. Both sides retain their semantics. The shared worker write kernel checks current conversation authority, and both prepared callbacks and fixed reductions carry that guard. Main's session-target agent resolution and this PR's worker-local writer claim coexist.

A new fixed-operation regression first failed because the stale route patch committed, then passed after the missing guard forwarding was added. It proves an authorized write succeeds, a foreign route change before commit refuses the later write, stored session data stays unchanged, and no publication callback fires. The case took 2.207 s in the full file. No timers, sleeps, or assertions were weakened; CI seconds for this new case are pending.

Exact-tree local proof:

  • Focused conversation/session-entry/settlement/incognito/bootstrap/writer-claim integration: 7 files / 121 tests passed, 391.64 s, with --maxWorkers=1.
  • Runtime process build graph and three import-boundary suites: 4 files / 19 tests passed, 58.88 s; filtered PR-wrapper inventory: 1 passed, 10.82 s.
  • pnpm tsgo:core and all 27 pnpm tsgo:core:test shards passed; madge reported 0 cycles. Formatting and git diff --check passed.
  • Fresh P2 Codex autoreview: scoped-clean, no actionable findings, bound to the exact tree above. An independent composition audit found no lost changes in the eight overlapping files; all main-only paths match the integrated main parent.

The current SDK declaration report passed in 476.02 s: no entrypoints added/removed, no public declaration-text changes, and no public export-kind changes. Its 130 reachable-only changes across eight internal declaration blocks preserve the reviewed internal reducer/source-publication/type-closure assessment. Digest: 77b0eec8a904aaa73af2f8d1fd86796e71891a973f03c58104e854e85d188061. Released signatures were checked against v2026.9.8 and v2026.10.1-beta.1; this integration introduces no new SDK signature change. The diff adds 0 new OPENCLAW_ names*.

ClawSweeper completed Revision 5 for this exact head at 2026-10-07T20:11:14Z, with no actionable correctness or security findings. Its pending SQL/SDK qualification is supplied here. Its generic data-model checklist names serialized-state helper paths, while the substantive review identifies no changed stored-data contract. Stored fields, schemas, retention, and update behavior remain unchanged. The published-driver update cell below remains accurately scoped to its named earlier head; no new current-head update test is claimed.

Current integrated statement gate

PASS. Three alternating main/candidate pairs compare 653294c5ed74071e032bf4a18dc4df60ae63eb88 with eaac581083b1384dc62aaa7463e7a1e56a4bd43a, using the unchanged shared harness, source-mapped builds, and Node 26.10.0 / SQLite 3.53.4 on the same host. All six fixtures, calibration, chronological alternation, source seals, SQL-count conservation, and joined cleanup passed. Every all-thread phase median decreases. Maximum phase median wall-time ratio is 1.063, below 1.5; no extra pair, excluded sample, tolerance exception, or combined-window exception was used. This instrumented comparison is not a latency benchmark.

Phase ALL main median [range] ALL candidate median [range] Delta Wall ratio
01.boot 3366 [3360–3388] 3359 [3357–3397] -7 0.755
01.connect 343 [322–356] 311 [308–320] -32 0.987
02.first-turn 4481 [4473–4488] 4474 [4429–4480] -7 0.719
03.warmed 15605 [15600–15616] 15329 [15313–15349] -276 0.990
04.second-session 5370 [5339–5505] 5259 [5248–5412] -111 0.737
05.control-plane 49 [45–61] 45 [45–101] -4 0.938
06.cron 1488 [1431–1620] 1427 [1423–1489] -61 1.063
07.compaction 859 [687–922] 852 [827–861] -7 0.999
08.shutdown 890 [888–1048] 884 [880–926] -6 0.939

Warmed savings are 27.6 all-thread statements per turn; warmed MAIN remains 28 per turn. MAIN first turn is 129→131: baseline [129,129,129], candidate [129,133,131]. The unchanged cron registry sweep contributes [0,+8,+8], and unchanged linked-account cache/selection contributes [0,−4,−6]. The entry-write kernel remains [8,8,8] on both sides, and other MAIN work remains [112,112,112]. These totals conserve each run’s [0,+4,+2] delta; per-owner medians are not added. The cron statements are existing version/schema probes and two config_machine_state reads through readRunningCronJobIds → runSessionRegistryMaintenance; the implicated owners’ source blobs are identical.

The direct changed-source SQL trace footprint decreases in every pair: first turn −12, ten warmed turns −120, second session −29, cron −4, with other phases unchanged. Entry-patch/turn/projection worker paths contribute −6/−3/−3 in first turn and −60/−30/−30 across ten warmed turns. Whole-run maintenance SQL decreases −189/−138/−178. All six samples contain zero failed SQL executions.

No request census or request IDs were captured. Operation-frame counts describe SQL executions, not requests; direct changed-source stacks are not complete transitive attribution. The classifier’s foreground/background bounds remain INDETERMINATE because of unassigned executions; conservation passes, and the required gate uses complete all-thread medians. No complete stack-witness claim is made. Decision evidence digest: 9b6ca07c0c12d9243a2d02aac7c352eb7a82ef9318ef1fdf67c1b71aed9ea602 (comparison report).

Current CI follow-through

Run 37679430073, attempt 1, completed with one root infrastructure failure: checks-node-compact-small-1 was never acquired by a self-hosted runner. GitHub’s annotation explicitly reports failed runner acquisition; runner identity and steps are empty, and no test executed. The aggregate CI gate propagated this incomplete shard. After the workflow completed, one single-job REST rerun was accepted; attempt 2 completed successfully on the unchanged exact head, including the aggregate CI gate. No source change, blanket rerun, or inherited-failure bypass was used.

Earlier measurement and SDK results below remain historical evidence for their named heads.

Host grant audit: The changed terminal-settlement and accounting paths retain live admission/source checks. The new terminal guard uses retained in-memory identities; physical-source guards use filesystem and admitted identity facts; automatic maintenance consumes prepared non-native preservation facts. Same-store predicates execute in the worker transaction. No concrete retained indexed host-SQL read was identified in these changed paths. Existing caller/source assertions remain live in session-entry-patch.ts, session-turn.ts, session-updates.ts, and session-usage.ts; this is not a claim that arbitrary supplied callbacks execute zero host SQL. No zero-host-SQL assertion was added for those callback surfaces.

Previous landing integration

Previous candidate: b277579ae3efce17c3a0e089af84151605bd523a, tree d85802ad576b6e9704f4e68a5b7576a196f91c05. Merged main 24d311dcf66d7002b9adbb8f51b6a949b603b6d5 with a merge commit and no conflicts, preserving the chat-method preparation changes from #166621.

Initial-head CI run 37658524054 exposed three fixture assumptions caused by this cutover. The SDK replay fixture injected a foreign append only after the second preparation request, which this PR removes. Health-summary and hidden-child retention fixtures used host-only clock spies to seed historical activity through an upsert whose reducer now runs in a worker. The fixtures now inject the foreign append immediately before commit and seed exact timestamps through the existing replacement API. All replay, ordering, and retention assertions remain intact; these repairs add no production behavior.

Attribution used Node 26.10.0 and exact merge base ebc4e6de603c5c1ce55086f13565e21feb1c297d. SDK and health whole files failed five times each on the approved head and passed five times each on the base. Hidden-child retention failed in five targeted repetitions; the base passed one full-file run and four targeted repetitions. The original full candidate file also showed only that failure, with 25 sibling passes. Two additional local runs lost their outer controller exit receipts during a monitoring change; their observed results are retained as historical evidence and excluded from the five-receipt counts. Replacement runs captured normal exit and cleanup receipts. No inherited-CI exception is claimed.

Post-integration proof for tree d85802ad576b6e9704f4e68a5b7576a196f91c05:

  • Gateway health, resident session reads, dispatch-error settlement, and work admission: 4 files / 64 tests passed, 470.95 s local wall with --maxWorkers=1.
  • SDK worker preparation, writer claims, recovery, channel mirroring, and reply state: 5 files / 54 tests passed, 421.63 s local wall with --maxWorkers=1; no missing-host-owner refusals.
  • Standalone runtime process graph and three import-boundary suites: 4 files / 19 tests passed, 65.46 s. Filtered PR wrapper inventory: 1 passed, 10.12 s. No inventory additions or routing changes were needed.
  • pnpm tsgo:core and all 27 pnpm tsgo:core:test shards passed. pnpm check:madge-import-cycles passed with 0 cycles. Focused formatting and git diff --check passed.
  • Fresh P2 Codex autoreview: scoped-clean, zero actionable findings, bound to the same final tree.

The changed public-facing session-store callback shapes were compared with stable v2026.9.8 and latest tag v2026.10.1-beta.1; they remain compatible. New reducers and source-publication helpers are internal. The integrated SDK declaration report completed successfully in 304.28 s: no entrypoints added or removed, no public declaration-text changes, and no public export-kind changes. Its 130 reachable-only changes across eight internal declaration blocks retain the previously reviewed reducer/source-publication/type-closure shape; this is not a zero-diff claim. Report digest: 334cb4028c5b8af17cba1511f22959aeca145565d66443a27b029233d120a080. The published-driver compatibility cell below remains bound to the approved pre-integration head. The additional maintainer delta changes three fixtures plus integration with main; it introduces no new PR-owned storage format, schema, retention, or permission contract.

Previous integrated statement gate (b277579)

PASS under the authorized median and non-turn tolerance rules. Five alternating main/candidate pairs compare 24d311dcf66d7002b9adbb8f51b6a949b603b6d5 with b277579ae3efce17c3a0e089af84151605bd523a, using the unchanged shared harness on the same host with Node 26.10.0 / SQLite 3.53.4. Source seals, all ten fixtures, thread calibration, chronological alternation, raw-count conservation, and joined child cleanup passed. The three-pair and four-pair comparisons were invalid for timing skew; two further pairs were added for that reason, retaining every sample. Final maximum phase median wall-time ratio is 1.299, below 1.5. This instrumented comparison is not a latency benchmark.

Phase ALL main median [range] ALL candidate median [range] Median delta Wall ratio
01.boot 3389 [3381–3424] 3397 [3389–3430] +8 0.863
01.connect 345 [334–355] 346 [324–383] +1 1.041
02.first-turn 4719 [4689–4746] 4680 [4620–4706] -39 1.133
03.warmed 15976 [15940–16066] 15752 [15707–16003] -224 1.051
04.second-session 5372 [5332–5508] 5392 [5370–5422] +20 0.992
05.control-plane 51 [47–55] 51 [47–53] +0 1.030
06.cron 1544 [1520–1600] 1485 [1433–1575] -59 0.992
07.compaction 834 [665–862] 813 [632–889] -21 1.082
08.shutdown 882 [871–1049] 883 [881–1925] +1 1.299

First-turn ALL decreases 4719→4680. Warmed ALL decreases 1597.6→1575.2 statements/turn, 22.4 fewer; the ten-turn median decreases by 224. MAIN first-turn median is 297→295, and MAIN warmed median stays 28.0/turn. Measured-phase totals have medians 33175→32861 and five-run aggregate totals 165827→165424; totals provide context and do not decide individual phase gates.

Positive phase median Source/trace attribution and gate
Boot +8; connection +1 Unchanged WAL/checkpoint, cron, notifier/delivery and state-freshness owners; every varying SQL text has an executed baseline witness. Both pass the ≤10 absolute allowance.
Second session +20 (+0.37%) Touched session paths decrease by 29/29/29/27/29 statements across the five pairs. Existing maintenance shifts into this window; maintenance SQL over complete runs decreases by 197/67/82/80/77. The phase passes the ≤2% allowance.
Shutdown +1 Unchanged Memory publication/indexing, admission and close-receipt owners. Candidate run 5 retains its 1925 shutdown statements: its Memory publication worker accounts for 782 cold-admission statements, followed by Memory/cache work. The Gateway records Memory preparation settling after 3123 ms and clean shutdown. The median passes the ≤10 absolute allowance.

The attribution partitions conserve each paired phase delta, and 16 relevant owner source blobs are identical between main and candidate. For shutdown, 529 of 536 varying SQL texts have executed baseline witnesses; the remaining seven are five elapsed-budget busy-timeout literals and two source-identical conditional clean-close invalidation queries. Complete stack-witness coverage is not claimed. The traces lack request IDs, so exact dispatch correspondence remains unproven; source equality, worker identity, stacks, and settlement logs support the unchanged-owner/background attribution. The source dispatch changes remove preparation/finalization work and add no new request producer.

No outlier was excluded. The decision uses individual-phase tolerance; combined compaction+shutdown rises by 56 at the median and fails its separate 2% bound. The earlier head’s combined-window result below is historical.

Failed BEGIN IMMEDIATE attempts remain recorded separately from successful statements: main 2/0/1/0/0, candidate 0/0/0/0/2, from the known restart-intent/audit shutdown owners. All fixtures completed and joined their children. That diagnostic remains follow-up work at its existing owner.

Prior-head CI investigation

Run 37666850499 on b277579ae3efc has one root failure after the earlier three fixture repairs: gateway-agent-skill-refresh.e2e.test.ts, which exceeded its 90-second budget (reported 101.464 s). The test uses agent RPC and reaches shared writer/transcript owners, so it is not classified as inherited merely because its file is unchanged. The silent CI log does not locate the stalled awaited stage; six later files in the same job passed. No relevant fix or same failure was found in the inspected scheduled-main runs.

Local diagnostic invocations were refused before test entry by the managed-Gateway artifact-separation guard. They are tooling failures, not timeout reproduction evidence. An isolated Linux comparison completed five alternating baseline/candidate pairs, with exact base 24d311dcf66d7002b9adbb8f51b6a949b603b6d5, candidate b277579ae3efce17c3a0e089af84151605bd523a, CI’s Node 24.19.0 / SQLite 3.53.3, two-CPU affinity, verbose diagnostics, and the unchanged 90-second timeout. All ten full-file runs passed. Actual test seconds were baseline 71.931 / 28.585 / 34.511 / 29.668 / 31.327, candidate 36.555 / 43.240 / 37.905 / 34.957 / 33.188. Source checks and remote baseline cleanup passed; the Testbox command completed successfully and its lease was stopped. The timeout remains unattributed after investigation: passing repetitions do not prove a fix or inherited failure. No CI rerun or inherited-failure bypass was used. The new head is published to repair real main conflicts, not to retry this check unchanged.

Approved-head verification before landing integration

Statement gate: PASS under the coordinator’s updated NON-TURN TOLERANCE rule. The integrated comparison uses main ebc4e6de603c5c1ce55086f13565e21feb1c297d and candidate befb81a2986f4df58278611121769b3c03692428. Three alternating pairs used the unchanged shared harness with Node 26.10.0 / SQLite 3.53.4 on the same Mac. Both source seals, all fixtures, thread calibration, and SQL-count conservation passed. Maximum phase median wall-time ratio is 1.0386, below 1.5; no additional successful runs were repeated to seek a pass. Values are medians [minimum–maximum]. First-turn and warmed medians remain strict. Other phases pass at ≤ +2%, ≤ +10 statements absolute, or an adjacent combined median rise ≤ +2%, with unchanged-owner/background attribution.

Phase ALL main → candidate MAIN main → candidate Wall ratio Gate under current rule
01.boot 3919 [3913–3935] → 3915 [3882–3929] 2834 [2832–2838] → 2832 [2830–2832] 0.7957 PASS (-4)
01.connect 323 [316–330] → 331 [324–339] 14 [14–14] → 14 [14–14] 0.7083 PASS (+8 ≤ 10)
02.first-turn 5896 [5880–5981] → 5850 [5835–5861] 508 [508–517] → 508 [508–512] 1.0386 PASS (-46)
03.warmed 22718 [22706–22760] → 22403 [22121–22519] 321 [316–323] → 323 [280–326] 0.8399 PASS (-315)
04.second-session 7110 [7003–7213] → 7074 [7023–7133] 148 [143–156] → 148 [143–180] 0.7955 PASS (-36)
05.control-plane 52 [48–166] → 54 [52–102] 0 [0–42] → 0 [0–0] 0.9155 PASS (+2 ≤ 10)
06.cron 1733 [1650–1790] → 1718 [1652–1807] 37 [37–39] → 45 [39–46] 0.9685 PASS (-15)
07.compaction 778 [775–793] → 802 [779–824] 27 [27–27] → 27 [27–45] 1.0268 PASS (combined −0.47%)
08.shutdown 2210 [2204–2243] → 2210 [1103–2218] 220 [220–224] → 220 [202–224] 0.8315 PASS (+0)

Warmed ALL per turn is 2271.8 [2270.6–2276.0]→2240.3 [2212.1–2251.9], 31.5 fewer statements. MAIN warmed is 32.1 [31.6–32.3]→32.3 [28.0–32.6]. First-turn ALL falls 5896→5850. Whole-workload ALL median is 44739 [44581–45125]→44257 [43131–44472]; aggregate totals 134445→131860 are context only.

Connection passes the absolute tolerance: 323→331 (+8, +2.477%). Boot+connection sums are 4251/4243/4242→4246/4268/4206, with medians 4243→4246 (+0.07%). First-turn and warmed windows are assessed separately and both decrease.

The conserved connection audit finds no touched production file or fixed session-write operation in any of the six connection SQL traces. Varying producers are unchanged shared-state admission/cache reads, post-connect health, delivery recovery, cron startup, and catalog completion. The connection handler starts health refresh without awaiting it (src/gateway/server/ws-connection/connect-hello.ts:475); the health collector awaits plugin-state health and then queue health (src/gateway/health/collector.ts:643), whose failed-delivery, ingress, and pressure reads are sequential (src/gateway/health/delivery-queue.ts:44). These establish phase-edge scheduling mechanisms, not proof that indirect effects are impossible. The coordinator accepted this unchanged-owner/background attribution under the updated tolerance. Further reduction belongs to health batching/invalidation or shared-state read admission; lifecycle scheduling is preserved.

Non-turn increase Adjacent-window evidence Attribution and current gate
Connection 323→331, +8 (+2.48%) Boot+connection 4251/4243/4242→4246/4268/4206; median 4243→4246 (+0.07%) Unchanged shared-state admission/cache, health, cron, catalog completion, and delivery/recovery owners. PASS: +8 ≤ 10; the combined median also rises less than 2%.
Control 52→54, +2 (+3.85%) Control+cron 1956/1785/1698→1704/1772/1909; median 1785→1772 (−0.73%) Existing freshness/admission, delivery reads, WAL maintenance and background catalog work. PASS: +2 ≤ 10.
Compaction 778→802, +24 (+3.08%) Compaction+shutdown 3018/3003/2982→3020/2989/1927; median 3003→2989 (−0.47%) Existing read/admission, memory publication, WAL and cleanup work crosses these phase boundaries. PASS: the combined median decreases.

All increased single-phase SQL/stack groups have baseline witnesses. The earlier conservative full combined scans retained 25 and 2 component groups respectively without exact baseline-stack witnesses; these include changed mutation call stacks and schema_version/user_version at releaseOpenClawAgentDatabaseLease → closeAgentDatabaseExecution → receive. Those flags remain recorded rather than being silently normalized away. The coordinator’s updated rule and explicit PASS decision accept the unchanged-owner/background attribution; a changed stack alone is not represented as proof of a new request. No new measurement run, statement subtraction, timing change, or source change was used to obtain this gate result.

A supplemental ten-turn census per source measures 53.2→47.0 write-group requests/turn and 525.2→500.6 write-group statements/turn: 6.2 fewer observed requests and 24.6 fewer SQL. These are one-run means, not three-run request medians. The accepted partial-scope target remains unmet by 33 requests / 320.6 statements relative to 14/180.

Write-group request Requests/turn main → candidate SQL/turn main → candidate
database.domain.bind 2 → 2 5 → 5
database.domain.close 2 → 2 0 → 0
database.domain.execute 2 → 2 17 → 17
database.domain.publish 5 → 4 96 → 92
session.entry.patch.commit 11 → 11 172 → 170
session.entry.patch.prepare 11 → 9 31 → 27
session.lifecycle.project 1 → 1 41 → 41.2
session.maintenance.metadata 8.2 → 6 53.2 → 41.3
session.maintenance.prepare 3 → 3 20 → 20.2
session.maintenance.release 3 → 3 0 → 0
session.pendingInputs.mutate 1 → 1 11 → 11
session.pendingInputs.read 1 → 1 5 → 4.9
session.turn.commit 1 → 1 58 → 58
session.turn.prepare 2 → 1 16 → 13

The removals are fixed patch preparation, empty domain finish publication, empty turn preparation, and maintenance finalization/deadline work. All eleven patch commits remain; their kernels execute two fewer SQL. Fractional cadence and retained-group differences are measured timing, not constant savings. Nine patch-prepare requests remain per warmed turn, along with the separate durable metadata appends described above. The 31.5-statement macro median reduction is not attributed wholesale to the separately sampled 24.6-statement write-group reduction.

The supplemental total census is 310.4→311.1 requests/turn and 2274.7→2297.5 SQL/turn, because other background work is higher in its candidate run. Those counts remain included; no total-request reduction is claimed. All warmed requests completed with zero missing context or duplicate sends. Four unmatched boot transport sends/receives per side remain recorded outside the warmed budget. The plain native classifier leaves some async attribution bounds indeterminate; raw phase counts remain exact.

Across all eight fixtures, eight failed BEGIN IMMEDIATE attempts remain recorded in shutdown audit.writer.prune (main pairs 2/1/0, candidate pairs 2/0/0, main/candidate census 2/1). They are separate from successful execution counts; every fixture passed and reported no remaining children. Those outcomes do not erase the failed attempts. There are no prepare errors.

The catalog benchmark's setup treated persistence of a complete marker as request completion, although the catalog provider and late host publication have a separate lifetime. Setup now joins that work through the existing AsyncWorkScope; only a catalog_pending response consumes the exact request's terminal host publication. Other errors still fail. The 100 measured and 100 profiled RPCs, exact I/O assertions, and timeouts are unchanged.

With the actual Vitest forks pinned to Node 26.10.0, pristine main ebc4e6de603c passed (180.62 s wall), and the integrated candidate passed (87.556 s test; 246.08 s wall including 60.36 s worker build). Warm lists performed zero calling-thread SQL and one worker read request/list; p50 was 6.09 ms against the independent 56.40 ms CPU-relative bound. The existing catalog budget/lifetime suites also passed (27 tests, 212.95 s wall).

An earlier candidate run hit the 120 s test deadline; its stage was not captured. A checkpoint-only replay passed, which does not prove a fix. Earlier main/candidate runs used unmatched Node versions, so they do not establish causality. No inherited-failure claim is made; the fixture completion contract is corrected, and the original timeout's exact cause remains unknown.

SDK diff, integrated main ebc4e6de603c → candidate befb81a2986f: no entrypoints added/removed, no public declaration-text changes, and no public export-kind changes. The report has 130 reachable-only changes across eight internal declaration blocks, reviewed as internal reducer/source-publication/type-closure changes. Public callback signatures and transcript options remain compatible. The renderer conservatively follows whole-module wildcard closures; this is not a zero-diff claim. Report digest: ea930b73601a395f56244638e3d6def8d94b382a69a1c753be4fba99bc467db8.

Published-driver × candidate update cell: PASS on Blacksmith Testbox, run 37651725531, lease tbx_01m4bjvr1prpf98keahyqyf7gq. Ran bash scripts/e2e/published-driver-update-docker.sh '' .artifacts/tb3writes-published-driver-final-testbox 2026.9.8 through scripts/crabbox-wrapper.mjs.

The published driver was 2026.9.8. The wrapper verified source befb81a2986f4df58278611121769b3c03692428, tree 48101f4cdc1418baedda27af9bc5eb518e66c02a, and transport commit 7de6d4b8dc3382e370e72247e65a0b60c4e6d6cd before execution. The candidate retains package version 2026.9.8; an independent artifact assertion confirmed that the running Gateway's exact build ID matches the newly built candidate, distinguishing it from the published driver.

All 19 step exit receipts passed. The update reached finished, readiness returned HTTP 200, durable session identity/content survived, and incognito history was empty after restart with the artifact leak scan passing. The update took 235.935 s; the complete Testbox command took 744.809 s, exit 0. The tarball passed the canonical package integrity check. Collected proof archive SHA-256: c136d2aebd4061477628feec7da88fcf790a903caea75cd0b037762db8c2f13b. The lease was stopped after verifying the local artifacts; linked Actions cancellation during lease cleanup is not the command result.

Infrastructure attempts before this successful cell: the first Testbox lease received no runner within 15 minutes; AWS then hit its 15-minute source-sync timeout with zero command runtime. Both were released. A fresh Testbox lease was used after observing new admissions. Neither failed attempt exercised candidate update behavior.

Focused session-entry, transcript, maintenance, accounting, writer-claim, and terminal-settlement proofs were run. The final review and check results, test wall times, and inventory are recorded here before publication.

Final integrated focused command: pnpm test src/config/sessions/session-entry-patch.test.ts src/config/sessions/session-compound-worker.test.ts src/config/sessions/session-turn-planning.test.ts src/config/sessions/transcript-write-context.test.ts src/config/sessions/session-accessor.sqlite-maintenance-worker.test.ts src/config/sessions/session-accessor.sqlite-maintenance-close.test.ts src/gateway/server-methods/chat-send-dispatch-errors.test.ts src/gateway/server-methods/chat-send-work-admission.test.ts --maxWorkers=1. All 8 files / 137 tests passed, with worker verification and cleanup joined; 2039.22 s local wall on the loaded host. CI seconds are not yet measured.

An earlier maintenance run had 169 passing tests and one fixture failure: its observer watched durable storage while the test used incognito storage. The test now explicitly observes the canonical incognito path, retaining its archive assertion. The targeted regression passed, then all 42 maintenance-worker tests passed in the integrated command. This is a fixture-scope repair, not a product-failure claim based on a replay.

Inventory against integrated main: T1 823→823 calls, 264→264 files; total inventory 2551→2551 calls, 634→634 files. Fresh P2 Codex autoreview of committed tree 48101f4cdc1418baedda27af9bc5eb518e66c02a completed scoped-clean with zero findings.

Selected check:changed --base ebc4e6de603c5c1ce55086f13565e21feb1c297d gates completed: formatting, core and all core-test type shards, lint, shrink-only ratchets, database/schema/ownership guards, and runtime import cycles. All three Knip unused-export scans passed with zero entries. The outer check process lost its exit status (137); its continued child reached the last guard without failure diagnostics. All preceding gates were proven by advancement. Only the final pairing-account guard lacked a recoverable terminal status, so it was rerun separately and passed with explicit exit 0 (318.305 s). This does not fabricate a clean exit for the original outer process.

Explicit pnpm check:madge-import-cycles passed with 0 cycles, exit 0 (98.039 s).

Supplemental owner proof: usage accounting 12 passed (32.14 s local wall); SDK session-store owners 19 passed. An earlier five-file shard had 47 passed and one writer-claim failure because the fixture still injected its error into the retired patchSessionEntryCore call. The spy now targets applySessionEntryOperation, retaining assertions that the incumbent is not canceled, no lifecycle event is emitted, and its stored run remains unchanged. The corrected case passed (47.76 s local wall); the earlier whole shard is not represented as a green rerun.

Earlier measurements: runtime-confounded counts retained for comparison

Earlier observed comparison and its limitation

The following observed comparison uses main 892911ba4f35 and the byte-identical candidate committed as 9d054f84a668. A later manifest audit found Node 24.21.0 on its main runs and Node 26.10.0 on candidate runs, with SQLite 3.53.4 on both. Its numeric median rule passes, but these counts are not a controlled source-only attribution. They are retained transparently; the same-runtime final-head comparison above decides the final gate.

Historical statement and request evidence

Historical numeric gate passes under the clarified median rule; runtime parity does not. Three alternating main/candidate pairs use the unchanged shared workload. The runtime limitation above prevents a source-only claim. Successful native SQLite executions are counted on every thread, including transactions, PRAGMAs, DDL, and repeated cached executions; prepares and failures are reported separately. Values below are medians [minimum–maximum].

Phase ALL baseline → candidate MAIN baseline → candidate
Startup 3879 [3878–3884] → 3882 [3880–3916] 2828 [2828–2830] → 2830 [2830–2834]
Connection / settling 380 [255–381] → 355 [271–355] 18 [0–18] → 14 [0–18]
First session + first chat 5876 [5835–5962] → 5838 [5811–5975] 508 [508–524] → 512 [508–522]
Ten warmed turns 22679 [22567–22911] → 22342 [22310–22642] 280 [280–327] → 280 [280–331]
Second session + parent tool + child 7139 [7093–7405] → 7069 [7026–7239] 149 [149–191] → 149 [148–203]
List/history/Inbox/dismiss 60 [55–68] → 50 [48–150] 0 [0–0] → 0 [0–4]
Scheduled cron 1742 [1722–1794] → 1714 [1695–1784] 62 [39–73] → 39 [37–66]
Manual compaction 976 [765–1004] → 1006 [1004–1007] 45 [27–73] → 45 [45–45]
Graceful shutdown 1091 [932–2206] → 922 [914–926] 202 [202–220] → 202 [202–202]
Whole workload 43912 [43729–44898] → 43420 [43216–43495] 4132 [4116–4133] → 4121 [4098–4127]

Warmed ALL per turn is 2267.9 [2256.7–2291.1]→2234.2 [2231.0–2264.2]; MAIN is 28.0 [28.0–32.7]→28.0 [28.0–33.1]. First-turn ALL falls 5876→5838. Whole-workload three-run totals are 132539→130131, reported as context. Maximum phase median wall-time ratio is 1.0629, below 1.5; the instrumented loaded-host run is not a latency benchmark.

Attribution / gate treatment Evidence
Startup, +3 median SQL (+0.08%) Retained groups show startup shared-state freshness/admission and update-run-watcher schema/user-version probes. Per-group medians are not additive; exact per-run SQL/stack deltas remain in the evidence. The increase is within the 2% allowance.
Compaction, +30 median SQL (+3.07%) Existing Memory schema admission/sync moves across compaction and shutdown. Accepted paired combined sums: 2971 / 1936 / 2067→1929 / 1920 / 1930; median 2067→1929. Seven literal variants are dynamic PRAGMA busy_timeout remaining budgets with identical assignment-shape/full-stack baseline witnesses; raw literals/counts are preserved.
Control, median60→50 Per-run 60 / 55 / 68→150 / 50 / 48, aggregate 183→248. The outlier includes shared-state freshness/admission probes, outbound-delivery reads, shared-state commands and session catalog reads. The median decides; totals are context. Generic asynchronous origins remain unresolved rather than being labeled a proven timer. Control+cron three-run totals are exactly equal, 5441→5441, as context; no control+cron exception is needed or claimed.

The one-run supplemental request census used the candidate before final type/style-only corrections; these are ten-turn means, not three-run request medians. Total requests fall 310.8→304.7/turn. The write/planning/maintenance group falls 53.1→47.0 requests and 525.1→499.8 statements/turn: 6.1 fewer requests and 25.3 fewer statements.

Removed or reduced work Requests/turn SQL/turn
Fixed patch preparation 11→9 31→27
Maintenance metadata 8.1→6 53.1→41
Empty lifecycle finish (domain publication group) 5→4 96→92
Empty turn preparation 2→1 16→13
Current-row patch commit kernels 11→11 172→170
Maintenance preparation timing 3→3 20→19.8

Fractional maintenance differences are observed timing, not a deterministic saving guarantee. Zero-SQL releases remain counted. The write-group target 14 requests /180 statements is not achieved: that earlier census left 33 requests / 319.8 statements above the target. The final-head census above supersedes this scope-gap measurement. Nine preparation callbacks remain. The two metadata appends persist runtime context before model inference and the assistant response afterward; they retain their separate durable/model/hook barriers.

A separate real killed/nonretryable terminal-owner probe, after warming its writer, measures 81 [81–81]→16 [16–16] all-thread statements per call in three fixtures per source. This is exceptional-path evidence, not an ordinary-turn saving or Gateway MAIN measurement.

All six shared-harness fixtures passed. Raw/CSV counts conserve by phase, thread, and SQL; calibration passes on main and worker threads. Two baseline shutdown BEGIN IMMEDIATE lock failures remain recorded outside successful counts; candidate runs have none. Paired source bytes were verified unchanged, all owned processes were joined, and the disposable proof checkout was removed.

Run fixed internal updates against current rows in the existing writer command,
retain callback prepare/CAS, and omit empty turn and maintenance planning.
Keep exceptional terminal cleanup bound to the accepted live admission and
original physical source through acknowledged publication and settlement.

Paired all-thread warmed SQL falls from 2267.9 to 2234.2 statements per turn;
first-turn SQL falls from 5876 to 5838. Schema, durability, retention, and
permission contracts are unchanged. The full write-group design target remains
future work. Includes the existing main terminal font-test call-shape correction.
Keep the extracted source-predicate owner and the fixed reducer's canonical-key
check when resolving the session worker import conflict.

Make catalog benchmark setup join the existing request lifetime and consume its
own terminal progress publication. A persisted complete marker is not proof that
provider work and publication have settled. Measured RPCs, exact I/O assertions,
and test timeouts remain unchanged.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 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.

@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 4:43 PM ET / 20:43 UTC (Revision 6).

ClawSweeper review

What this changes

The branch reduces SQLite preparation work during chat turns and keeps exceptional cleanup bound to the accepted session admission and physical database.

Merge readiness

✅ Ready for maintainer review

The PR remains useful and has no supported blocking finding. The exact-head SQL and SDK results resolve the previous review’s outstanding qualification; current main still uses the separate preparation path.

Priority: P2
Reviewed head: eaac581083b1384dc62aaa7463e7a1e56a4bd43a

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Measured production-path evidence, explicit limitations, preserved ownership boundaries, and focused negative cases support above-average review confidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The matching captured body records six exact-head production chat workloads on the same Node/SQLite environment, covering turns, child/session flows, control RPCs, cron, compaction, and shutdown with observed SQL reductions and successful cleanup. Actual worker-boundary regressions supplement authority and publication coverage. Source inspection verifies that no stored-data contract changes; the earlier published-driver update remains correctly scoped to its earlier head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The matching captured body records six exact-head production chat workloads on the same Node/SQLite environment, covering turns, child/session flows, control RPCs, cron, compaction, and shutdown with observed SQL reductions and successful cleanup. Actual worker-boundary regressions supplement authority and publication coverage. Source inspection verifies that no stored-data contract changes; the earlier published-driver update remains correctly scoped to its earlier head.
Evidence reviewed 9 items Pinned implementation: The introduced delta adds fixed reductions to the existing worker patch command while retaining callback preparation. Both paths use the shared mutation kernel and forward conversation, source, and commit guards.
Current-main necessity: Fetched main still unconditionally prepares a session-entry snapshot before committing a patch. The merged receipt-publication work at #166519 addresses projection reuse rather than these fixed reductions. No merged replacement establishes that this PR is obsolete; the supplied latest stable release predates this work.
Complete captured body inspected: The full GitHub body was read, including omitted proof sections. Its 38,426 UTF-16 units and SHA-256 b20f6cb5534bff47bcf98096aeb460d6c0e6a04d04bd040b56bb98907e910752 match the captured snapshot. The current qualification compares three alternating pairs on identical Node/SQLite versions: all phase medians decrease, warmed SQL falls by 27.6 statements per turn, maximum phase wall ratio is 1.063, and all six workloads finish with zero failed SQL executions. No current-head request-count reduction is claimed.
Findings None None.
Security None None.

How this fits together

OpenClaw’s session store persists chat transcripts, accounting, and recovery state through database workers. Gateway chat admission supplies the target and live authority; committed results update session projections and notify observers.

flowchart TD
  A[Accepted chat turn] --> B[Session target and live authority]
  B --> C{Fixed update or callback}
  C -->|Fixed update| D[Worker reads current rows]
  C -->|Callback| E[Prepare and validate snapshot]
  D --> F[Guarded SQLite commit]
  E --> F
  F --> G[Publish committed session facts]
  G --> H[Notify observers and release custody]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +540, Tests +605, Docs +27, Other -1. Total +1171 across 50 files.

View PR surface stats
Area Files Added Removed Net
Source 23 900 360 +540
Tests 25 810 205 +605
Docs 1 29 2 +27
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 50 1739 568 +1171

Review metrics

Metric Value Why it matters
Qualified warmed SQL reduction 27.6 fewer all-thread statements per turn The exact-head alternating comparison shows a bounded reduction without claiming a latency or request-count improvement.
Production versus test growth production +900/−360, net +540; tests/support +810/−205, net +605 Production growth is explained by closed reducers and retained settlement custody, with regression coverage for the affected boundaries.

Stored data model

Persistent data-model change detected: serialized state: src/auto-reply/reply/session-updates.ts, serialized state: src/gateway/server-methods/chat-restart-recovery.ts, unknown-data-model-change: src/auto-reply/reply/session-updates.ts, unknown-data-model-change: src/gateway/server-methods/chat-restart-recovery.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep fixed reductions inside the existing guarded writer, preserve callback and durability barriers, and pursue remaining SQL reductions through those same owners.

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

Not applicable as a discrete bug report; the captured real chat workload measures the redundant planning cost on the pinned base and candidate.

Is this the best way to solve the issue?

Yes. The branch reuses the existing writer and commit kernel while retaining preparation where callbacks, pricing, or observable barriers require it.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

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

Label justifications:

  • P2: This is a measured internal session-store performance improvement with preserved user-facing contracts.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The matching captured body records six exact-head production chat workloads on the same Node/SQLite environment, covering turns, child/session flows, control RPCs, cron, compaction, and shutdown with observed SQL reductions and successful cleanup. Actual worker-boundary regressions supplement authority and publication coverage. Source inspection verifies that no stored-data contract changes; the earlier published-driver update remains correctly scoped to its earlier head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching captured body records six exact-head production chat workloads on the same Node/SQLite environment, covering turns, child/session flows, control RPCs, cron, compaction, and shutdown with observed SQL reductions and successful cleanup. Actual worker-boundary regressions supplement authority and publication coverage. Source inspection verifies that no stored-data contract changes; the earlier published-driver update remains correctly scoped to its earlier head.

Evidence

What I checked:

  • Pinned implementation: The introduced delta adds fixed reductions to the existing worker patch command while retaining callback preparation. Both paths use the shared mutation kernel and forward conversation, source, and commit guards. (src/config/sessions/session-entry-patch.worker.ts:38, eaac581083b1)
  • Current-main necessity: Fetched main still unconditionally prepares a session-entry snapshot before committing a patch. The merged receipt-publication work at perf(sessions): publish complete commit receipts instead of invalidating known facts #166519 addresses projection reuse rather than these fixed reductions. No merged replacement establishes that this PR is obsolete; the supplied latest stable release predates this work. (src/config/sessions/session-entry-patch.ts, a6c143f73176)
  • Complete captured body inspected: The full GitHub body was read, including omitted proof sections. Its 38,426 UTF-16 units and SHA-256 b20f6cb5534bff47bcf98096aeb460d6c0e6a04d04bd040b56bb98907e910752 match the captured snapshot. The current qualification compares three alternating pairs on identical Node/SQLite versions: all phase medians decrease, warmed SQL falls by 27.6 statements per turn, maximum phase wall ratio is 1.063, and all six workloads finish with zero failed SQL executions. No current-head request-count reduction is claimed. (eaac581083b1)
  • Previous qualification resolved: Revision 5 reviewed this same head with no findings and requested SQL comparison plus SDK qualification. The matching body now records both: the SDK report passed in 476.02 seconds with no public entrypoint, declaration-text, or export-kind changes. Its 130 reachable-only changes across eight internal blocks are disclosed, with report digest 77b0eec8a904aaa73af2f8d1fd86796e71891a973f03c58104e854e85d188061. (eaac581083b1)
  • Authority and final-effect coverage: The fixed-operation regression exercises the actual worker commit: an authorized patch persists, then a foreign route change refuses the next patch without changing stored session data or publishing a callback. Additional production-boundary cases cover queued terminal settlement after claim, lifecycle, or authority changes and physical-store replacement. These supplement the recorded exact-tree integration results; this review did not execute tests. (src/config/sessions/session-entry-patch.test.ts:173, eaac581083b1)
  • Compatibility boundary: The diff changes execution planning and runtime custody, while retaining existing stored fields, serialization, schema, retention, and public callback contracts. Native and incognito adapters remain. The published 2026.9.8 driver update evidence is explicitly bound to earlier head befb81a and is not represented as a current-head run. Source inspection establishes no new stored-data migration requirement. (src/config/sessions/session-accessor.sqlite-entry.ts:426, eaac581083b1)

Likely related people:

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

Rating scale

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

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

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

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-07T17:31:20.876Z sha befb81a :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T17:40:41.243Z sha befb81a :: blocked before merge. :: [P2] Retarget the replay fixture to the remaining preparation boundary | [P2] Seed activity timestamps independently of the caller clock
  • reviewed 2026-10-07T18:39:16.138Z sha b277579 :: blocked before merge. :: none
  • reviewed 2026-10-07T19:27:30.953Z sha b277579 :: blocked before merge. :: none
  • reviewed 2026-10-07T20:11:14.366Z sha eaac581 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
Merge main at 24d311d. Preserve historical fixture timestamps with replacement writes and inject foreign transcript writes at the pre-commit boundary, keeping replay, ordering, and retention assertions intact.
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 7, 2026
Carry conversation authority through fixed session reductions and retain the transaction-local guard shared with prepared patches. Cover a foreign route change before commit without altering callback, publication, or writer-claim semantics.
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 7, 2026
@steipete
steipete merged commit c6698b1 into main Oct 7, 2026
294 of 297 checks passed
@steipete
steipete deleted the dbasync/tb3writes branch October 7, 2026 20:47
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 7, 2026
48 upstream commits through eb7a4b1. Four conflicts:
- src/auto-reply/reply/session-updates.ts: upstream openclaw#166674 (c6698b1) moved
  compaction accounting from a local update closure into the worker
  operation `kind: "compaction-accounting"`. That operation's accounting
  payload is projectCompactionAccountingPatch's own parameter type, so the
  feature's newSessionId (a context engine changed session identity) and
  sessionKey are passed through it. The feature's pre-normalization of
  amount/tokensAfter/now is dropped (the projection normalizes them itself),
  along with its now-unused import.
- src/config/sessions/session-sharing-store.worker.ts: upstream's
  recordSessionParticipantFromWorker rename, plus the feature's
  recipient-authority import.
- test/vitest/vitest.database-worker-core-paths.mjs: both sides' entries.
- docs/.generated/config-baseline.sha256: regenerated (--check OK).

Checks: typecheck clean for core, extensions, every core test shard and
extensions-test. Assertion-safety and database-worker ratchets OK.
Canonical runner: session-updates*, session-sharing* (store and gateway),
session-entry-patch-operation*, compaction*, result-accounting and the newly
listed database-worker files, 20 files, all green.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
Run fixed internal updates against current rows in the existing writer command,
retain callback prepare/CAS, and omit empty turn and maintenance planning.
Keep exceptional terminal cleanup bound to the accepted live admission and
original physical source through acknowledged publication and settlement.

Paired all-thread warmed SQL falls from 2267.9 to 2234.2 statements per turn;
first-turn SQL falls from 5876 to 5838. Schema, durability, retention, and
permission contracts are unchanged. The full write-group design target remains
future work. Includes the existing main terminal font-test call-shape correction.
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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