Skip to content

perf(agents): read worktree publication and tool availability through the worktree reader - #164685

Merged
steipete merged 16 commits into
mainfrom
dbasync/wtlookup
Oct 4, 2026
Merged

steipete merged 16 commits into
mainfrom
dbasync/wtlookup

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Publication and tool-availability preparation synchronously query the worktree registry on the Gateway thread. The measured path performs five main-thread statements per warmed turn, including shared-state admission and ownership checks, even when no managed worktree exists.

Why This Change Was Made

Reuse the existing worktree reader and shared-state worker for owner lookup, preserving the query and row codec in one kernel. Capture the physical store and session lifecycle before yielding, carry the initial session facts, and refresh worktree selection after credential or repository preparation. Migrate ordinary shared/personal publication and executor preparation reads together. Recheck the selected publisher after the new await before recording a claim request.

Live transaction and Git-effect guards retain their current synchronous authority checks. Prepared lookup results never authorize an effect. No new worker service, policy cache, schema, retention, durability, or branch-identity change is introduced. Existing coordinator SDK method signatures and update behavior remain unchanged.

The prerequisite #164490 merged as c828f7ed1d560295f78166a98fb54687dc162b28. The branch includes main through a0a1f184a3867aa4dd3493a743e0c59a4ebfbecd, using merge commits. The main-relative diff remains this 18-file lane. Integration preserves #164706's separate template dispatcher, #164320's provisioned-snapshot fixture and asynchronous chunk reader, and #164779's worker-based initial session reads. The latter introduces an earlier await, so both availability and target discovery now capture the physical worktree store before session preparation and recheck its admission afterward. Live effect guards remain synchronous.

Overlap: #131582 covers publication branch naming; the small request/executor hunks preserve its branch-identity design space. #164779 shares availability preparation; its session-reader implementation is retained unchanged. The broader #162433 turn/queue/stop design and GC/allocation work remain untouched. Workload measurements below belong to original head 53c46a6fff7f5744c6f0630f23a711b64a00cca3, not a new latency benchmark.

User Impact

Worktree-attributed Gateway-thread SQL falls 5 → 0 per warmed turn, 50 → 0 across ten turns, and 86 → 0 across the full workload. All main-thread SQL is 344.1 → 338.3 per warmed turn and 9,498 → 9,405 overall. Across all threads/processes, the workload executes 37,935 → 38,348 statements, including worker admission and background work.

At the measured heads, the static inventory stayed T1 921 → 921 (T2 377, T3 272, W 971). The shared lookup kernel remains conservatively T1 because live guards and creation/placement callers still use its native path; no inventory reclassification claims that debt is gone.

Evidence

The unchanged sqlmeasure harness, observer, and analyzer ran locally with Node v24.21.0 and source-map builds, fresh synthetic state, a local streaming provider, and the normal loopback device challenge/pairing flow. Before: cfb80c638c72d82371e65ffad61a2e7acd6b238d (main plus the two prerequisites). After: 53c46a6fff7f5744c6f0630f23a711b64a00cca3. Both completed all 13 parent turns, the child turn, a successful cron run, committed compaction, and clean shutdown. Counts exclude statement preparation.

Warmed turn Worktree main before → after All main before → after
1 5 → 0 338 → 332
2 5 → 0 338 → 334
3 5 → 0 336 → 332
4 5 → 0 338 → 330
5 5 → 0 338 → 339
6 5 → 0 336 → 330
7 5 → 0 347 → 390
8 5 → 0 394 → 332
9 5 → 0 336 → 332
10 5 → 0 340 → 332
Mean 5.0 → 0.0 344.1 → 338.3
Phase Worktree main before → after All main before → after Worker threads before → after Helpers before → after
Boot to ready 0 → 0 2,922 → 2,922 988 → 1,002 109 → 109
Connect / settling 0 → 0 41 → 46 317 → 354 0 → 0
First session + first turn 5 → 0 889 → 884 3,783 → 3,745 63 → 75
Ten warmed turns 50 → 0 3,441 → 3,383 13,019 → 13,368 232 → 224
Second session + parent tool turn + child 15 → 0 1,149 → 1,134 4,837 → 4,920 60 → 60
List / history / Inbox / dismiss 0 → 0 0 → 0 57 → 57 0 → 0
Scheduled cron tick 16 → 0 455 → 425 2,314 → 2,368 10 → 10
Manual compaction 0 → 0 340 → 203 657 → 586 20 → 20
Graceful shutdown 0 → 0 261 → 408 1,971 → 2,045 0 → 0
Total 86 → 0 9,498 → 9,405 27,943 → 28,445 494 → 498

Phase windows include concurrent maintenance. Memory cold setup shifted between compaction and shutdown (combined main-thread count 601 → 611), and the warmed outlier moved between turns; phase deltas are not independent patch effects. Instrumented workload wall time/RSS: 159.36 s / 2.53 GiB → 252.18 s / 2.36 GiB on the loaded host. These timings are not a latency benchmark.

Validation at the original measured head:

  • Boundary regression failed before the change for caller-thread SQL and state-root retargeting. All four final boundary cases pass: present/missing worktree, retirement during identity preparation, and captured physical store. Test execution total: 23.47 s; the real worker/database boundary is required for the SQL assertion.
  • Focused commands use pnpm test <files> --maxWorkers=1. Broader publication/worker-binding run: 149 existing cases passed in an 843.46 s command; the two new-suite failures were an incorrect Vitest thread-pool route, corrected to the existing database-worker pool. The subsequent run passed the four boundary cases and existing admission/binding cases (44 passes, 848.44 s command); a new revocation fixture initially failed to intercept the mocked reader and was corrected. Final targeted run: publisher revocation plus both registry-reader cases, 3 passed, 892.45 s including cold worker compilation/imports. Registry tests also cover latest-live selection, owner-kind filtering, and captured environment without host SQL. No test uses an added timer/sleep/poll.
  • SHARED-REGISTRY IMPORT RULE: runtime-process build graph plus all nine import-closure suites, 29 tests / 10 files passed, 433.87 s.
  • node scripts/check-changed.mjs --base cfb80c638c72d82371e65ffad61a2e7acd6b238d: passed, 3,701.57 s, including core and all selected test typechecks, dead exports, lint, and guards. Existing unrelated max-lines warnings remain; no ratchet growth or new environment names.
  • Madge: 0 cycles, 47.00 s. Database-worker ratchet against the pinned integration base: passed, 21.78 s; repeated by changed checks.
  • Released SDK comparison against v2026.9.8 with a real-path temporary directory: passed, 2,375.98 s, digest 39769e7e. The report includes main's existing changes since that release. The indirect GatewayRequestHandlerOptions.context.githubPublicationService contract was inspected; this lane preserves the coordinator method signatures.
  • Codex autoreview through P2, high reasoning/fast service, pinned Git merge base 58b544712d0349f85a06fda6a249f872012582a1: scoped-clean, no accepted actionable findings.

The first after-measurement attempt lost its WebSocket with code 1006 after one successful turn. The Gateway remained alive until harness cleanup. A diagnostic replay completed every phase with regular protocol pings, followed by the successful unchanged-harness run reported above. The original disconnect remains unexplained and is excluded from the comparison. An initial regression collection attempt also raced the setup build's generated namespace; serializing those phases resolved that tooling failure. Neither event is presented as a product fix. The wall times above include the heavily loaded host and cold compilation; current-head CI is recorded below.

Remaining host-read debt: the native lookup in src/gateway/github-publication-availability.ts:166 is retained for live transaction/Git-effect checks, with callers in github-publication.ts, github-publication-coordinator-methods.ts, github-publication-executor.ts, and github-personal-publication.ts. The service's creation and placement callers remain outside this lane. Session, publication-lifecycle, placement, and lease reads are separate owners.

Integration validation

Current head: bf604ea2b8c671023dad4646a8a338fe32afc0bd. Exact-head CI passed (run 37194419557: 60 jobs successful, 23 intentionally skipped). Dependency/security statuses briefly reported review incomplete before completing successfully; no failed CI job or rerun was involved. ClawSweeper completed trusted review of this head at 2026-10-04 10:13 UTC with no correctness/security findings and Before merge: None. Native landing is in progress. Prior-head CI 37191021566 at 53cd06d remains historical evidence.

The PR-caused CI failure at c9407ab was main's new first-party mock-export check. Commit 1b25053 added six explicit mock-isolation comments without changing executable tests, assertions or timeouts; CI then passed at 1b25053 and 53cd06d. The additional synthetic session-reader mock required by #164779 has its own isolation explanation. The current mock-export ratchet, targeted lint, formatting and whitespace checks pass.

The third merge's two new captured-store cases were first run with store capture deliberately left after session preparation: availability returned false and target discovery rejected the missing worktree in the retargeted store, while the four existing cases passed. Moving capture before the await repairs that integration defect. The corrected focused run passed all 47 cases across publication admission, worker binding and all six real worker-boundary cases: pnpm test src/gateway/github-publication-availability.worker.test.ts src/gateway/github-publication-admission.test.ts src/gateway/worker-environments/worker-github-binding.test.ts --maxWorkers=1, 394.92 seconds wall time on the loaded Mac (Node 26.10.0). Fresh P2 autoreview of the full main-relative candidate completed scoped-clean, with no accepted actionable findings.

Reusable earlier proof:

  • Availability/registry reader checks: six passes, 434.06 seconds including preparation.
  • Runtime-process build graph plus all nine import-closure suites: 29 tests across 10 files, 232.80 seconds. After the second main merge, registry reader, runtime graph and state/cron worker imports passed again: 19 tests across four files, 239.82 seconds. This third integration adds no shared-worker import or wrapper module.
  • The local released-SDK comparison against v2026.9.8 completed on 53cd06d in 1,451.32 seconds, digest 3eedc257ab6716b4065cf2cb910b8f5a2ddf5d92d75da5354dab6ccf0bf0b7a8. It includes main's accumulated SDK changes. The final integration changes internal preparation composition only; direct inspection reconfirmed unchanged released coordinator signatures reachable through GatewayRequestHandlerOptions.context.githubPublicationService, with no new or removed SDK export. The report is reused for that unchanged lane contract, not presented as a new whole-main compatibility report.

The broader Mac publication run recorded 170 passes and four failures in 1,827.01 seconds. Three failures stop at the unchanged fixture's initial git init, before publication behavior; its stderr-only error loses the exact termination cause. The real-reset case exceeded its existing 120-second timeout, with the stalled await unidentified. These remain investigated failures, not claimed fixes.

The isolated AWS comparison completed 20 of 20 complete file runs, five runs of each of github-personal-publication.test.ts and github-publication-boundaries.test.ts on both c9407ab34edf1a092f3a7a15e30bba5342864471 and main baseline 06d4475d6079aaa875a9b477ac0935d1459b1023, singly with --maxWorkers=1. All 860 cases passed on Linux/Node 24.21.0 in a 2,035.937-second command; the lease is released. That comparison did not reproduce or explain the Mac failures. The third merge changes initial publication session preparation and its fixture mocks, so this earlier comparison is not represented as exact-head integration coverage; the final focused tests and current-head CI provide that coverage separately.

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.
Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.
Integrate the pinned measurement baseline and retain main-key facts through the existing connection and reader-admission owners. Preserve raw writes, foreign commits, transaction snapshots, authorizers, and continuation authority.
Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.
Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.
Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.
Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.
Integrate the released-SDK diff tooling fix and the inherited child-coordination fixture correction. The merge preserves every authored source, test, and documentation blob; the wrapper inventory combines both branches.
…7aaf51b0f897b4e94dafe02184fee6e77e3f' into dbasync/wtlookup
Move publication preparation and per-turn tool availability through the existing worktree reader. Capture the physical store and session lifecycle before yielding, refresh availability facts, and preserve live effect guards and branch identity semantics.
@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 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 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Base automatically changed from dbasync/schemafacts to main October 4, 2026 07:37
Integrate schema-facts admission and current main before landing the publication lookup lane. Preserve main's separate template worker registry while retaining the owner lookup operation and type import.

The resulting main-relative diff is the original 18-file lane. Independent Codex P2 autoreview is scoped-clean. Focused integration proof is running; the prior exact-head CI run remains historical evidence.
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed scripts Repository scripts size: XL labels Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

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

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 6:31 AM ET / 10:31 UTC (Revision 6).

ClawSweeper review

What this changes

Move worktree lookups for GitHub publication preparation and agent tool availability into the existing database worker while preserving live execution guards.

Merge readiness

✅ Ready for maintainer review

The PR remains useful: current main and the latest release retain synchronous worktree preparation reads. The pinned patch has no actionable correctness or security findings.

Priority: P2
Reviewed head: bf604ea2b8c671023dad4646a8a338fe32afc0bd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused worker cutover with meaningful production measurements, lifecycle regressions, and successful exact-head validation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The isolated Gateway workload exercises publication/tool preparation through the production worktree reader and observes zero warmed main-thread worktree SQL after the change. Final-head worker-boundary results and successful exact-head CI supplement the earlier measured workload; no stored-data contract changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The isolated Gateway workload exercises publication/tool preparation through the production worktree reader and observes zero warmed main-thread worktree SQL after the change. Final-head worker-boundary results and successful exact-head CI supplement the earlier measured workload; no stored-data contract changes require migration proof.
Evidence reviewed 9 items Pinned introduced patch: Reviewed the merge-base-to-head delta from a0a1f18 to bf604ea. The native lookup delegates to the same kernel used by the added worker operation; selection predicates and row decoding are preserved.
Current-main necessity: Fetched main still calls managedWorktrees.findLiveByOwner synchronously during workspace preparation and availability refresh. The merged session-reader prerequisite moves a different read boundary and does not replace this work.
Latest-release check: The v2026.9.8 availability source contains the native managedWorktrees.findLiveByOwner lookup and does not contain readLiveRegistryWorktreeByOwner. This optimization is not already supplied by the latest release.
Findings None None.
Security None None.

How this fits together

The worktree registry connects agent sessions to their repository checkouts. Publication preparation uses those records to select available tools and GitHub publishing inputs, while execution separately checks current authority before writes.

flowchart TD
  A[Agent session] --> B[Capture store and lifecycle]
  B --> C[Worktree database worker]
  C --> D[Validate selected workspace]
  D --> E[Tool availability]
  D --> F[Live publication guards]
  F --> G[Git and GitHub effects]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +121, Tests +178, Docs +9. Total +308 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 11 165 44 +121
Tests 6 178 0 +178
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 352 44 +308

Review metrics

Metric Value Why it matters
Production and test growth production +121 lines; tests/support +177 lines Production growth implements captured asynchronous preparation and post-await validation; tests protect SQL placement and lifecycle boundaries.
Reported workload improvement worktree main-thread SQL: 5 → 0 per warmed turn The production workload demonstrates the intended thread-placement improvement without claiming lower latency.

Technical review

Best possible solution:

Keep preparation reads in the existing worktree worker, with one shared lookup kernel and live transaction and Git-effect authority checks.

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

Yes: current-main preparation reaches the native registry query, and the supplied paired Gateway workload measures that hotspot. This review inspected source and existing evidence without rerunning target code.

Is this the best way to solve the issue?

Yes: reusing the existing worker and lookup kernel is a focused solution, and final-effect guards remain with their current owners.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded internal performance 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 (live_output): The isolated Gateway workload exercises publication/tool preparation through the production worktree reader and observes zero warmed main-thread worktree SQL after the change. Final-head worker-boundary results and successful exact-head CI supplement the earlier measured workload; no stored-data contract changes require migration proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The isolated Gateway workload exercises publication/tool preparation through the production worktree reader and observes zero warmed main-thread worktree SQL after the change. Final-head worker-boundary results and successful exact-head CI supplement the earlier measured workload; no stored-data contract changes require migration proof.

Evidence

What I checked:

  • Pinned introduced patch: Reviewed the merge-base-to-head delta from a0a1f18 to bf604ea. The native lookup delegates to the same kernel used by the added worker operation; selection predicates and row decoding are preserved. (src/agents/worktrees/registry-read.kernel.ts:120, bf604ea2b8c6)
  • Current-main necessity: Fetched main still calls managedWorktrees.findLiveByOwner synchronously during workspace preparation and availability refresh. The merged session-reader prerequisite moves a different read boundary and does not replace this work. (src/gateway/github-publication-availability.ts:162, c190df12716a)
  • Latest-release check: The v2026.9.8 availability source contains the native managedWorktrees.findLiveByOwner lookup and does not contain readLiveRegistryWorktreeByOwner. This optimization is not already supplied by the latest release. (src/gateway/github-publication-availability.ts, fc23bc864e45)
  • Live authority remains authoritative: Claim admission rechecks requester, turn claim, and selected publisher after the new worker await, then retains synchronous stored-claim and workspace checks inside the write transaction. Executor push and pull-request creation retain live beforeRun guards; prepared worktree facts do not grant publication authority. (src/gateway/github-publication.ts:185, bf604ea2b8c6)
  • Captured production workload: The supplied body reports the normal isolated Gateway workload against cfb80c6 and measured candidate 53c46a6: all parent/child turns, cron, compaction, and shutdown completed, with worktree main-thread SQL falling from five to zero per warmed turn. Timings are expressly not a latency benchmark. REST retrieval matched captured body SHA-256 4602b352679c62051712423fcf828ef8fd68ceb194359906ef649d9d183ea5a4 and recovered its omitted ending; earlier workload and Linux comparisons are not represented as final-head measurements. (53c46a6fff7f)
  • Focused boundary coverage: The six worker-boundary cases protect present/missing worktrees, retirement during credential preparation, and physical-store capture across session and identity preparation. The admission regression rejects publisher revocation before a durable request or Git command. The body records 47 final integration passes; tests were inspected but not executed during this read-only review. (src/gateway/github-publication-availability.worker.test.ts:90, bf604ea2b8c6)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: 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-04T08:06:41.510Z sha c9407ab :: needs changes before merge. :: none
  • reviewed 2026-10-04T08:44:18.029Z sha 1b25053 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T09:14:14.506Z sha 53cd06d :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T09:37:31.444Z sha 53cd06d :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T10:13:44.501Z sha bf604ea :: needs maintainer review before merge. :: none

Keep the SQL boundary fixture isolated from session storage, managed-worktree services, configuration, and credential state. Document those boundaries for the new first-party mock-export check.

No executable test code, assertions, timeouts, or production behavior changes. The mock-export check, formatter, reader tests, and scoped P2 review pass.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Preserve main's provisioned-snapshot fixture and asynchronous chunk reader alongside the publication owner-lookup reader import. The main-relative authored production patch remains byte-for-byte identical across all eleven production files.

The affected registry reader, runtime build graph, and worker import checks pass. Fresh scoped P2 review is clean. CI passed on the prior head 1b25053 before this conflict repair.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 715c181 into main Oct 4, 2026
153 of 155 checks passed
@steipete
steipete deleted the dbasync/wtlookup branch October 4, 2026 10:44
@steipete

steipete commented Oct 4, 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
… the worktree reader (openclaw#164685)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(agents): read worktree publication lookups in worker

Move publication preparation and per-turn tool availability through the existing worktree reader. Capture the physical store and session lifecycle before yielding, refresh availability facts, and preserve live effect guards and branch identity semantics.

* test(gateway): document publication reader mock isolation

Keep the SQL boundary fixture isolated from session storage, managed-worktree services, configuration, and credential state. Document those boundaries for the new first-party mock-export check.

No executable test code, assertions, timeouts, or production behavior changes. The mock-export check, formatter, reader tests, and scoped P2 review pass.
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. size: M 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