Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: blocked before merge. Reviewed September 28, 2026, 1:22 PM ET / 17:22 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch removes redundant copying during cron-session maintenance and adjusts CI routing, test cleanup, diagnostics, and a Control UI startup fixture. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Current main still performs the extra session-store copy, and the submitted performance evidence supports the change. GitHub reports the exact head as conflicted, and the retained Control UI browser case still needs validation on an integrated head. Priority: P2 Review scores
Verification
How this fits togetherCron-session maintenance reads per-agent session entries through a SQLite worker, identifies expired runs, and either previews pruning or commits removals with lifecycle guards. Tests and CI fixtures exercise that path and adjacent Gateway, plugin, CLI, and Control UI behavior. flowchart LR
A[Cron maintenance request] --> B[SQLite worker read]
B --> C[Owned session entries]
C --> D{Preview or apply}
D --> E[Pruning summary]
D --> F[Guarded removal and archive]
F --> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource -15, Tests +24, Other +1. Total +10 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use the worker-owned entries for preview and apply pruning while preserving lifecycle commit guards and transcript archival; retain only fixture repairs that current main does not already provide. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source still clones the whole assembled store in both modes, and the PR records a focused before/after allocation path; this read-only review did not rerun it. Is this the best way to solve the issue? Yes. Consuming the worker-owned result removes the redundant copy within the existing maintenance owner while retaining the guarded removal path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20021ebe9b7a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
06f933b to
200e9c3
Compare
Refuse retained version-3 custody before inspecting mutable stored rows. Join parent-fork database writers before teardown and await successor admission before creating the heartbeat replacement. Reuse the active-Node fixture repair from 8b549de and the selected-tooling-owner assertion from 5362ba0. Existing assertions, storage validation, and test counts remain intact. Validated focused regressions, original shard replays, five type graphs, and scoped lint on Blacksmith Testbox. Independent review found no actionable P0-P2 issues.
9368032 to
5e3eabf
Compare
Remove the early refusal added during CI repair. Main now carries fa90c83, which corrects the stale custody assertions to require the existing stored-row incompatibility diagnostic. Keep that owner and its assertions intact. All 24 custody cases and the upstream heartbeat admission regression pass on Blacksmith Testbox with exact source hashes verified. Independent review found no actionable P0-P2 findings.
Remove containing literal patterns already covered by shorter patterns from Git candidate filtering. Keep native per-term source facts and caches unchanged, and preserve embedded-newline pattern inputs. The same 2,116 candidates take 842 patterns instead of 2,897; a paired Testbox comparison measured 22.34 to 8.80 seconds. Disable independent file notifications only in the manually seeded approved-operation audit table. Managed reads, preflight, activation, and journal assertions remain real. Blacksmith Testbox passed 2,100 planner compatibility tests, all seven integration cases, all 81 config-RPC cases, targeted typechecks, lint, and source guards. Fresh independent review found no actionable P0-P2 issues.
Align session publication clocks, join requester retry I/O, and observe deferred recovery scheduling before advancing its owned timer. Seed progress liveness consistently and preserve CLI child output for the unreproduced timeout. Validated on Blacksmith Testbox tbx_01m3kyc5am7p24gxt5w0z7kqst: focused suites, original CI groups, five typegraphs, scoped lint and guards. Independent review found no actionable P0-P2 findings. Co-authored-by: Vincent Koc <[email protected]>
…ures Filter term-scoped source reads before import parsing while preserving full reads and leaving unmatched files uncached for later graph discovery. The planner case improved from 81.228 to 41.455 seconds in the same Testbox group. Remove the old substring reduction superseded by the native source reader. Observe heartbeat awareness inside the existing delivery-completion hook, preserving confirmation-before-completion ordering without a five-second fixture rendezvous. Blacksmith Testbox tbx_01m3m52bpax5v2b6pb9hjtaefc: regression rejected old reader, 2103 selector cases passed, eight heartbeat cases passed, original 114-case planner group passed, and scoped types/lint/guards passed. Independent P0-P2 review found no actionable issues.
Publish synthetic declaration readiness only after the fake AI builder succeeds and seed it for prebuilt fixtures. Keep existing build and reader assertions. Wait for startup issuance, canonical roster hydration, and enabled submission before testing UI behavior. Give the avatar fixture its explicit session URL. Record timeout ownership and RPC methods on native-client fixture failure; the intermittent stall was not reproduced and is not claimed fixed. Blacksmith Testbox tbx_01m3m9v0ajeryg9crzy1aw8ecz: original declaration failures reproduced; 250-case tooling group, 39-case file, 56-case native group, and 15-case file passed. Types, lint, guards, and independent P0-P2 review passed. Browser execution remains with ordinary hosted CI.
Pull request was closed
Recover the focused clock repair from f46483c (#160182), whose performance work was superseded while this validated fixture fix remained unmerged. Fake debounce timers and real publication budgets could deadlock the held-generation drain and cascade through the rest of the CI shard. Bind the fixture's performance clock to fake Date and restore it before the real-I/O case and at test completion. Production budgets and assertions stay unchanged. Validation: a finite CPU workload reproduces the original test/hook timeout on CI's pinned Bun and passes both churn variants after the repair. The normal owner/sibling suites pass 41 cases; the original CI selection passes 452 cases across 27 files. Complete changed checks and independent Codex P0-P2 review pass. Testbox proof: run 36476506157. Related: #160508, #160182 Co-authored-by: Vincent Koc <[email protected]>
Recover the focused clock repair from f46483c (openclaw#160182), whose performance work was superseded while this validated fixture fix remained unmerged. Fake debounce timers and real publication budgets could deadlock the held-generation drain and cascade through the rest of the CI shard. Bind the fixture's performance clock to fake Date and restore it before the real-I/O case and at test completion. Production budgets and assertions stay unchanged. Validation: a finite CPU workload reproduces the original test/hook timeout on CI's pinned Bun and passes both churn variants after the repair. The normal owner/sibling suites pass 41 cases; the original CI selection passes 452 cases across 27 files. Complete changed checks and independent Codex P0-P2 review pass. Testbox proof: run 36476506157. Related: openclaw#160508, openclaw#160182 Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Session-registry maintenance deep-copies every session entry on the Gateway thread after its worker read. A deployed allocation sample attributed 770 MB in 30 seconds to that callback. Worker transport already provides owned entries, so the second whole-store copy is unnecessary.
User Impact
Maintenance allocates less memory while preserving preview isolation, pruning, transcript archival, and live commit guards. No configuration, schema, retention, migration, or update behavior changes.
Why This Change Was Made
Consume the owned worker result directly and share pruning between preview and apply. This removes both whole-store
structuredClonecalls and 15 lines of application code. The generic worker reader already returned its result directly.CI investigation also produced bounded tooling/fixture repairs: retain Node's existing GC-test ownership for plugin retention tests; keep FaceTime's port claim until helper shutdown; join parent-fork writers before teardown; coordinate fake clocks with real worker I/O; and wait for UI startup before assertions. The CLI broadcast and concurrent native-client stalls remain unexplained; their fixtures gain failure diagnostics without changing deadlines or assertions.
The change reuses existing fixtures and table-driven coverage without adding production test seams, persistent caches, or configuration options.
Evidence
The allocation fixture used 150 entries with an 8 KiB saved prompt each, 20 warmed calls per mode through
runSessionRegistryMaintenanceForStore, a 4 KiB sampling interval, and both collected-object flags. Measurements include main-thread worker receipt and maintenance consumption.Profiled time was 5.06 → 4.01 ms/read for preview and 3.17 → 2.13 ms/read for apply. These used separate leases of the same class after a sync failure; timing is indicative. A same-process 500-entry consumer benchmark measured 2,756,118 → 366,678 bytes/read and 7.09 → 0.22 ms/read. Both preview/apply regression cases failed on the original clone and passed after removal.
All heavy execution used blacksmith-testbox, profile openclaw-check. No local suites, builds, or typechecks, and no production runtime changes/restarts. All thirteen task-owned leases are stopped. Final head
a376cd0172e561526a0f63693368ba9a510a47b5passed CI run 36456785996: 127 successful jobs, 21 intentional skips, zero failures or pending jobs.Testbox validation and CI repair evidence
The requester retry-clock repair follows @vincentkoc's #160407 (
88e3331026a1); its duplicate branch edit and the config-audit watcher edit were removed once byte-identical to main. The changes reuse existing fixtures and table-driven coverage without adding production test seams, persistent caches, or configuration options. The duplicate UI liveness fixture edit was removed afterd6aa710c5091landed on main with the same canonical seed and an additional deterministic delayed-describe check; the PR no longer changes that file. The recovery-admission fixture likewise follows main's9fe93a204e3b, which observes each failed write and bounds fake timer advancement; our duplicate repair was removed after that overlap became a conflict. Main also supplies the synthetic-build artifact model through #160532 (4902e4ae49a6) and the stronger delayed-startup/sidebar-peer probe in6b9da9dc0287; their equivalent branch edits were removed. Combining our earlier sidebar hydration wait with main's deliberately held startup would otherwise block that fixture. The same cutover applies to main's owner-keyboard probe (94cbd1335dfb). The measured source-reader optimization is now provided by #160517 (abb37032e7f7) and the related planner improvements in #160531; its duplicate implementation and regression were removed from this PR. Main'sd9569745764falso supplies the equivalent heartbeat completion-hook repair; its duplicate was removed after source comparison. Main'se256cbef8ae0supplies Send readiness for all companion commands and held-module cleanup (113 integrated E2E cases passed); the narrower branch edit was removed. Main's #160410 (93a13da9a036) supplies the complete typed sharing-evidence fixture for avatar rendering; the branch's unproven URL-only hypothesis was removed.During CI repair, the original Git-prefilter reduction was superseded by main's native multi-term reader. The subsequent matching-only repair below has also landed independently on main, so neither duplicate remains here. Profiling the actual CI merge then found 42,519 files parsed, including 40,398 that matched none of the requested terms; parsing consumed 29.2 seconds. Term-scoped reads now discard unmatched rows before import parsing and leave them uncached for later full-graph discovery. Default full reads are unchanged. In the original three-file group on the same Testbox, the previously timed-out planner case improved 81.228 → 41.455 seconds (49.0%); all 114 cases passed. The group's overall wall time was dominated by its unrelated process-report sibling and did not improve (149.47 → 153.67 seconds).
Baseline
tbx_01m3k5zbb5wshpateke7nf5fs5(run): allocation fixture passed; both copy regressions failed as intended.Candidate
tbx_01m3k6swh76hv0dvrbqt762nn4(run): allocation fixture and maintenance tests passed. Accessor, read-only accessor, entry-reader, registry, restart-recovery, and registry-lifecycle proof passed six files across three shards in 50.06 s.pnpm test src/config/sessions/session-registry-maintenance.test.ts --maxWorkers=1: six cases, 24.052 s wall including cold compilation, 3.925 s test bodies.node scripts/check-changed.mjspassed guards, formatting, types, and dead exports, then hit the inherited UI line cap already fixed by fix(ci): keep chat attachment controls within lint limit #160159 and incorporated into the branch.Retention/port diagnosis:
tbx_01m3kbxmsfb540e3pawc4dagwfandtbx_01m3kdb5g13f6f624cj2b7nf9g. The original Bun shard and direct-source probes reproduced retention failures despite full GC, producer-local cleanup, and 32 collections. All nine unchanged cases passed Node. Routing regression failed all three policy rows on old code. Temporary probes were removed.First CI repair
tbx_01m3kex9r0z619bp1vkwwpsen5(run):pnpm test test/scripts/ci-run-node-test-shard.test.ts --maxWorkers=1passed 179 cases / 4.632 s wall. Original group passed all 532 cases as nine Node + 523 Bun. FaceTime's 18 cases passed 20 standalone runs, and its original 31-file shard passed three times (459 passes, 48 existing skips each). Standalone FaceTime wall: 6.029 s cold, approximately 5.1–5.4 s warm. Matching types/lint passed.Second-pass diagnosis
tbx_01m3khbvzjnatywk0jk5h2fnnc(run): reproduced heartbeat admission and planner ownership mismatches. Mobile-pairing original shard passed 456 cases plus 20 focused repetitions; no timer attribution was established. Preflight shard passed 544 cases; its import timeout did not reproduce. Recovery-admission timeouts were observed and later investigated below.Fixture validation
tbx_01m3kpatnkkmta5arfhm3kzmka(run): source hashes verified. Focused custody/handoff/update proof passed 51 cases / 22.23 s. Parent-fork's 16 cases passed 20 times (22.254 s first wall, 14–27 s afterward); its original 56-file shard passed three times (657 passes, five existing skips). Original heartbeat and planner shards passed 95 and 131 cases. Five affected typegraphs and scoped lint passed. Single-filepnpm test <file> --maxWorkers=1: heartbeat 40 cases / 75.236 s, update authority 19 / 10.791 s, planner seven / 141.773 s.Actual conflict resolution used base
da51d9edccb3; range-diff proved the performance and first repair commits unchanged. Upstream heartbeat, active-Node, planner expectation, and custody diagnostic fixes were retained.tbx_01m3ksahndxsnpybxq7dhppfnw(run) passed all 22 maintenance/parent-fork cases. Updated custody assertions rejected a proposed early-return guard, which was removed.tbx_01m3ksv0qfszs0cxxzh9pxtmd6(run) then passed all 24 unchanged custody cases and the upstream heartbeat regression, with source hashes verified.Planner/config repair
tbx_01m3ktzh0erpmaar5fwx2nbep1(run): original config job's three groups passed before the fixture repair; that replay alone is not claimed as a fix. Profiling isolated Git's candidate prefilter, and the paired query comparison above proved identical candidates.node scripts/run-vitest.mjs test/scripts/ci-changed-node-test-plan.test.ts test/scripts/test-projects.test.tspassed 2,100 cases. Full planner integration passed seven cases / 210.32 s wall; its timed-out case took 44.399 s. Full config-RPC file passed 81 cases / 139.76 s. Matching types, lint, source guards, and script erasability passed. Whole-file times across leases are not controlled speed comparisons.Final fixtures
tbx_01m3kyc5am7p24gxt5w0z7kqst(run): original Gateway-methods group passed 542 cases across 28 files. A temporary bounded CPU workload reproduced the coalescing fixture's mixed-clock deadlock; the same workload passed after clock alignment and was removed. Full coalescing file passed 35 cases / 12.36 s wall on the final patch; six publication-owner cases, including deliberate 7 ms yielding, passed unchanged. Requester-wake passed all 18 cases (67.01 s test duration; 816.25 s wall including the required full runtime build). UI mock-data tests passed 54 cases without browser automation. Original CLI group passed five files / 40 cases; the previously timed-out broadcast case passed in 1.019 s. Recovery diagnostics proved that a delayed first write could miss the fixture's sole clock advance, and that cleanup advanced 30 minutes across live I/O. The corrected fixture observes deferred scheduling and advances only its owned repair timer. Full recovery file passed 11 cases / 31.52 s wall, its retry-owner sibling passed, and the original 32-file group passed 611 cases with seven existing skips (350.07 s test duration).Follow-up repair
tbx_01m3m52bpax5v2b6pb9hjtaefc(run): used a detached copy of the actual tested merge0fa6a101929aafter runner queueing. Original planner group passed 114 cases / 149.47 s wall; passing replay was not claimed as a fix. Phase timings attributed 59.4 of 67.6 seconds to exhaustive changed-file planning; reader profiling isolated the unnecessary parsing above. The extended native-reader regression failed on old code for the extra unmatched row. Original heartbeat group passed 303 cases / 418.90 s wall, with the two CI failures replaying at 4.361 / 4.120 s; CI had failed their five-second rendezvous. Moving the same observations into the existing post-confirmation/pre-completion hook preserves every outcome assertion without a timer. Candidate selector suites passed 2,103 cases / 496.91 s wall.pnpm test src/infra/heartbeat-runner.isolated-session-mirror.test.ts --maxWorkers=1passed eight cases / 72.67 s wall. Candidate original planner group passed all 114 cases / 153.67 s wall, with the previously timed-out case reduced to 41.455 s. All three affected typegraphs (scripts, root script tests, infra tests), scoped lint, line/assertion guards, and script erasability passed.pnpm test test/scripts/test-projects.test.ts --maxWorkers=1passed 1,778 cases / 84.68 s wall. The isolated merge checkout and temporary profiling files were removed before lease shutdown.Current fixture repair
tbx_01m3m9v0ajeryg9crzy1aw8ecz(run): used the exact CI merge1deb88a7cd67. The original four-file tooling group reproduced both synthetic build-state failures (248 passed, two failed). Main's declaration prerequisite correctly requested another build because the fake successful builder had created no artifacts. A fixture-owned marker now models only the manifest's exact declaration paths, preserving build counts and reader ordering. All seven preparation cases, eight prebuilt-owner cases, and the original 250-case group passed;pnpm test test/scripts/run-vitest-bounded.test.ts --maxWorkers=1passed 39 cases / 36.06 s wall. The UI corrections preserve assertions while waiting for startup issuance or enabled submission; the owner-facet hydration edit was subsequently superseded by main; the avatar fixture now uses its explicit session URL. UI E2E types and scoped lint passed; no browser automation was run. The original six-file native-client group with observation-only tracing passed 56 cases / 92.50 s wall, including the previously stalled case in 15.549 s. Its original cancellation cause remains unproven, so only failure diagnostics were added.pnpm test extensions/codex/src/app-server/run-attempt-thread-cleanup.test.ts --maxWorkers=1passed 15 cases / 91.01 s wall including cold compiler preparation. Root-tooling and extension-test typegraphs, scoped lint, formatting, line and assertion guards passed. Temporary diagnostic edits were removed.Fresh independent Codex review is scoped-clean at P0–P2 for the performance change and every retained repair. All five affected typegraphs, scoped core/UI lint, and source guards passed. The final clock-restoration edit passed its Gateway-methods typegraph and lint again.
pnpm test src/cli/help-exit.process.test.ts --maxWorkers=1passed 29 cases / 85.48 s wall (82.80 s Vitest duration, including worker-output preparation). All temporary profiling, CPU-load, and phase-marker source changes have been removed. Native sync failures required lease replacement; dependencies were installed once per missing installation withpnpm install --frozen-lockfile. Some successful commands had a subsequent runner-portal notification timeout; command results and cleanup were verified independently.Hosted failures: initial runs
36383928843and36394427021exposed the earlier fixture/tooling issues;36410783370was cancelled after direct proof rejected the custody guard. Run36412090209exposed config/planner failures and the mixed-clock cleanup cascade. Run36418675948exposed UI fixture liveness, requester fake-time/worker-I/O, CLI broadcast timeout, and recovery-admission failures. Headf46483cf52f0could not attach CI because its duplicate UI fixture change conflicted with the upstream fix; removing that duplicate resolves the overlap without rebasing. The resulting head received run36431230399: 128 jobs passed; the two substantive failures were the planner inventory deadline and heartbeat delivery-confirmation fixture deadlines, investigated and repaired above. The aggregate gate also failed. Run36440190003then exposed the synthetic declaration-state fixture, five UI fixture scenarios across four jobs, and an intermittent native-client cleanup timeout; one extension-package-boundary job was cancelled. Those findings and their proof limits are recorded above. No workflow reruns or proof-only pushes were used.The separate subagent-suppression predicate still reads a full entry: its current session/run/recovery authority requires extending the existing prepared-facts owner before that read can be removed safely. No post-deployment allocation profile is claimed. The CLI 100-second stall, the native-client concurrent-turn stall, and earlier nonreproduced mobile/preflight failures remain documented uncertainties. The retained cold-startup UI fixture passed normal hosted E2E on the final head; this task ran no browser automation. The sidebar and owner-keyboard fixtures follow upstream browser proof: six cases / 49.08 s wall and two files / 12 cases / 23.99 s wall respectively. The superseding upstream UI fixture commit records 11 E2E and 29 unit cases passing; this task used no browser automation.