Skip to content

perf(sessions): route the remaining per-turn native session patches through the writer - #165193

Merged
steipete merged 4 commits into
mainfrom
dbasync/nativepatchtail
Oct 5, 2026
Merged

steipete merged 4 commits into
mainfrom
dbasync/nativepatchtail

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Warmed turns still performed two native session patches on the Gateway thread: lifecycle start publication and terminal lifecycle persistence. Temporary async-stack attribution identified server-chat-lifecycle-publication.ts and session-lifecycle-persistence-owner.ts → persistGatewaySessionLifecycleEvent as their producers; the instrumentation has been removed.

Why This Change Was Made

Send same-store lifecycle patches through the existing agent writer and patch worker. Recovery, companion, and Stop authority prepare source facts through the existing read worker, carry them through caller receipts and request/control adapters, and revalidate live authority before submission and after settlement. The write transaction rereads typed row, membership, and transcript predicates on its own connection. Conditional no-ops and target CAS checks keep their existing precedence; source refusal rolls back before the final commit grant.

Cross-store patches retain their native transaction: event-loop atomicity across stores is required while the released synchronous transcript SDK can mutate the source outside async queues. Routing is explicit from prepared physical identities, never an error fallback; revisit at the next SDK major. Process-held incognito sources and opaque released SDK guards retain their native contracts. Accepted lifecycle persistence joins before workers close and does not inherit scheduler cancellation.

User Impact

No schema, retention, durability, configuration, or released SDK behavior change. One existing writer owns the moved operations; unknown outcomes never replay. Production: +1,567 / −470 / net +1,097; 2,037 changed lines, plus one wrapper-inventory entry.

Pre-existing other-owner authority reads remain follow-up debt: the shared-profile role fallback in src/gateway/operator-role-policy.ts:48 and creator-alias fallback in src/gateway/session-creator.ts:27. They remain live authority checks; moved source-storage predicates execute in the worker.

Evidence

Candidate: e023d086bd5d6ca95cee5d60a50a06060148ece9; implementation base: 327dc38387b6afa8c8d62b4f6c8c9975143331d3. SQL baseline: 82adb7a49d36e844e4ea1989bc5d865abac916f0, Node 24.21.0, the unchanged sqlmeasure workload. Aggregate counts include concurrent/background work and changes incorporated from main; they are not a latency claim or additive credit for this PR.

Successful MAIN-thread statements Before Final candidate
Native patch cohort, ten warmed turns 420 (42/turn) 0 (0/turn)
Native patch cohort, entire workload 1,073 442
All warmed statements, mean/turn 221.8 181.7
All statements, entire workload 7,890 7,178
Static T1 inventory (historical baseline) 895 894

Final sqlmeasure completed all 13 top-level turns, child run, cron, compaction, and graceful shutdown in 139.0s; Node 24.21.0. The two warmed native transactions are gone (20 → 0 across ten turns). Remaining native patch statements occur on first-turn initialization (48), second-session/child work (165), and cron (229). The measured native arm is session-accessor.sqlite-entry.ts:559–627; all resolved disk paths stayed inside the synthetic fixture.

Validation (all focused Vitest commands use --maxWorkers=1):

  • 79 tests / 8 files passed in 539.79s wall on the final locator-corrected source, including all four shared-registry/import checks, sharing and companion authorization, and real Stop.
  • 74 tests / 10 files passed in 703.43s wall after integrating compound 3b, including its lifecycle/reclamation/rewrite/reset siblings and the writer-acquisition cleanup regression.
  • 81 tests / 10 files passed in 1,035.80s wall, covering patch FIFO/publication, same-store source predicates, cross-store native routing/refusal, recovered-caller Stop, companion authority, and the merged transcript-context boundary/race tests. This includes all four shared-registry/import checks: runtime-process-build-graph, get-reply.imports, openclaw-state.worker.imports, and eager-import-closure.
  • The supplementary owner pass was 104 tests / 8 files, 929.85s, including admitted-run, caller receipt, and session-control lifetimes. The real server-close regression was rerun after the compound integration: 251.38s wall / 23.429s body, proving accepted terminal writes settle after scheduler cancellation and before store retirement.
  • Negative controls reproduced the lost Stop preparation metadata, opaque-guard misrouting, refusal masked by cleanup, source-custody leaks on writer acquisition failure, and stale authority after a logical store locator was retargeted before/after source preparation. The committed cleanup regression passes in 0.713s body; the final recovered-caller Stop case passes in 2.579s body with zero caller-thread SQLite calls. These boundaries require real SQLite/worker/request composition; fixtures are reused, with no new Gateway boots or timers. The added locator cases take 0.734s / 2.727s. Worker compilation and the loaded host dominate command wall times; CI seconds are not yet available.

Test-body cost for the changed tests: caller receipts 0.182s, patch worker 50.714s, opaque dispatch guards 15.128s, companion RPC 14.019s, lifecycle source/Stop 9.585s, sharing worker 50.690s, and the real close case 23.429s. The patch/sharing suites above 30s exercise worker admission, rollback/receipts, and current authorization across actual SQLite owners; mocks cannot prove those boundaries. The close case reuses its existing Gateway fixture. The commands above were batched; these are body totals, not standalone per-file wall times.

  • Full check-changed: passed, 2,372.83s wall. Earlier lint findings were corrected without weakening rules; the final test cleanup passed type-aware lint (52.08s) and its two regression cases (88.43s wall). No limit or baseline was weakened. Environment names remain 473/473, with zero new names.
  • Madge: 0 cycles, 142.94s, including the final locator imports. Database-worker ratchet passes; rebased main and candidate both have 894 T1; the historical 895 → 894 change is from main.
  • Local SDK API diff with physical private TMPDIR: reviewed nonzero diff 6790259c, 128 reachability impacts with unchanged direct export declarations; no entrypoint/export additions or removals and no released synchronous-to-asynchronous Gateway-context contract changes. Reachable declarations cover optional source metadata, an internal worker reader/command, an optional transcript-helper argument, and preserved reexports. The released reader facade does not expose the internal database reader as an SDK implementation requirement. Completed in 1,551.66s wall.
  • Published 2026.9.8 driver × this candidate: passed in 984s, within the unchanged 1,125s deadline. The updater completed in 846.574s; recorded outcome succeeded, managed PID replacement passed, /readyz returned 200, and the running build matched e023d086. Durable session identity/message survived; incognito history was empty after restart and artifact-leak checks passed. Canonical full package creation took 3,393s, including integrity checks; SHA-256 7b3a1289965945f3007a41bae5f76c0251797202005b8ffcc13550eabb03e5c8. Owned container, volume, image, and remote lease were cleaned up.
  • Fresh Codex P2 review: scoped-clean, 309.85s. Actionable acquisition-cleanup and logical-locator findings were fixed; both regressions first failed on the unfixed code.

Build caveats: the first local package build reached its default 45-minute ceiling during cold declarations. The supported 90-minute package-build budget completed the full build; the runtime-cell deadline was never extended. The successful build retained a nonfatal UI startup-size warning: 365.1 KiB gzip versus 364.7 KiB. No budget or baseline file was changed.

Overlaps: #142236 in lifecycle persistence; #162433 is the inactive umbrella design draft. #164922 and #164989 are merged and incorporated; they own compound lifecycle/deletion commit snapshots and transcript context reads. This change leaves their ownership intact and keeps focused additive hunks. The incorporated prepared-sharing work in #164682 is preserved, together with main's placement-preservation, incognito-close, and shutdown-admission changes.

Landing validation

Merged main at dc518bfca481d64aef69f9a4f8435fc6d46ed46d to resolve the additive import conflict with #165181. Both SessionEntrySnapshotField and HarnessCompletionSourceWorker imports are retained; the resolution changes no runtime logic. The published-driver update cell, SDK API diff, and full check-changed above remain prior-head proof for unchanged PR implementation inputs, not current-head CI.

Integrated candidate validation (each command uses --maxWorkers=1):

  • node scripts/run-vitest.mjs src/config/sessions/session-entry-patch.test.ts src/gateway/session-lifecycle-source-authority.test.ts src/gateway/session-lifecycle-persistence-owner.test.ts --maxWorkers=1: 34 tests / 3 files passed, 168.99s wall.
  • node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery-marking.test.ts src/agents/subagents/registry/subagent-parent-recovery.restart-integration.test.ts test/scripts/runtime-process-build-graph.test.ts src/auto-reply/reply/get-reply.imports.test.ts src/state/openclaw-state.worker.imports.test.ts test/scripts/eager-import-closure.test.ts --maxWorkers=1: 55 tests / 6 files passed, 130.20s wall.
  • Worker-cutover routing audit: the indirect startup/restart recovery suites already belong to the forked agents-support project; Gateway and source-authority suites have host-worker ownership. No additional routing change was necessary.
  • Fresh integrated-candidate Codex P2 autoreview: scoped-clean; no actionable findings.
  • Released SDK check against v2026.9.8: no changed direct SDK/runtime exports; synchronous callback callability remains intact. The extracted SessionTranscriptContextVersion retains its three fields and the existing codex-session-transcript-runtime reexport. New source-preparation members and helper parameters are optional; internal worker methods do not become SDK implementation requirements. No compatibility removal or sync-to-async released signature change is introduced.
  • ClawSweeper found no introduced correctness/security defect on e023d086. Its conflict item is resolved above; its data-model proof request is covered by the published 2026.9.8 driver × candidate update cell (984s). No stored schema or data format changed.

The initial PR-context check failed because the problem heading did not match the required template. The body now uses What Problem This Solves; no test assertion or gate was weakened. The integrated-head CI findings and subsequent fixture repair are recorded below; ClawSweeper completed with no actionable code or security findings.

CI fixture repair

Integrated-head CI attempt 1 exposed six failing Node shards. The repairs are test-only and preserve production behavior:

  • in-process-gateway.test.ts compared a callback by identity even though the new source-authority adapter wraps it. The test now invokes the forwarded guard and proves its refusal propagates. The original file failed 5/5 on the PR and passed 5/5 on the merge base; the repaired file passes all 30 cases (14.347s wall).
  • session-lifecycle-state.test.ts still invoked the native guard option in its fake writer. It now exercises workerGuard.source while preserving rejection and unchanged-row assertions. Original PR: 5/5 same failure; baseline: 5/5 all 49 pass. Repaired file: 49 pass (88.205s wall).
  • server.private-completion.test.ts and server-runtime-subscriptions.test.ts assumed that tracked persistence was the underlying write promise. They now prove pending and settled behavior through the owned promise. Subscription cleanup also covers assertions that previously failed before the deferred work was released, causing CI's no-output timeout.
  • main-session-restart-recovery.test.ts created the agent owner before switching its shared-state root. The fixture now pins that root before its first write; the worker's cross-root refusal is unchanged.
  • server.sessions.list-store-materialization.test.ts unnecessarily replaced its seeded row, scheduling maintenance before a raw malformed-row INSERT. Final metadata is now seeded through the fixture's existing maintenance-free initial writer, with all projection/read assertions retained.

The first original-order four-file startup/shutdown baseline passed 46 tests. Original PR execution reached the stale promise-identity assertion and then blocked cleanup; later local 60-second-watchdog attempts on both revisions expired during cold worker compilation and are excluded as environment failures. The first complete private-completion comparison was PR 22 pass/1 fail versus baseline 23 pass; the first complete restart-recovery comparison was PR 149 pass/1 fail versus baseline 150 pass. These runtime comparisons and repaired full-file proofs are now complete, as recorded below. Local cold-compilation failures are excluded from the counts.

Fresh Codex P2 autoreview of the combined six-file repair: scoped-clean. No production code, test deadline, baseline, assertion exception, or new environment name was added by this repair.

Local repaired proof before publication: full in-process caller file 30 passed / 14.347s; full lifecycle-state file 49 passed / 88.205s; private timeout variants 3 passed / 126.329s; the full subscription file plus the changed list and drain-recovery cases 36 passed / 205.29s, with 151 unrelated cases intentionally skipped by the explicit name filter. All use --maxWorkers=1. The six-file check-changed passed, including all four affected typecheck groups, lint, formatting, and repository ratchets. The runtime repetition and full-file evidence is complete below.

Completed comparison evidence

Restart recovery: five original PR full-file runs each reproduced only the cross-root fixture error (149 other cases passed); all five merge-base runs passed all 150 cases. The identical repair passed all 150 cases in 163.68s on Testbox run 37248068883; its lease is stopped. Subscription comparison: all five original PR runs reached the same post-transition stall under the existing CI 60-second watchdog after compilation and 16 prior passing cases; all five baseline full-file runs passed 34 cases. This excludes the earlier local cold-compilation failures.

Repaired-head CI attempt 1 resolved the six original Node fixture failures. Its remaining declaration-build failure is independently inherited: main commit 76922aba447 (#165200) adds the runtime-postbuild-shared.mjs import to run-node-input-state.mts, but the copied declaration fixture omits that module. Module linking fails before PR runtime code executes. The exact tested main parent c5012333049eef43cefe9c38ee4805a0dce971be and CI merge 94afdf9b23b05e424983687de354605fd3b15837 each reproduced the same missing-module failure 5/5, with 10 other tests passing every run. Their test, fixture, build entry point, import owner, and missing-helper source blobs are identical; this PR changes none of those files. The public CI Windows job is 111573781582. The ordinary main push run skipped the affected tests; it is not cited as passing proof.

The npm-pack successor timeout in job 111573782272 was not reproduced in five complete tested-merge and five complete tested-main runs; its original cause remains unclassified. The list/private comparisons and repaired full-file checks are now complete. The original npm timeout remains unclassified; the final integrated head passed CI.

The full list-store baseline comparison reproduced the same raw-INSERT SQLITE_BUSY race in 2/5 runs, with the other cases passing; the other three full-file runs passed. Baseline command wall times were 123.723, 109.458, 106.588, 102.327, 102.170 seconds. This independently confirms the fixture race predates the PR. The repair removes its unnecessary maintenance-producing replacement instead of masking the lock with waits or retries.

Runtime comparison and repair proof complete

All prescribed original/base comparisons for the six fixture repairs are complete. The private-completion file failed only the stale promise-identity assertion in all five original PR runs, with all 23 baseline cases passing in all five baseline runs. The list-store file reproduced the same existing SQLite lock in 2/5 baseline runs and 1/5 original PR runs; other cases passed.

Final Testbox proof passed the repaired complete files with --maxWorkers=1: subscriptions 34/34, 30.166s; list-store materialization 3/3, 103.424s; private completion 23/23, 76.056s. The repaired source SHA-256 values match the published files. Current-head CI also passed all three list-store cases: 2.592s, 60.733s, and 0.933s test-body time in job 111573782294. No test deadline or baseline changed.

Final main integration

Current head: 8ca43aa37bfbd7c81179362d61491fc56610d5bd. Main was merged again, without conflicts or rebase, to incorporate the landed declaration-fixture fix 12785be2ff02 from #165221. No new authored production change was needed. 75 tests across eight files passed in 414.31s with --maxWorkers=1: patch/lifecycle/source-authority, the four shared-registry/import checks, and the complete declaration-writer file. The previously missing-module case now passes. The inherited-failure admin exception is therefore no longer needed for that historical failure.

Fresh P2 review raised a Talk-policy concern. Source inspection shows that the prepared existing-target path calls authorizeSessionAgentRun against current committed policy, which calls authorizeGatewaySessionCreation; missing Talk targets cannot obtain a prepared storage route. Two temporary real-worker diagnostic cases confirmed rejection after revoking the agent permission during source preparation and fail-closed absent targets (2 passed, 211.63s command wall). The concern was rejected as a false positive; the diagnostic was removed, with no production change and no accepted actionable findings remaining.

The npm comparison completed in an isolated local Linux ARM64 container using Node 24.21.0, separate frozen installs, normal qaRuntime builds, and verified exact source trees for CI merge 94afdf9b and tested-main parent c5012333. All 5 + 5 complete file runs passed all 23 cases (230 passes). The originally failing npm-pack case took 5.372–16.023s, while CI timed out at 120s on its x64/Node 24.19 environment. This does not establish an inherited failure or a fix; the original timeout remains unattributed. The necessary main integration passed fresh head-bound CI. All proof containers, volumes, and Testbox leases are stopped/removed.

Landed

Merged as 48c022a42c131ec026291c4be79937722119b2f9 after exact-head CI run 37256161247 passed for 8ca43aa37bfbd7c81179362d61491fc56610d5bd. Native scripts/pr preparation and merge completed through the ordinary green-check path. ClawSweeper completed on that exact head at 02:47 UTC with no introduced code or security findings and accepted the documented npm investigation and Talk-policy disposition. The recorded published-driver update covers the generic data-model checklist; stored contracts are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 8ca43aa37bfbd7c81179362d61491fc56610d5bd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/tools/sessions-control-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/tools/sessions-operator-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/operator-run-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/chat-abort-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-plugin-in-process-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 4, 2026
@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 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

Moves same-store session lifecycle writes and their source checks into the existing database workers while preserving synchronous compatibility paths and shutdown settlement.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR remains useful: current main still uses native lifecycle patches. No introduced correctness or security defect was found, and the documented bounded npm-timeout investigation resolves the previous review blocker under repository policy.

Priority: P2
Reviewed head: 8ca43aa37bfbd7c81179362d61491fc56610d5bd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful worker cutover with strong recorded runtime and upgrade evidence, preserved compatibility, and no actionable introduced findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The recorded production Gateway workload exercises lifecycle persistence through the real workers and SQLite, observes zero warmed native patch statements, and completes shutdown. Source-revocation regressions and the recorded Talk worker probes cover denied effects; the published-driver update preserves durable session data. Later integration qualification is separately recorded, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The recorded production Gateway workload exercises lifecycle persistence through the real workers and SQLite, observes zero warmed native patch statements, and completes shutdown. Source-revocation regressions and the recorded Talk worker probes cover denied effects; the published-driver update preserves durable session data. Later integration qualification is separately recorded, and no stored-data contract changes.
Evidence reviewed 9 items Pinned introduction and clean checkout: Reviewed the explicit b02eab1..8ca43aa introduced delta. Raw head parents match the supplied original-head records; the checkout remained clean. The supplied test merge was not used to attribute removals or regressions.
Still necessary on current main: Fetched main still passes assertCommitAllowed into lifecycle patching; the accessor excludes that option from its worker route. The merged lifecycle and transcript-reader predecessors do not implement this remaining cutover, and no merged replacement was established.
Final-effect source validation: The writer compares physical database identity, selected session fields, membership, and transcript version before granting the transaction. Host candidate validation translates source refusal through the captured owner and rejects it before commit; conditional no-op and target-conflict precedence remain intact.
Findings None None.
Security None None.

How this fits together

Session lifecycle persistence records agent starts, terminal outcomes, and recovery state in agent databases. Gateway requests and agent events feed this subsystem, which publishes committed session state to downstream consumers.

flowchart TD
 A[Agent events and session requests] --> B[Prepare source facts]
 B --> C[Check live authority and store identity]
 C --> D{Same physical store?}
 D -->|Yes| E[Existing writer worker]
 D -->|No| F[Native compatibility transaction]
 E --> G[Publish committed session state]
 F --> G
 G --> H[Join accepted writes before shutdown]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +1097, Tests +968, Docs +12, Other +1. Total +2078 across 53 files.

View PR surface stats
Area Files Added Removed Net
Source 37 1567 470 +1097
Tests 14 1126 158 +968
Docs 1 15 3 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 53 2709 631 +2078

Review metrics

Metric Value Why it matters
Production and regression growth production +1,097 net; tests/support +968 net The body explains production growth through prepared source authority, worker predicates, and preserved synchronous contracts.
Measured warmed native patch work 420 → 0 main-thread statements across ten turns The recorded production workload demonstrates the intended SQL-placement improvement without claiming a latency gain.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/session-lifecycle-state.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep same-store lifecycle SQL with the existing writer, retain live final-commit authorization, and preserve the released synchronous compatibility boundaries.

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

Not applicable as a bug reproduction: current-main source establishes the native lifecycle route, and the recorded production workload measures the changed SQL placement.

Is this the best way to solve the issue?

Yes. Reusing the existing writer and read workers preserves one ownership chain, while explicit native routing protects released synchronous and cross-store contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime performance and ownership improvement with no demonstrated urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The recorded production Gateway workload exercises lifecycle persistence through the real workers and SQLite, observes zero warmed native patch statements, and completes shutdown. Source-revocation regressions and the recorded Talk worker probes cover denied effects; the published-driver update preserves durable session data. Later integration qualification is separately recorded, and no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded production Gateway workload exercises lifecycle persistence through the real workers and SQLite, observes zero warmed native patch statements, and completes shutdown. Source-revocation regressions and the recorded Talk worker probes cover denied effects; the published-driver update preserves durable session data. Later integration qualification is separately recorded, and no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the explicit b02eab1..8ca43aa introduced delta. Raw head parents match the supplied original-head records; the checkout remained clean. The supplied test merge was not used to attribute removals or regressions. (8ca43aa37bfb)
  • Still necessary on current main: Fetched main still passes assertCommitAllowed into lifecycle patching; the accessor excludes that option from its worker route. The merged lifecycle and transcript-reader predecessors do not implement this remaining cutover, and no merged replacement was established. (src/gateway/session-lifecycle-state.ts:523, d4ce3b2f33d4)
  • Final-effect source validation: The writer compares physical database identity, selected session fields, membership, and transcript version before granting the transaction. Host candidate validation translates source refusal through the captured owner and rejects it before commit; conditional no-op and target-conflict precedence remain intact. (src/config/sessions/session-entry-patch.worker.ts:49, 8ca43aa37bfb)
  • Talk-policy disposition: Prepared existing targets still reach authorizeSessionAgentRun using committed policy, which calls authorizeGatewaySessionCreation. Missing targets lack the prepared storage route. The matching full PR body records two real-worker probes rejecting permission revocation during preparation and absent targets, supporting the rejection of the historical Talk-policy concern. (src/gateway/session-sharing.ts:535, 8ca43aa37bfb)
  • Captured proof identity and production behavior: Read the complete GitHub body and verified SHA-256 25980e50a7b108d5d024a62ec3dd9c0bb21441be87b10145d8092b81fddbf68b and 19,579 UTF-16 units against the supplied snapshot. Its Node 24.21.0 production workload completed thirteen turns, child work, cron, compaction, and shutdown; the measured warmed native patch cohort fell from 420 statements to zero. These measurements belong to e023d08, with later integration qualification recorded separately. (e023d086bd5d)
  • Previous timeout blocker resolved by applicable policy: The complete body records five tested-merge and five tested-main full-file npm-pack runs, all 230 cases passing, while preserving the original x64/Node 24.19 timeout as unattributed and acknowledging the ARM64/Node 24.21 comparison limitation. The test-failure policy permits continuing after a reasonable bounded investigation with the original failure and uncertainty recorded; it explicitly forbids making that unresolved failure alone an extra approval blocker. (.agents/skills/openclaw-testing/SKILL.md:123, 8ca43aa37bfb)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • chelsealong: 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-04T23:47:19.426Z sha e023d08 :: blocked before merge. :: none
  • reviewed 2026-10-05T00:02:45.584Z sha 4fe2fc4 :: blocked before merge. :: none
  • reviewed 2026-10-05T00:59:49.309Z sha 5d5593c :: blocked before merge. :: none
  • reviewed 2026-10-05T01:27:45.097Z sha 5d5593c :: blocked before merge. :: none
  • reviewed 2026-10-05T02:06:45.110Z sha 5d5593c :: blocked before merge. :: none

Resolve the additive session transcript worker type import conflict by retaining both imports. Preserve the native cross-store SDK boundary and same-store worker cutover.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Integrated main with a merge commit, retaining both imports in the known additive conflict. The integrated candidate passed 89 focused tests including lifecycle source refusal, native cross-store routing, startup/restart recovery, and the four required import-closure checks; fresh P2 autoreview is clean. The published 2026.9.8 driver update cell and released SDK audit remain documented in the PR body. No schema or stored-data format changed.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Assert forwarded authority and owned persistence settlement instead of callback or promise identity. Pin the restart fixture's shared-state root before creating its agent owner, and seed list metadata without scheduling competing maintenance. Preserve all behavioral assertions and existing deadlines.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 5d5593c repairs six CI fixtures without production changes. Callback and promise identity assumptions are replaced by live-authority and pending/settled behavior, recovery state is pinned before owner creation, and initial list metadata no longer schedules competing maintenance. Focused repaired behavior, check-changed, and fresh P2 autoreview passed. Full remote comparisons remain explicit pre-merge conditions in the body; no schema or stored-format change is introduced.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Integrate the landed declaration-fixture dependency fix in #165221 without rebasing. Scoped integration proof passed 75 tests. The review's Talk-policy concern was rejected after source inspection and two real worker-authority probes confirmed current-policy revocation and fail-closed missing targets; no additional production change was needed.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 8ca43aa merges the now-landed declaration-fixture fix from main without conflicts. All required original/base comparisons and repaired full-file proofs are complete. New integration proof passed 75 tests, including the former declaration failure. The latest P2 Talk-policy concern was checked against its actual owner and disproved with two real-worker probes; disposition and full evidence are in the body. No additional authored production changes. Fresh CI is attached to this head.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 48c022a into main Oct 5, 2026
169 checks passed
@steipete
steipete deleted the dbasync/nativepatchtail branch October 5, 2026 03:05
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…hrough the writer (openclaw#165193)

* perf(sessions): route remaining native lifecycle patches through the writer

* test(sessions): align lifecycle fixtures with worker ownership

Assert forwarded authority and owned persistence settlement instead of callback or promise identity. Pin the restart fixture's shared-state root before creating its agent owner, and seed list metadata without scheduling competing maintenance. Preserve all behavioral assertions and existing deadlines.
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed 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