Skip to content

refactor(sessions): run turn append+entry operations in the agent executor (compound 1a) - #163889

Merged
steipete merged 6 commits into
mainfrom
dbasync/compound1
Oct 3, 2026
Merged

steipete merged 6 commits into
mainfrom
dbasync/compound1

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Per-turn transcript append, pending-input consumption, entry updates, and Goal receipts still shared a Gateway-thread SQLite transaction. Moving only individual writes would split predicates from their writes and could publish custody before COMMIT.

Solution

Register typed turn preparation and commit kernels on the existing agent executor. Reuse S10's transfer, native COMMIT receipt, publication, and operation settlement. Authoritative entry/Goal/idempotency/latest-assistant checks, ordered message appends, entry writes, and receipts execute together on the worker connection. Host preparation runs once; current authority remains host-owned; acknowledged custody and cursors install before observers; accepted postcommit work settles before physical FIFO ownership is released. Unknown outcomes block without replay or native fallback.

Initial Goal routing uses the existing lookup policy with transaction-local rows, including aliases and configured/default-store collisions. The host retains live configuration, creator, cancellation, and lifecycle checks. Media completion and fresh unstaged input retain their live guards through COMMIT admission. Native receipt replay also rechecks routing.

The existing worker error graph now reconstructs SessionGoalOperationError and SessionPendingInputCustodyError on the host. Goal refusals retain GOAL_OPERATION_REJECTED; custody refusals prevent message-injection fallback. Host admission failures retain their original error objects, and writer/cold rebound errors are constructed on the host from typed outcomes. The Goal constructor lives alongside its contract so the shared codec does not import session writers.

Impact

  • C1 only. C2 reset/reply-upsert work is preserved for a stacked follow-up. P4b's captureSettlement(checkedEntries) remains the reset/delete companion owner; turn publication uses S10's existing owner.
  • Production: +1,886 / −588 / net +1,298 (2,474 changed lines). No new worker service, schema, persistent cache, retention policy, durability semantics, or OPENCLAW_* names.
  • Released SDK surface rechecked against v2026.9.8: public prepareMessageAfterIdempotencyCheck and beforeFreshMessageCommit signatures and native transaction visibility are preserved. Audited bundled preparation is separate. No released signature changed, so no additional deprecation record is needed.
  • Update/Doctor paths are unchanged; the published-driver update cell is not required. The compiled-wrapper inventory includes the two error leaf modules newly loaded by its shared codec; the full wrapper suite passes.
  • Runtime transcript target selection now uses the existing admitted history reader, with storage environment captured before awaiting it. Follow-up host-read debt remains in postcommit heartbeat/internal-reply authority checks (src/infra/heartbeat-session-publication.ts:88, src/gateway/internal-source-reply-persistence.ts:81). The measurements below cover the compound operation and COMMIT grant, not all reads in a chat request.
  • refactor(sessions): unify in-memory turn, queue, and stop ownership #162433 draft will need to rebase over this; minimal hunks in commitBackgroundResultToSession. Additional same-file overlap with fix(gateway): keep chat admission bound to current session authority #156941 concerns other admission/lookup functions; fix(media): avoid false failures for queued generation results #154064 and fix(agents): don't fail media completion when wake deadline expires with pending handoff #152114 concern media wake handling. These hunks stay limited to the turn predicate and live completion guard.

Evidence

Runtime host-SQL negative controls and candidate measurements:

Boundary Before → after
Pending-input append plus entry touch 146 → 0
Real initial-Goal COMMIT admission 4 → 0

The compound suite covers acknowledged COMMIT with lost ordinary reply, definite rollback, revocation at COMMIT, concurrent append FIFO and completion joining, commit-only custody/cursor publication, consumed-input replay, latest-assistant predicates, Goal intent identity, captured state roots, native routing replay, and fresh-input versus replay authority. Media retention adds real revocation at its worker COMMIT grant. Negative controls fail when the corresponding live guards are removed.

Fixture repairs use actual receipt-capacity failure and explicit expiry instead of schema-invalid triggers and parent-only clocks. Cold-storage refusal is observed at its actual worker admission boundary. Existing transcript/state/custody assertions remain intact; the Goal preflight read/byte bound is tighter.

Original-head validation at 4e7ae88c (retained evidence; focused invocations use pnpm test ... --maxWorkers=1):

  • C1 + Goal operations + shared error transport after identity repair: 85 passed, 135.65s wall. Both identity regressions failed before registration (Goal: 77.92s; custody: 37.67s). Local Vitest duration: 126.02s across the two routed test groups; CI timing is not yet available.
  • Earlier C1 + Goal operations + SDK guarded callbacks + media retention: 46 passed, 265.40s wall; unchanged SDK and media behavior remains covered.
  • User-turn persistence + C1 after the result-type cleanup: 55 passed, 139.77s wall.
  • Reset boundary/progress siblings: 10 passed, 75.44s wall.
  • Gateway routing/work admission: 30 passed; heartbeat: 20 passed; initialization/cold-storage siblings passed in the broader turn run. That run's obsolete host-read fixture assertion was corrected and verified by the green Goal run above.
  • Existing S10 transport: 10 passed (553.92s combined focused invocation); CLI/ACP, background result, and internal reply siblings passed.
  • Full wrapper suite: 17 passed, 80.84s wall. Gateway setup/build: passed (137s build phases).
  • Full check-changed: passed, 1,189.04s wall. Madge: 0 cycles (23.04s). Database-worker ratchet: passed against 59c4f37a8f95cbf194436f77477209b48876afd3; no static T1 growth (11.33s).
  • Fresh Codex review through P2 with that pinned base: completed. One finding about an opaque public beforeMessageWrite callback was rejected after the released-SDK and runtime-caller audit: the cited assistant option is internal, the released SDK callbacks retain native execution, and state-dependent internal checks now remain live through grants. Audited hook preparation follows the approved C1 design. No accepted/actionable finding remains.

Landing repairs and current proof

The original-head CI run 37081275425 exposed worker-cutover defects. Preserve the original shouldAppend context instead of substituting the executor database path. Move runtime target selection to the existing history reader, capture storage routing before awaiting it, and retain the physical source through host validation. A real file-replacement regression failed in both target modes before the physical-source repair.

An acknowledgment callback can throw after native COMMIT while scheduling reconciliation. The committed entry publication must still settle before the error propagates. Its regression confirmed that the entry and message were durable while readers remained blocked; the fix releases publication custody, emits identity/completion once, and preserves the original error.

Existing fixtures now inject abort faults on the writing worker connection, propagate the thinking test clock to workers, bound CLI timestamps around the actual operation, mutate revision through the canonical writer, pause identity races at the selected-row barrier, register preview observers before seeding, and drain seeding's idle executor before checking reclamation. Persistence, refusal, cancellation, and turn-flow assertions remain intact. No added sleeps, retries, production test hooks, environment names, or dependencies.

Repairs are committed in d17a7c2819b748b1892856f743dfcc9ad0e26430. Merge commit f0c139d3cc9230c9ea4385f090f348cdd55673bd incorporates main 7924cf37a22795de1ecf90c10dc8b275ae3bdb06, including these inspected upstream fixes: sandbox broker routing (0eef5790), publication fixture retirement (f419f3c1), Doctor auth-profile fixture retirement (68f76fc9), retired Doctor preflight config (23bc4d7b), and cached-handle/label-owner fixture eviction (3c397d0021ad4, #163605). The only conflict was resolved with main's complete cached-handle test file; its turn repair is equivalent and its label-owner repair fixes the separately observed baseline hang.

Current local proof:

  • Full candidate Codex review through P2 against integrated main: clean. The earlier physical-source and publication findings are fixed. The proposed Goal error-code finding was rejected: the complete encoder supplies both code and goalCode; all seven wire round-trips and mismatch rejection passed.
  • node scripts/check-changed.mjs --staged --base 7924cf37a22795de1ecf90c10dc8b275ae3bdb06: passed, 1,192.25s wall. All core production/test type graphs, lint, dead-export scans, storage and compatibility guards passed; 0 runtime import cycles, 477/477 existing environment names. Commit hooks preserved the reviewed tree.
  • Compound/Goal/cached-handle plus abort-save group on the integrated tree: 58 passed, 214.90s wall. Includes real COMMIT authority, zero host session SQL, lost replies, atomic custody and receipt behavior.
  • Entry publication owner after its repair: 11 passed, 173.00s wall, 25.529s summed cases; the new regression costs 2.436s.
  • Identity and configured-store SDK siblings after physical-source repair: 19 passed, 196.51s combined wall (13 identity tests / 118.34s Vitest; 6 SDK tests / 63.39s Vitest). The two replacement regressions alone passed in 72.70s wall after failing before the fix.
  • Missing-store/memory-only mirror cases: 2 passed, 49.60s wall; 69 unrelated cases intentionally excluded. SDK guarded native callbacks: 3 passed, 263.96s wall.
  • Repaired Gateway thinking/reclamation group and abort siblings: 48 passed. Preview full file: 7 passed, 46.97s wall. Focused CLI clock case: 1 passed, 72.17s wall; 77 unrelated cases excluded.
  • Compiled PR-wrapper inventory on the integrated tree: 1 passed, 14.91s wall; 16 other wrapper cases excluded. The extracted wire-types module has no runtime dependency.

Commit 6a17ccb744cda059711a0a694c4e7fd8ab5495c6 repairs two further fixtures exposed by the worker awaits. The directive fixture now creates and observes its rejecting promise during dispatch through the required transcript recorder. Private-completion faults use TEMP triggers on their actual native writer, preserving the canonical durable schema and every SQLite abort, retry, and continuation assertion.

  • Directive attribution: 5/5 head failures with an unhandled rejection versus 5/5 clean baseline runs, despite all 131 assertions passing on both; comparisons used Node 26.10.0. Repaired full file: 131 passed, 151.45s wall. Required-recorder assertion: focused case 1 passed, 49.89s wall (130 excluded).
  • Private completion: original head 4/5 failed, baseline 5/5 passed 23 cases, repaired head 5/5 passed 23 cases. The exact original CI merge with this repair and its original five-file selection passed 27 cases, 169.50s wall.
  • Scoped changed checks against f0c139d3cc9230c9ea4385f090f348cdd55673bd: passed, 342.66s wall, including the selected Gateway type graphs, lint, guards, and dead-export scans. Fresh Codex review through P2 is clean. This commit changes only the two fixtures (+9/−9); production is unchanged.

CI run 37091786486 completed on f0c139d3cc9230c9ea4385f090f348cdd55673bd with those two fixture failures and one independently inherited parent-recovery failure. The latter is defers a yielded parent only while its continuation remains owned: settled batch in subagent-parent-recovery.restart-integration.test.ts: its shared fixture omits the required chatAbortControllers, reached by cleanup introduced on main in fdbf48d1383bf (#163558). Five singly run PR-head comparisons and five main-base comparisons all reproduce that case alone (13 cases pass); scheduled main run 37091047803 repeats the identical subagent-registry-execution-cleanup.ts:55 stack. These comparisons used Node 24.21.0. The failing fixture and cleanup inputs are unchanged by this PR. The inherited-red admin route is explicitly authorized if the next exact-head attempt has only independently qualified inherited failures.

Merge commit 6bb3ac7005f8fa502383b4a07bfa4976a1b973f5 incorporates main 9d876b7d6cb7198b2f465bd6529eba77446bef0e for a real conflict introduced by main's transcript-turn helper inlining. The resolution keeps predicateSkipped and main's inline append count; main's worker history routing is preserved. The PR remains 60 files with the same production footprint.

  • Merged compound/Goal/physical-identity suite: 43 passed, 181.42s wall, Node 24.21.0, including final-COMMIT authority revocation and fresh/replay input semantics.
  • Compiled-wrapper inventory: 1 passed, 11.67s wall (16 unrelated cases excluded).
  • Scoped changed checks for the resolved turn accessor, combined worker entry point, and wrapper inventory against that pinned main: passed, 914.31s wall. Production and all core test type graphs, lint, guards, and three dead-export scans passed; zero runtime cycles and 477/477 existing environment names. Commit hooks preserved the reviewed tree.
  • Fresh P2 review completed. Two findings were rejected after inspecting the unchanged owners omitted from its bundle: session-accessor.sqlite-replacement-worker.ts:121-139 invokes the supplied authority check before every transaction/COMMIT grant; session-accessor.sqlite-transcript-message-append.ts uses configuration for the host-prepared redaction, while ensureTranscriptHeader accepts the preserved cwd and has no configuration/lock lookup. The COMMIT-revocation regressions above pass. No accepted/actionable finding remains.
  • Released SDK signatures and native callback visibility were personally rechecked against v2026.9.8; no compatibility record is needed.

ClawSweeper completed 6bb3ac7005f8fa502383b4a07bfa4976a1b973f5 at 2026-10-03T04:20:12.956Z (review run), with no correctness/security finding and no before-merge item. It independently inspected the live-authority admission owner and confirmed the conflict is resolved.

Prior prepared-head CI run 37095941989, attempt 1 completed with 102 successful jobs, 20 skipped jobs, no cancellations, and two failures: checks-node-changed-compact-small-8 (job 111125943101) and its downstream openclaw/ci-gate (111127428903). security-fast passed. The tested merge is b8bda2e88213236a2f766b3524880d39ecfb9ec1, with ordered parents main cdfe6cf00705aa2f59dbbe8040d333cd7d597984 and this exact PR head. Its tree matches a fresh Git merge of those parents. The prior parent-recovery fixture defect is fixed in that main parent; the repaired Gateway fixture failures did not recur.

The sole root failure is independently inherited: session-accessor.sqlite-byte-size.test.ts → sizes active context without reading transcript overflow payloads. Main 346b89d81d8c3 (#163990) combined header discovery and byte sizing into one SELECT; the byte-size test now inspects an existing JSON header-navigation read whose opcode lacks the byte-length-only flag. This is a query/test contract mismatch; the assertion does not establish newly introduced overflow I/O. This PR changes neither the test nor its active-context, payload, or read-byte owners. Their blobs are identical on the PR head, merge base, actual CI main/merge, and independently failing scheduled main run 37094503398, attempt 1, job 111121626866.

Five PR-head and five merge-base full-file runs on Node 24.21.0 each reproduce only that failure, with 19 other cases passing. Head wall times: 76.65, 36.95, 40.94, 27.86, 27.20 seconds; baseline: 75.82, 36.57, 41.23, 27.87, 27.22 seconds. The fixture has no expected session ID or persisted entry and uses individual transcript appends, so it never enters the compound guarded owner. No later fix was found through inspected main d5c4c19fe1863. Both failed CI logs were fetched once; no CI rerun was requested.

The operator explicitly authorized native admin landing past independently proven pre-existing main failures in untouched files. Complete version-1 evidence binds this exact failed attempt, tested merge, unchanged source blobs, independent main and ten local replays, both failed jobs, and the passing scoped checks above. Hosted CI remains failed, and the 20 skipped jobs remain skipped; this qualification does not relabel either as passing.

Latest main integration

Published head 83821f0fe1ad3a434f077ac867b0fc2159ab69df merges main 9e34368e594b358692f552624d4879f316ab3ddc after #163960 introduced a real import/options-type conflict. The resolution retains the exact reviewed compound accessor and its shared SqliteSessionTurnOptions owner. Main's assistant-text cleanup remains intact. This changes the diff's comparison baseline, not the authored compound implementation.

  • Production types: passed, 17.09s; targeted lint: passed, 14.57s; formatting and diff checks pass.
  • Compound/Goal suite: 30 passed, 127.91s wall. Assistant-text cases affected by main's cleanup: 3 passed, 82.97s wall (45 excluded). Compiled-wrapper inventory: 1 passed, 9.82s wall (16 excluded).
  • Fresh P2 review completed; no accepted/actionable findings remain after source verification. Goal error encoding includes both identity and ordinary code fields. Prepared replays retain their reconstructed callback. The file executor's release contract catches native-close and diagnostic failures and retains cleanup with its owner; an independent source assessment confirms no supported post-COMMIT rejection path. No source repair was needed for these findings.

ClawSweeper completed this exact head at 2026-10-03T04:46:22.820Z (review run): no correctness/security findings and no before-merge item. Native prepare-run completed for 83821f0 in github_pending mode without claiming CI success.

Current CI run 37097343356, attempt 1 completed with 106 successful jobs, 20 skipped jobs, no cancellations, and only the same inherited byte-size root (111130040796, checks-node-changed-compact-large-7) plus downstream gate (111131478029). The failing runtime-config group passed its other 461 cases, and security-fast passed. Actual tested merge afb61098f0298d9933e159f69d5e1c2305e2cf21 has ordered parents main cf3aa7fbcc157db1af526aa95f01bce3183b8e46 and this head, with a tree identical to Git's merge of those parents.

All four qualified byte-size test/query/payload blobs are identical on this head, that CI main/merge, and the independently failing five-head/five-base and scheduled-main evidence above. That valid attribution is reused for unchanged inputs. Both failed logs for the new run were retrieved once, and no rerun was requested. Current native inherited-failure evidence binds the new run/head/merge and 22 hashed artifacts, with exhaustive job accounting and current passing scoped checks. Hosted CI remains failed; skipped coverage remains skipped. The operator's explicit inherited-red admin authority applies through the native verifier and its live security/review gates.

No rebase, dependency change, schema change, or new environment name was introduced.

Original CI attribution and remaining limits

The failed original attempt tested synthetic merge 322b1433ca2704ace5c232f45aebc39ec883247f, with main parent 9b67f5df4240abec26b3430f34a3e4194d9fea42. Five singly run original-head/base comparisons reproduced the abort, CLI-clock, participant-read, accessor-context/environment, transcript-revision, thinking-clock, preview-observer, and reclamation-lease failures only on the PR. The cached-handle target also failed five head runs and passed on the baseline; further baseline handle runs were superseded by main's explicit fix after a separate label-owner timeout. Doctor auth-profile failures reproduced on the old Linux baseline five times before their upstream fix.

Sandbox, cache identity, cleanup, and Talk each passed five head plus five baseline local runs. Cache and cleanup also passed their original CI selections on the exact tested merge (299 and 353 tests). Those two CI failures remain unexplained, not claimed fixed or inherited; local Node 24.21/macOS differs from CI Node 24.19/Linux. Talk's Linux-Bun evidence is separately one passing head run with no valid baseline replay after Testbox setup/queue failures. No old failing CI run was rerun merely to obtain green.

Independent main evidence establishes the same sandbox/Talk host-broker failures, four placement-evidence failures, publication-restart SQLITE_BUSY, and Doctor auth-profile maintenance refusal in unchanged inputs. Scheduled main reference: 37077835919. The named upstream fixes above are now incorporated; no corresponding placement/Talk fix was found in the inspected main history. Current-head classification and the explicitly authorized inherited-failure exception are documented above; older unexplained outcomes are not reused as current-head evidence.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 3, 2026
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 1:01 AM ET / 05:01 UTC (Revision 8).

ClawSweeper review

What this changes

Moves atomic conversation-message appends, pending-input consumption, session updates, and Goal receipts into the existing agent database worker while preserving released callback behavior.

Merge readiness

✅ Ready for maintainer review

The worker cutover remains useful and is not implemented on current main. No actionable correctness or security finding remains in the pinned diff; the recorded boundary proof supports the change.

Priority: P2
Reviewed head: 83821f0fe1ad3a434f077ac867b0fc2159ab69df

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent worker cutover with strong fault-boundary evidence and no remaining actionable finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Recorded after-fix runs exercise the production compound-turn coordinator through the real worker transport and SQLite owner, including final-COMMIT revocation with no durable message effect, rollback, lost replies, custody publication, and FIFO settlement. Inspected harness source supports those claims; existing stored contracts are unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Recorded after-fix runs exercise the production compound-turn coordinator through the real worker transport and SQLite owner, including final-COMMIT revocation with no durable message effect, rollback, lost replies, custody publication, and FIFO settlement. Inspected harness source supports those claims; existing stored contracts are unchanged.
Evidence reviewed 9 items Pinned introduction and continued necessity: Reviewed the introduced delta from 9e34368 to 83821f0. Fetched main still performs compound turns through its native transaction implementation and has no session-turn.ts worker coordinator. The host's stale test merge was not used to infer merge-result regressions.
Atomic worker ownership: The shared kernel rereads session identity, evaluates predicates, appends messages, updates the entry, and writes Goal receipts together. The worker uses the existing candidate transfer and native COMMIT receipt rather than introducing another persistence owner.
Final-effect authority checks: The existing admission owner authorizes the binding and invokes assertHeld before every transaction or COMMIT grant. The compound coordinator supplies current execution, caller, Goal, writer, and fresh-input guards; pending-input custody receives its additional host check.
Findings None None.
Security None None.

How this fits together

Session persistence turns admitted conversation inputs and agent results into durable transcript and session state. The Gateway retains live authority checks and publishes acknowledged results to observers after the worker commits.

flowchart TD
  A[Conversation inputs and results] --> B[Host preparation]
  B --> C[Existing agent executor]
  C --> D[Atomic transcript and session transaction]
  D --> E[Live commit authorization]
  E --> F[Native commit receipt]
  F --> G[Custody and observer publication]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1298, Tests +963, Docs +14, Other +2. Total +2277 across 60 files.

View PR surface stats
Area Files Added Removed Net
Source 40 1886 588 +1298
Tests 17 1121 158 +963
Docs 1 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 2 3 1 +2
Total 60 3024 747 +2277

Review metrics

Metric Value Why it matters
Production and test growth production net +1,298; tests net +963 Production growth is justified by typed compound kernels and their transport coordination while reusing the existing executor and publication owners.

Technical review

Best possible solution:

Keep compound persistence atomic in the existing executor, with live host grants, acknowledged publication, and the released native callback compatibility path.

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

Not applicable as a refactor; current-main source confirms the native compound transaction, and the recorded worker-boundary controls measure the intended cutover.

Is this the best way to solve the issue?

Yes. Reusing the existing executor, atomic kernel, commit receipt, and publication owner is a coherent path, with released opaque callbacks retaining their established transaction visibility.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful, bounded session-persistence ownership improvement without evidence of an 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): Recorded after-fix runs exercise the production compound-turn coordinator through the real worker transport and SQLite owner, including final-COMMIT revocation with no durable message effect, rollback, lost replies, custody publication, and FIFO settlement. Inspected harness source supports those claims; existing stored contracts are unchanged.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded after-fix runs exercise the production compound-turn coordinator through the real worker transport and SQLite owner, including final-COMMIT revocation with no durable message effect, rollback, lost replies, custody publication, and FIFO settlement. Inspected harness source supports those claims; existing stored contracts are unchanged.

Evidence

What I checked:

  • Pinned introduction and continued necessity: Reviewed the introduced delta from 9e34368 to 83821f0. Fetched main still performs compound turns through its native transaction implementation and has no session-turn.ts worker coordinator. The host's stale test merge was not used to infer merge-result regressions. (src/config/sessions/session-accessor.sqlite-transcript-turn.ts:67, 7ff3b3be3713)
  • Atomic worker ownership: The shared kernel rereads session identity, evaluates predicates, appends messages, updates the entry, and writes Goal receipts together. The worker uses the existing candidate transfer and native COMMIT receipt rather than introducing another persistence owner. (src/config/sessions/session-turn.kernel.ts:99, 83821f0fe1ad)
  • Final-effect authority checks: The existing admission owner authorizes the binding and invokes assertHeld before every transaction or COMMIT grant. The compound coordinator supplies current execution, caller, Goal, writer, and fresh-input guards; pending-input custody receives its additional host check. (src/config/sessions/session-accessor.sqlite-replacement-worker.ts:129, 83821f0fe1ad)
  • Production-boundary fault proof: Inspected the real executor/SQLite harness: revocation at the final COMMIT grant leaves no transcript messages or consumed custody; lost ordinary replies recover the acknowledged commit once; concurrent completion retains physical FIFO. The captured body reports current-head compound/Goal validation passing 30 cases and retains negative controls for unchanged boundary inputs. These executions were contributor-provided evidence, not runs performed by this review. (src/config/sessions/session-compound-worker.test.ts:223, 83821f0fe1ad)
  • Complete captured discussion evidence: Recovered and inspected the complete 21,903-unit PR body through the read-only GitHub API. Its SHA-256 exactly matched captured sourceBodySha256 5584799822b09515eec4b18eea10ba522cb5d072ddbdfc54a1507ffd658eb813, resolving the prompt's omitted ranges. Human comments request re-review; the structured previous review reports no remaining findings at this same head. (83821f0fe1ad)
  • Released callback compatibility: Read v2026.9.8 source through GitHub: the public transcript options already expose prepareMessageAfterIdempotencyCheck and beforeFreshMessageCommit. The strict SDK append still forwards its opaque preparer through the original field; the proposed dispatcher preserves native execution whenever those released callback fields are present. No SDK entrypoint, schema, stored format, or migration is introduced. (src/plugin-sdk/session-transcript-runtime.ts:488, fc23bc864e45)

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 (7 earlier review cycles)
  • reviewed 2026-10-03T00:24:19.446Z sha 4e7ae88 :: blocked before merge. :: [P2] Preserve the caller's storage locator in append callbacks | [P2] Move the abort-append fault to the worker boundary
  • reviewed 2026-10-03T03:07:20.804Z sha f0c139d :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T03:27:32.617Z sha f0c139d :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T03:56:50.032Z sha 6a17ccb :: needs changes before merge. :: none
  • reviewed 2026-10-03T04:20:12.956Z sha 6bb3ac7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T04:35:48.962Z sha 6bb3ac7 :: needs changes before merge. :: none
  • reviewed 2026-10-03T04:46:22.820Z sha 83821f0 :: needs maintainer review before merge. :: none

Preserve the caller's append predicate context and select runtime targets
through the existing admitted history reader. Carry the physical source
through host validation so replaced databases cannot return stale targets.

Settle acknowledged entry publication when reconciliation scheduling throws,
while preserving the original error, committed custody, and FIFO ordering.
Adapt existing fixtures to worker connections, clocks, and explicit handoff
barriers without weakening persistence or refusal assertions.

Validation: clean P2 repair review; production and selected test typechecks;
11 publication, 13 identity, 6 configured-store SDK, and 2 missing-store
tests pass. Both new regressions fail before their fixes. Earlier focused
turn, Goal, abort, preview, reclamation, and SDK callback proof is retained.
Integrate sandbox broker routing, publication and Doctor fixture retirement,
and the retired Doctor config fixture fixes. Resolve the cached-handle test
conflict with main's equivalent turn fix and label-owner close repair.

Validation: full candidate P2 review is clean; check-changed against the
merged main parent passes; 58 turn/Goal/abort/handle tests and the compiled
PR-wrapper inventory pass. The reviewed merge tree is unchanged.
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 3, 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
Create the rejected runtime-persistence promise only after dispatch owns
the recorder, then settle it through the existing persistence contract.
Keep private receipt and admission faults on their native connection with
TEMP triggers so worker admission sees the canonical durable schema.

Preserve all turn, SQLite-failure, retry, and continuation assertions.
Five head/base comparisons establish each regression. The repaired
directive file passes 131 cases, private completion passes five runs of
23 cases, and the original five-file CI selection passes all 27 cases.
Scoped changed checks and fresh P2 review pass; production is unchanged.
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Merge main 9d876b7 to resolve the
transcript-turn return-object conflict. Preserve predicateSkipped while
adopting main's inline append count and retaining its worker history routing.

The merged compound, Goal, and physical-identity suite passes all 43 cases;
compiled-wrapper inventory passes. Fresh P2 review was completed; both
findings were rejected against the existing admission and redaction owners:
the former checks live authority before each grant, and transcript headers
consume the preserved cwd rather than configuration.
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Resolve the real conflict with main 9e34368
by retaining the reviewed shared SqliteSessionTurnOptions owner and the exact
compound-turn accessor implementation. Preserve main's assistant-text cleanup.

Production types, targeted lint, formatting and diff checks pass. The compound
and Goal suite passes 30 cases; three assistant-text cases and compiled-wrapper
inventory pass. Earlier physical identity, fixture and storage guard proof
remains valid for unchanged inputs.
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit ca77256 into main Oct 3, 2026
192 of 197 checks passed
@steipete
steipete deleted the dbasync/compound1 branch October 3, 2026 05:05
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…cutor (compound 1a) (openclaw#163889)

* refactor(sessions): run turn append+entry operations in the agent executor (compound 1a)

* fix(sessions): preserve worker turn identity and publication

Preserve the caller's append predicate context and select runtime targets
through the existing admitted history reader. Carry the physical source
through host validation so replaced databases cannot return stale targets.

Settle acknowledged entry publication when reconciliation scheduling throws,
while preserving the original error, committed custody, and FIFO ordering.
Adapt existing fixtures to worker connections, clocks, and explicit handoff
barriers without weakening persistence or refusal assertions.

Validation: clean P2 repair review; production and selected test typechecks;
11 publication, 13 identity, 6 configured-store SDK, and 2 missing-store
tests pass. Both new regressions fail before their fixes. Earlier focused
turn, Goal, abort, preview, reclamation, and SDK callback proof is retained.

* test(gateway): align persistence faults with their owners

Create the rejected runtime-persistence promise only after dispatch owns
the recorder, then settle it through the existing persistence contract.
Keep private receipt and admission faults on their native connection with
TEMP triggers so worker admission sees the canonical durable schema.

Preserve all turn, SQLite-failure, retry, and continuation assertions.
Five head/base comparisons establish each regression. The repaired
directive file passes 131 cases, private completion passes five runs of
23 cases, and the original five-file CI selection passes all 27 cases.
Scoped changed checks and fresh P2 review pass; production is unchanged.
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 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