Repository navigation
perf(agent-db): retain selected session execution through turn phases - #166703
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. |
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 8, 2026, 3:58 PM ET / 19:58 UTC (Revision 37). ClawSweeper reviewWhat this changesThe branch retains the selected session database across reply phases, batches related reads, and delays maintenance writer admission until a mutation is needed. Review scores
ProductKind: Performance · Worth it: Yes Merge readiness⛔ Blocked before merge - 2 items remain This PR provides distinct, measured performance value and resolves the previously reported conflict. No actionable code finding was established; current-head CI is failed/cancelled and remains an enforced landing gate. Priority: P2 Before merge
FindingsNone. Provenance
Agent review detailsHow this fits togetherThe Gateway prepares chat turns using session identity, membership, policy, and transcript facts stored in SQLite. The changed reader carries the selected physical database through preparation and returns fresh facts under the existing execution and authority owners. flowchart TD
A[Incoming chat turn] --> B[Session admission]
B --> C[Retained physical database]
C --> D[Fresh bounded worker read]
D --> E{Caller and session still current?}
E -->|Yes| F[Synchronous reply preparation]
E -->|No| G[Reject stale work]
F --> H[Release and join accepted work]
Technical reviewBest possible solution: Keep one admitted database owner through foreground phases, preserving fresh reads, live authorization, acknowledged lifecycle transfers, and joined cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable to a bug reproduction: the performance problem is demonstrated by matched first-turn and warmed-turn Gateway measurements; this read-only review did not execute code. Is this the best way to solve the issue? Yes: extending the existing execution and reader owners avoids another database owner while preserving physical selection, freshness, and live authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c8283bcc86c7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: LabelsLabel changes: No label 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 HistoryReview history (36 earlier review cycles; latest 8 shown)
|
Merge main at cbfbdc8 while retaining the selected session execution owner. Preserve transcriptOwner alongside the consolidated sessionPreparation input. Seed the queued-reader freshness fixture through the existing synchronous writer so unrelated automatic maintenance cannot occupy its controlled race window. Preserve the original snapshot, queued-write, and event-order assertions. The original head reproduced the fixture failure in all five runs; the merge base passed all five. A diagnostic proved that consumption preceded the queued write, and the corrected fixture passed all seven tests. Production and core test types, Madge, and independent P2 review passed on the integrated tree.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge main at e1dbb59 after #166698 landed. Keep the selected session execution and foreground fact implementation, and its freshness-fixture correction, unchanged while incorporating the canonical TEMP generation admission fix. The integration required no conflict resolution or additional product changes. Fresh P2 review is clean; affected checks and alternating statement measurements remain required before landing.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge main at 0abba2b while preserving both required-worker selection and the retained session reader. Keep main's reply-input and classification helpers alongside the cohort fingerprint path. Reuse main's sessionTarget object while carrying the reader, lifecycle facts, abort check, and acknowledged initialization handoff through their existing owners. Fresh independent P2 review found no actionable defects in the integrated tree. Exact-head runtime, SDK, CI, and statement proof remain landing gates.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge current main into the turn-budget step-one branch without rebasing. Preserve main's native writer claim and empty-maintenance completion alongside retained session-reader authority and the extracted preparation regressions. Route the two model-selection consumers to the existing host-owned test project after main moved placement reads to the shared-state worker. The three missing-broker cases reproduce before the routing repair and pass through the normal test router afterward. Post-integration production and core test types pass; Madge reports no cycles. Fresh independent P2 review found no actionable correctness findings.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge main to resolve the admission conflict created during PR #166703's merge admission. Keep main's ordered-read timing observer and forward the existing abort signal into the same queued admission. Preserve FIFO, settled results, current authority and existing SQL. The nine admission-owner tests pass. Earlier full P2, ClawSweeper and paired SQL proof remain applicable under the operator's conflict-only landing instructions.
Merge main to resolve an import-only conflict created during final merge admission. Keep main's named reply lifecycle owner and this PR's retained database-admission binder. Both calls remain unchanged. Reuse the prior green CI and reviewed retained-owner behavior for unchanged code. Validate the composition through the direct reply admission suites.
Merge main to resolve the session-sharing policy conflict. Keep the configured incognito physical-target check ahead of both retained and ordinary target selection, preserving main's validation and this PR's existing reader custody and membership checks. The resolution composes the existing owners without new SQL, permissions, stored formats or released SDK signatures. Reuse earlier review and SQL proof under the maintainer's conflict-only landing instructions.
Merge main to resolve the test-only import overlap. Retain main's target metadata discovery lane and the PR's membership fixture, removing the now unused history-lane import. Production changes come only from main.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…7194) Chat turns were reacquiring session-row and placement presentation facts after their owners had already published committed facts. Reuse complete local placement receipts, retain transcript-independent metadata, and consume initial remote pending-result preparation once. Physical-store fencing, superseded/uncertain receipt invalidation, and final live claim authority remain intact. Schema, stored bytes, durability, retention, permissions, and update behavior are unchanged. The recorded alternating workload removes 11.8 all-thread SQL statements and 3.9 worker requests per warmed turn against the step-1 base. Integrated-head proof passed 42 focused tests, production types, all 27 core-test type graphs, Madge, and P2 review. ClawSweeper reviewed the final head without findings. Land with the documented inherited CI exception for the unchanged restart-admission timeout in server.node-shutdown.test.ts, run 37843723751. No passing CI rerun or same-test main reproduction is claimed. All other CI jobs succeeded or were intentionally skipped, and security gates passed. Related: #166703.
…openclaw#166703) * perf(agent-db): retain selected session execution across turn phases * perf(sessions): reuse empty pending-history counts * refactor(agent-db): keep cohort scope within its reader module * refactor(agent-db): make lazy cohort imports explicit * refactor(agent-db): preserve session callback receivers * test(agent-db): route mixed model directives through the host worker Complete the async placement-reader cutover for the mixed-inline consumer, matching the entry already landed on main. The normal threaded test project reproduces five missing-host-broker failures; the existing host-owned infra project passes all 26 cases without assertion, fixture, or runtime changes. Focused proof: pnpm test src/auto-reply/reply/directive-handling.mixed-inline.test.ts --maxWorkers=1 Wall time: 104.621 seconds. Fresh P2 review is clean. * test: repair session fixture cleanup and payload assertions Close session database owners before deleting native-slash fixtures. Verify compressed transcript previews without requiring expanded SQLite TEXT, while retaining zero-payload title-only reads. * test(sessions): remove unused cohort writer import * fix(sessions): retain admitted reads across compaction successors Transfer the retained reader from the committed predecessor to its accepted successor using the existing same-generation handoff. Preserve reset rejection, cancellation, and release settlement in embedded and preflight compaction without adding a persisted guard read. Recognize the combined data-version freshness query in the cohort regression while retaining the exact one-probe assertion. Both compaction entry paths failed before the repair and pass afterward; focused and sibling runtime checks, type lanes, cycle checks, and P2 review passed.
…nclaw#167194) Chat turns were reacquiring session-row and placement presentation facts after their owners had already published committed facts. Reuse complete local placement receipts, retain transcript-independent metadata, and consume initial remote pending-result preparation once. Physical-store fencing, superseded/uncertain receipt invalidation, and final live claim authority remain intact. Schema, stored bytes, durability, retention, permissions, and update behavior are unchanged. The recorded alternating workload removes 11.8 all-thread SQL statements and 3.9 worker requests per warmed turn against the step-1 base. Integrated-head proof passed 42 focused tests, production types, all 27 core-test type graphs, Madge, and P2 review. ClawSweeper reviewed the final head without findings. Land with the documented inherited CI exception for the unchanged restart-admission timeout in server.node-shutdown.test.ts, run 37843723751. No passing CI rerun or same-test main reproduction is claimed. All other CI jobs succeeded or were intentionally skipped, and security gates passed. Related: openclaw#166703.
What Problem This Solves
Chat admission and turn preparation repeatedly rediscover the same physical session store and fetch related entry facts in separate worker requests. Moving individual reads to workers can add more admission and transaction statements than it removes. No-op maintenance also prepares a writer before knowing whether a row needs changing.
Why This Change Was Made
Implement turn-budget step 1: retain the selected execution owner and read bounded facts for foreground phases. Extend the existing
OpenClawAgentDatabaseExecutionowner'ssession.entry.readoperation with entry, membership, participant, lifecycle/header, and anchor cohorts. Carry the original physical selection through reply admission and execution. Each unpinned phase checks foreign commits; synchronous consumption retains the native-mutation witness and live caller authority. Reset, deletion, replacement, and release revoke the borrow. Acknowledged initialization or compaction transfers only the committed identity on the same native generation and joins old accepted work.Reuse the canonical kernels and revision facts from #166054 and the reader/admission prerequisite #166503. Pre-admission and read-only discovery retain their existing owners and do not create storage. Read-only maintenance planning defers cold writer admission until the first actual mutation. FIFO and accepted-write settlement stay with the existing executor. Large history payloads keep their history reader.
The maintained contract is documented in worker-access.md. This is one step toward the campaign's fewer-than-500-statements warmed-turn target, not a claim that the complete target is reached.
User Impact
No schema, stored-byte, retention, durability, environment-name, or released synchronous SDK signature change. Update behavior remains unchanged. The original approved static-site comparison was T1 808 → 808: this reduces dynamic requests and statements rather than removing shared synchronous SDK kernels. The current three-pair comparison reduces first-turn all-thread SQL from 3,539 to 3,441 (−2.77%) and warmed per-turn SQL from 1,340.9 to 1,249.6 (−6.81%). Focused proof retains its original pins with a verified unchanged-input bridge.
Two retained-reader lifecycle defects found during landing were repaired. After committed compaction, initialization and recovery now use the same acknowledged transition owner. The tool-authority snapshot resolves the current reader through its captured admission, while its independently captured tool-policy classification identity stays frozen. Unrelated reset, replacement, close, and cancellation still revoke stale work.
Evidence
Current landing head
Published head a7d8871, integrated main b992cfc, tree 08b922c6231de4de5807f5ee9fe52a095c03b79b. The latest conflict is test-only: keep main's
targetDiscoveryLanefixture and this PR's membership helper; remove the unused history-lane import. All 10 selected cases pass in 83.83 seconds; 31 unrelated cases were not selected. Current CI run 37833386841 is attached.The preceding conflict resolutions preserved both reply lifecycle/database-admission imports (31/31 direct tests, 153.43 seconds at d0b45af), then retained main's incognito physical-target check before both retained and discovery sharing paths (7 selected cases passed, 291.88 seconds at 793a0f7). No production behavior was deliberately changed by these compositions. Earlier full P2, ClawSweeper, released-SDK and valid paired SQL proof remain qualified at their actual pins. No new ClawSweeper request or SQL measurement was added.
The previously qualified head
bc4c6f4e133fcompleted CI run 37821169600 successfully. D0's later CI exposed an inherited voice-digest assertion race atsrc/talk/client-voice-session.digest-retry.test.ts:325: it waits for sender invocation, while the unchanged owner persists the delivery marker only after sender completion and read-scope cleanup. All five direct inputs match actual CI mainc786f4d4and merge81cd4c5d; shared-reader reachability is acknowledged, without inventing an invocation-to-persistence guarantee. No reproduction or rerun was performed for that inherited failure. Its old run remains historical evidence, not current-head CI.Previous conflict-only integration at bc4c6f4
Published head bc4c6f4, integrated main 41dd80a, tree 132db547a8372b218b862796f485cdd4236454ae. Native merge admission on the preceding head was refused before dispatch because another landing introduced a conflict in
openclaw-agent-write-admission.ts. The resolution preserves main's ordered-read timing observer and passes the existing abort signal as the sixth admission argument. FIFO, current authority, settled results and SQL behavior remain unchanged. The earlier rejected operation lock was recovered by its exact owner token; no uncertain merge was replayed.All nine admission-owner tests pass (25.61 seconds). Both focused queued-cohort cancellation cases pass (280.15 seconds including worker preparation; 39 unrelated cases were not selected). Earlier complete P2 review, ClawSweeper's no-actionable-findings review of substantially the same code, released-SDK compatibility evidence and valid paired SQL proof are reused under the operator's LANDING ACCELERATION v3. No new ClawSweeper review or SQL measurement is requested. This is a mechanical composition of independently reviewed cancellation and diagnostics owners.
Main commit 41dd80a supplies the quiet-Discord fixture correction; it is inherited in this merge. The prior failed CI and admin evidence below retain their old head and are not current-head evidence. The exact-head CI run 37821169600 completed successfully. Required CI/security checks and native hosted-proof verification passed; optional checks did not delay landing.
Prior integration and retained proof at 1a4f9ed
Published head 1a4f9ed, integrated main fc1b2e6, tree d04468a10a56a3f6e10099007be51a733ea0ccf0. GitHub reported a real conflict, so main was merged without rebasing. The sole manual resolution retains the live reader assertion in
attempt-trajectory.tsand adopts main's equivalentprojectTrajectorySessionTargetextraction (#167325). The automatic model-selection and session-bootstrap simplifications preserve both sides' behavior. No new SQL, schema or released SDK signature is introduced by this resolution.Fresh complete-candidate P2 review is scoped-clean. All 175 focused tests across nine files passed (four native Vitest shards, 1,420.88 seconds including contended local preparation). They cover model selection, compaction recovery, normalization, retained trajectory targets, revocation, and cleanup. Production types passed locally in 92.369 seconds; Madge reports zero cycles. All seven production/test-type jobs passed on this exact head in CI run 37815318584. The initial local core-test error was a stale installed Ghostty patch lacking
onCopy; the task-owned frozen install was refreshed after tests settled. The failed local attempt remains recorded; hosted type success is the completed integration proof.The SDK18 report is reused with a verified source bridge: all 111 PR paths have identical added/deleted-line sequences before and after integration;
src/plugin-sdkandsrc/plugins/runtimeare unchanged. Its 131 reachable exports, zero direct public declaration/kind changes, and zero entrypoint changes retain their exact report digest below.Trusted ClawSweeper completed this exact head at 2026-10-08T17:24:41.151Z with high confidence and no actionable findings. Its generic compatibility checklist came from an incomplete file-list classification; the complete diff and released SDK audit confirm no config/default, schema, stored-byte, retention, or update-contract change. The existing maintenance phase shift and final-authority guards remain explicitly documented.
Current CI 37815318584, attempt 1 is terminal: 104 successful jobs, 21 skipped, one independently inherited execution failure and its aggregate; zero cancellations. Job 113443249249 reports only the same two quiet-Discord line-1782 assertions described below; all other selected checks passed. The actual CI checkout is
5028c4de0510f700e86800df2064a0deae7146d4, merging current head into main3be885108e5e7c846ee6c97cb3d0a8d206b47ba0. Native inherited-failure admin admission is explicitly authorized; no job rerun or new reproduction was used. Skipped checks remain skipped coverage.The accepted three alternating pairs and focused SQL proof below remain qualified under the operator's LANDING ACCELERATION v2: no SQL re-measurement is needed for this equivalent projection-only conflict. Their actual source pins and measurements remain explicit.
The previous head's portal30s and skill-refresh90s CI timeouts remain recorded, not relabeled as fixed or inherited. Source/reachability and recent-main audits found no matching independent main timeout; Linux reproduction preparation hit three OOM failures, then the model-capacity interruption stopped its client heartbeat and the lease expired before any tests ran. The original assertions/timeouts were unchanged and no CI rerun occurred. The required conflict integration supersedes replaying that old head. Existing quiet-Discord assertion inheritance remains separately qualified. The old native auto intent stays explicitly retired; landing will use exact-head native recovery after required CI, security and ClawSweeper gates.
Retained source and review proof at 789106
Published head:
789106d11e61cf2fcec8d26f73b04bd61104bf57. Integrated main:7b41658157cf26d673d3cae847f857253b6d65ae. Reviewed/tested tree:a3a7565edd42e78cd2a73ed42158d2f602f0c04e.Main was integrated with merge commits, without rebasing. The latest integration was required because main fixed the Workboard manifest CI failure (
d7b523ece4fd). It merged automatically and includes worker-owned ordinary-session filtering for cron (#167248). Full-list canonical/participant validation still precedes filtering, only selected cron rows cross to the host, and the retained physical reader and live commit guards remain intact. The earlier reply lifecycle consolidation (#167236), plugin/path optimization (#167235), and acknowledged compaction/tool-reader handoffs are preserved. Overlaps were composed without reverting either owner.The current complete-diff P2 review is scoped-clean. Current proof:
All 195 tests across 12 files passed; source stayed frozen and owned processes settled. Changed-lane planning selects core/coreTests/docs/tooling without extension lanes. Prior unchanged-owner proof retains its actual pins, including 407 tests at 8d7 and 798 at 1cc4c61; it is not relabeled current-head execution.
Statement qualification
The current ordinary comparison uses three same-host alternating 7b416 / 789106 pairs on an isolated 8-CPU Linux runner, with Node 26.10.0, SQLite 3.53.4, and pnpm 12.5.1. Both builds and every calibration/source guard passed. The original strict clean-source kit is restored after main fixed Workboard's generated manifest; no build-output exception, observer, assertion, workload, or phase change applies to this run. Kit digest:
41913c99993b533f55489d17a0edb9c554bb3c95ea05175610dc0a0a48c99176.Ordinary workloads pass the all-thread statement gate. Values below are medians across three runs; warmed is the median of each run's ten-turn average. Every individual warmed-phase median also decreases by 87–98 statements. All ordinary duration ratios are below 1.043.
The savings occur in worker-side SQL. Main-thread medians stay unchanged: first turn 74, every warmed turn 0, second session 71, control 0, cron 30, compaction 42, shutdown 389. All six runs completed equivalent memory work: three embedding requests, three indexed sources, five chunks/cache entries, matching FTS/provenance counts, no memory-sync failures, and successful shutdown. All six raw traces conserve exact phase/thread/SQL counts and report zero failed SQL.
The control +1 is two scheduled WAL statements (main
[0,0,0], candidate[2,2,2]) while non-periodic payload work falls from 40 to 39 in every run. Compaction's +153 consists mostly of earlier memory work; memory-core SQL totals exactly 675 across compaction+shutdown in every run on both sides. The combined tail +1 is +6 conditional memory-corpus schema/canonical/column probes, −2 scheduled WAL, and −1 each for other freshness, config-state, and outbound-recovery reads. Every positive corpus SQL/stack group already occurs at the candidate frequency in main run 3. Twelve involved owners are byte-identical between 7b416 and 789106; payload query counts do not increase. These attributed unchanged-owner differences satisfy the approved non-turn and adjacent-window tolerances.The observer has no request-envelope census, so unknown request ownership stays unassigned. Acceptance uses complete raw all-thread counts without subtraction; the classifier's separate conservative request-ownership result is not claimed determinate. The verified ordinary archive SHA-256 is
1e5c449955142d70d5c61df5c9d7b0a8f4f2045ca633c597cef898f535bc32ff.The preceding ae18/8d7 focused comparison remains supported by an independent integration audit: all 14 fixture bindings and 26 helper/runtime/dependency bindings are unchanged. The seven focused flows neither call the changed cron registry sweep nor instantiate failed model discovery; fresh ordinary pairs cover that real Gateway composition. Historical source pins remain explicit.
All 42 focused real-entry invocations passed in three alternating ae18/8d7 pairs; their unchanged-input bridge is recorded above. Every non-maintenance measured-flow median is unchanged; the approved maintenance components remain one gated window. Every gated duration ratio is below 1.5.
Maintenance sums are M=[800,800,800] → C=[809,809,809], median +9 (+1.125%), main-thread 73 → 73, combined duration ratio 1.375. The backdate subphase alone grows by 605 statements and has ratio 3.822 because it now owns cold writer admission; those costs remain fully included in the approved combined unit. No writer warmup, dropped assertion, or SQL subtraction is used.
The earlier approved window was 1,024 → 1,030 (+6). The additional relative three statements are precisely explained by integrated main: #166674 removes four more generation reads from main's two no-op passes (+4 relative); #166698 adds one relative TEMP attestation (+1), while preserved admission removes a candidate column check and catalog read (−1 each). The maintenance kernels/reclamation owner are byte-identical to approved 5138901, and the relevant schema owners are byte-identical between current main and candidate. This is the same approved read-only/late-writer contract composed with main's fixes, not a newly introduced maintenance operation.
The resident setup +4 is one additional existing background row-backfill snapshot: BEGIN, watermark projection SELECT, COMMIT, and freshness probe. Counts are main [5,7,6] versus candidate [5,7,7]; the same stack already occurs seven times on main. The dispatcher branch and source owners are unchanged. Lifecycle proof retains two matched database-locked attempts per side/run from the existing config-health observer; including attempted SQL gives 62 → 62, while successful SQL is 60 → 60. The lock holder is unknown; no assertion failed.
All 42 focused trace classifications conserve exact phase/thread/SQL totals. Full source/build bindings, raw traces, setup/cleanup counts, and failed attempts are retained. The final archive SHA-256 is
a81c659564ebe7c2184bf3d1c0abc523168cd9629bb9548dd7a8d99562c4226e.Historical limitations remain explicit: Historical bf671/33b68 Linux samples reduced first/warmed counts, but shutdown increased while only the candidate completed memory work: main made zero embedding requests, candidate made three and persisted three sources/five chunks. Those samples are unqualified, not a phase-only shift. An earlier Mac comparison also had invalid tail duration ratios and an unattributed 101.848-second shutdown window. Raw samples and diagnostics are retained; no speculative shutdown repair was added.
Channel QA and CI failure qualification
Five complete de4 main QA repetitions and five F2 candidate repetitions each executed 80 cases: 70 passed, ten failures confined to two quiet-Discord assertions, zero skipped. Every failing message matches line 1782:34 of
test/e2e/qa-lab/runtime/channel-progress-presentation.e2e.test.ts: non-native/root/toolProgress=false, with normal and failed Exec tools. The fixture rejectsExec/Bashtext, while main intentionally preserves bounded work status with detailed progress disabled.The de4 and F2 receipts retain their actual source pins. A narrow audit found all 27 critical fixture/producer/renderer inputs unchanged at the original de4/F2 proof pins, ae18, then-current head 8d7, CI main 1dfb, and merge 3f8; the integration18 audit also preserves all 27 inputs through current main 7b416 and head 789106. Reply presentation, typing/callback order, explicit mirror=false calls, used mock chunking, and tool event data are preserved. Context-budget and interruption branches do not remove already-recorded tool-start status in these fresh, tiny, non-interrupted sessions. This qualifies the two existing assertions without claiming whole-repository closure equality or silently repeating/relabeling older runs. The matched reused-runtime QA medians were 490.784 s main / 491.102 s F2.
A second inherited failure was independently reproduced for the preceding F2 CI run: Workboard's generated asset manifest. Exact main 34b2cfb and actual CI merge 670a42df318ad4f8eacf015255e0db333a1f5cb8 both pass
pnpm plugins:assets:build --plugin workboard, then fail unfilteredpnpm plugins:assets:check, naming onlyextensions/workboard/openclaw.plugin.json. Main's browser refactor (#167227,89c01cd979ef) omitted regeneration. Both sides have identical 194 actual bundle inputs and five outputs, and both replace stale asset hash76cf5461…withb6384af95d192b62744a73fa478ae37bdf41771fbcdcc38b8b012c0b5310fdf8. The target builds took 1.085/1.082 s and the failing checks 2.701/2.675 s on Node 24.21.0/esbuild 0.28.2. Only disposable proof trees were modified, then removed; no generated hash was hand-edited or put into this PR. The preceding CI merge 3f8 reproduced the same failure; all 81 tracked bundle inputs, six generator/package sources, root package/lock/workspace configuration, and manifest remain identical to the independent reproduction.Current head a7d8871 includes conflict-only main integrations through b992cfc. The latest resolution preserves both main's discovery lane and the PR's cohort fixture imports. Ten selected logical-reader replacement/discovery/cohort tests passed locally in 83.83 s; 31 other cases were deliberately unselected. Earlier focused conflict proof passed 7 sharing cases, 31 reply-admission cases, 9 writer-admission cases and 2 queued-cohort cases at their respective prior heads. Full CI 37821169600 passed at bc4c6f4; this is historical proof, not current-head CI.
Current CI 37833386841, attempt 1 tested synthetic merge fcae97bf042649922567dd699f140e29c55c1ef0, whose ordered parents are b992cfc and a7d8871 and whose tree equals the candidate. The sole execution failure, Android job 113505036719, occurred in SDK Manager while unpacking the external Android Emulator package:
Error reading Zip content from a SeekableByteChannel. It happened before app build or native tests; report upload then found no results. The exact underlying archive failure is unknown. The workflow and toolchain actions are identical to the main baseline, and this PR cannot affect these SDK archive bytes. This is an independently attributed, unrelated infrastructure failure under the operator-authorized native admin exception; no claim is made of reproducing it on main.The successful fail-fast monitor cancelled 88 sibling jobs. The final inventory is 7 successful, 21 skipped, 88 cancelled, and 2 failed (Android plus aggregate). Every cancelled job has complete step evidence with no independently failed step. Cancellations remain missing coverage. Security-fast passed; native admission separately verifies current security/review policy. No CI rerun was requested. The retained auto-merge request was explicitly cancelled earlier, and native recovery owns the replacement admin request.
The earlier portal-preview and skill-refresh timeouts remain unattributed historical observations. Matching remote reproduction did not execute before its lease expired; no fix or passing replay is claimed. Subsequent full BC4 CI passed. Main's Workboard and quiet-Discord fixes are integrated, so their older failure exceptions are retired. The local logical-reader size diagnostic remains disclosed (currently 1175 lines against cap 1000); CI treats this limit as advisory. No limit, baseline, ignore or assertion was weakened.
Trusted ClawSweeper review completed at 1a4f9ed on 2026-10-08T17:24:41.151Z, with high confidence and no actionable findings. The operator explicitly accepts this review for the later mechanical integrations. Its compatibility checklist is addressed by the released SDK audit below. Full P2 review at 1a4f9ed was scoped-clean; subsequent conflict compositions were inspected and focused-tested. Valid paired SQL and SDK proof is reused with its original pins; no new measurement is claimed.
SDK and regression proof
The latest stable v2026.9.9 was inspected directly:
src/plugins/runtime/types-core.ts:398andsrc/plugin-sdk/session-store-runtime.ts:391retain synchronousgetSessionEntry. No changed callable in this PR replaces that released boundary. The current canonical local report (7b416 → 789106) passed in 277.011 s with 131 conservatively reachable exports, zero direct public declaration/kind changes, zero entrypoint additions/removals, and 17 audited internal sections; digestd4e045a1ea601affaad566e1ef0c353e266fe5ef0bd358fdb5289bf95c63e3bb. All 17 before/after declaration texts are byte-identical to the preceding audited report. No compatibility shim, declaration-baseline acknowledgement, or speculative SDK type test was added.The compaction handoff defect was reproduced before repair with
SessionEntryChangedDuringReadErrorfor overflow, timeout, and preflight paths, then fixed in 2d8fbc6. Actual immutable predecessor/current commit facts drive the handoff outside the synchronous commit sink. Physical/native generation, cancellation, old-work settlement, and both original persisted recovery guards remain; the handoff adds no SQL. Full runtime siblings passed 74/74, with the final selected recovery/cancellation/cohort cases passing 4/4.The tool-authority regression first failed with a released-reader error, then the complete worker suite passed 6/6 after 1cc4c61 captured the admission-owned current-reader resolver. A separate unchanged policy survives handoff, changed classification identity refuses as main does, and close/replacement cannot fall back to independent discovery. Current integration proof repeats those owning boundaries. An unused test import was separately removed in 33b68af. No agent attribution trailers are present.
Earlier published-driver 2026.9.8 × candidate proof passed 19 phases including update/restart, readiness HTTP 200, durable/incognito reads, and shutdown (Testbox run). That retains its original source pin; schema, stored bytes, updater behavior, and the released facade remain unchanged here.
Follow-ups and overlaps
Retained cross-owner host reads remain follow-up debt: the compaction placement guard (
src/agents/embedded-agent-runner/compaction-successor.ts:226→src/gateway/worker-environments/worker-turn-launcher.ts:102→src/gateway/worker-environments/placement-store.ts:137) checks shared-state placement immediately before the agent-store commit. Native/SDK reclamation retains its cross-store descendant-basis check (src/config/sessions/session-accessor.sqlite-reclamation-run.ts:184→src/config/sessions/session-accessor.sqlite-descendant-basis.ts:45). These existing checks are not new SQL, and no zero-host-SQL claim or test applies to those retained paths.The TEMP generation-tracker readmission fix (#166698) is integrated without restoring writer warmups. Synchronous restart-intent contention during SIGTERM remains the separately recorded shutdown-owner follow-up. Later turn-budget steps still own complete projection receipts, compatible write composition, history metadata cohorts, and remaining shared-state/background work.
Related work includes phase-local write planning (#166674), native placement reads (#166445), session fact reuse (#166054), reader admission (#166503), miscellaneous SQL work (#166053), wave-6 entry/auth/binding/worktree/approval (#166050), and the locked-write chain. Cleanup overlaps are incidental. Performance, SDK, and review qualification are complete. Current-head CI and native merge admission remain enforced.