Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 6:59 PM ET / 22:59 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch classifies config changes and scopes database topology publications so Gateway session lists retain unaffected rows; it also updates reload handling, tests, and logging documentation. Merge readiness✅ Ready for maintainer review Keep open. Current main still rebuilds session rows after broad config and store publications, while this PR has focused evidence of the improvement. I found no blocking defect introduced by the branch. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway builds session-list rows from runtime configuration and admitted SQLite stores. Committed changes tell that projection which facts to refresh before it serves lists and session events. flowchart LR
A[Config commits] --> C[Change classification]
B[Database admission] --> D[Topology publication]
C --> E[Session row projection]
D --> E
E --> F[Refresh affected facts]
F --> G[Session lists and events]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +94, Tests +198, Docs +3. Total +295 across 27 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep config classification with its publisher and physical-store reconciliation with the existing projection, preserving broad refresh for changes that affect session facts. Do we have a high-confidence way to reproduce the issue? Yes. Current main emits broad config changes and invalidates resident rows; the PR supplies a before/after Testbox fixture that measures the affected list path. Is this the best way to solve the issue? Yes. The branch classifies changes at the config publisher and lets the existing projection reconcile store generations, avoiding a competing cache or configuration setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1e7ec6a4f6b4. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Classify committed config changes at publication and reuse profile presentation for agent identity edits. Reconcile store topology through existing physical generations without invalidating unchanged rows, and retain notification store ownership across neutral reloads.
The priming callback can precede durable settlement and read receipt completion. Wait for the existing inbound drain before enabling fake timers so unrelated cleanup cannot enter the socket timeout timer assertions.
db8358b to
7f77535
Compare
Require zero conventional state-directory probes for every pinned and automatic list/search case. Process-wide syscall parity includes independent file work and can fail when automatic mode performs fewer calls.
Include runtime-session-changes.ts, imported by the already-extracted runtime-snapshot.ts since 945ec9f (#159155). Its runtime dependencies are already in the inventory. This restores trusted-anchor extraction and native PR source provisioning without expanding the wrapper entry points. Reproduced both closure failures and three macOS provisioning failures before the fix. Replayed the exact failing CI shard selections through ci-run-node-test-shard: 32 passed, one Linux-only case skipped on macOS. The code-mode Gateway evidence file passed all five tests; its logged harness_error is an intentional synthetic failure, not a broken test. Validation: check:import-cycles (zero cycles), scripts typecheck, changed-file guards and lint/format checks, and autoreview clean through P2.
…#159155) * perf(sessions): retain rows across unrelated config commits Classify committed config changes at publication and reuse profile presentation for agent identity edits. Reconcile store topology through existing physical generations without invalidating unchanged rows, and retain notification store ownership across neutral reloads. * test(whatsapp): drain inbound work before switching timeout clocks The priming callback can precede durable settlement and read receipt completion. Wait for the existing inbound drain before enabling fake timers so unrelated cleanup cannot enter the socket timeout timer assertions. * test(ui): omit the default widget handle type argument * test(sessions): expect scoped registry topology publications * test(gateway): scope session path probes to state discovery Require zero conventional state-directory probes for every pinned and automatic list/search case. Process-wide syscall parity includes independent file work and can fail when automatic mode performs fewer calls.
Include runtime-session-changes.ts, imported by the already-extracted runtime-snapshot.ts since 6cdfaec (openclaw#159155). Its runtime dependencies are already in the inventory. This restores trusted-anchor extraction and native PR source provisioning without expanding the wrapper entry points. Reproduced both closure failures and three macOS provisioning failures before the fix. Replayed the exact failing CI shard selections through ci-run-node-test-shard: 32 passed, one Linux-only case skipped on macOS. The code-mode Gateway evidence file passed all five tests; its logged harness_error is an intentional synthetic failure, not a broken test. Validation: check:import-cycles (zero cycles), scripts typecheck, changed-file guards and lint/format checks, and autoreview clean through P2.
What Problem This Solves
Session lists rebuild the entire resident projection after unrelated config commits, such as sidebar preferences, and after unchanged database admission.
User Impact
Preference changes and unchanged store admission retain prepared session rows. Agent identity edits update displayed identities without rematerializing session data. Unrelated config commits also preserve the system-event store owner instead of repeatedly retiring subagent notifications.
Why This Change Was Made
The config publisher classifies neutral, identity-display, and row-affecting changes. Admission and registry owners publish topology changes; the existing projection reconciles physical store generations and refreshes new, replaced, removed, or related rows. Sharing and delivery custody still recognize these publications. Model, roster, session-policy, and sharing changes retain broad refresh behavior, as do same-object config publication and changed resolution provenance.
No new cache, config option, schema, persistence, or update behavior is introduced.
Evidence
Synthetic 8,000-row fixture, a 247-row list, and completion of pending materialization:
These are single fixture timings on Blacksmith Testbox (
blacksmith-testbox,openclaw-check), not production latency claims. Baseline lease:tbx_01m3fj5vqc5j4822vt5hppac6c; candidate lease:tbx_01m3fk2c10pqh4yh519tvyd4aa.OPENCLAW_PROJECTION_BENCH_ROWS=8000 node scripts/run-vitest.mjs src/gateway/session-row-projection.config-commits.test.ts --maxWorkers=1. It also verifies selected archived identity refresh and unchanged re-admission without materialization. Neutral reload retirement callbacks fell from two to zero; real store/environment changes still retire ownership.tbx_01m3fn0vy85s5sk6rjb4x0t80h: 246 tests passed across 22 files. Coverage includes config classification/publication, admission and recovery, registration, deletion snapshots, projection/topology, archived rows, sharing and delivery custody, list handlers, and notification store ownership. Changed-file lint passed withnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <changed TypeScript files>.node scripts/check-changed.mjs --base 8d8bd43120f3acd7e9e596e4d12774c442000703passed production typechecking, all 25 core-test typecheck graphs, formatting, boundary/size guards, and dead-export scans. The full gate is not green: full-tree lint reports two pre-existing violations,requester-cron-authority.integration.test.ts(1,002/1,000 lines) andopenclaw-state-worker-runtime.ts(705/700). Both files are unchanged from the pinned base. The new fixture's accumulating-spread lint finding was fixed and its final lint/test rerun passed. GitHub CI's changed-code lint and type checks subsequently passed.Individual changed-file costs (
pnpm test <file> --maxWorkers=1, including transform/startup):runtime-snapshot.test.tssession-row-projection.config-commits.test.tsserver-reload-handlers.hot-reload-status.test.tsopenclaw-agent-db.registration-commit.test.tssessions-mutations.catalog-queue.test.tssession-row-projection.recovery.test.ts(explicit infra config)monitor-inbox.socket-lifecycle.test.ts(explicit extension-worker config)session-row-changes.test.tsserver.sessions.store-paths.projection.test.ts(explicit Gateway-server config)The new projection regression uses 16 rows by default and took 1.439 s of test execution; the 8,000-row measurement is opt-in. Cold transforms dominate the Gateway-file wall times. Recovery used
node scripts/run-vitest.mjs --config test/vitest/vitest.infra.config.ts <file> --maxWorkers=1; it and two worker-owned siblings also passed together in 20.58 s. The existing mutation-queue suite retains its full ordering/authority coverage; its observer now recognizes the topology publication.CI follow-up: the first run was cancelled after the WhatsApp socket-timeout fixture observed one remaining fake timer. Priming waited for callback entry while durable settlement and the read receipt continued afterward. The fixture now awaits its existing inbound-drained signal before switching clocks; socket/timer assertions, deadlines, and retry policy are unchanged. The original bundle and five diagnostic probes passed on
tbx_01m3fphcfb6bjps7rx594tg5w1(not proof of a fix); one probe observed an additional query timer after the clock switch. The repair passed independent review, extension lint, 20 full-file runs (22 tests each), and three replays of the original 14-file WhatsApp plan (146 tests each) ontbx_01m3fqdq7x651avp26zbkc8gkg, using the canonical extension-worker configuration and CI shard runner with two workers. Shard runtimes were 56.02, 54.65, and 54.94 seconds.The second CI run passed the WhatsApp shard, then stopped on a redundant
ElementHandle<Node>type argument in a UI test helper added to main after this branch began. The branch was rebased onto8e77ea0b3e5c; range-diff confirmed both reviewed commits unchanged. The helper now uses the identical defaultElementHandletype. Ontbx_01m3fscppx545g55ddzswqfez5, its exact lint check and 56 config, sharing, list, and projection tests passed. The refreshed 8,000-row measurement remained 0 dirty rows / 0 materializations, at 20.1 ms for preferences and 39.3 ms for unchanged admission. The type-only repair also passed independent review.The third CI run passed the repaired lint and WhatsApp lanes, then found one missed sibling expectation in
session-row-changes.test.ts: the three committed registry events still expected the former broadstoresscope. It now asserts the exact agent-scoped topology payload while retaining all transaction-ordering and rollback assertions. A repository-wide audit found no other stale observer expectations. Ontbx_01m3ftvmh1ht0qn07j1y4vejxq, its lint and all 23 publication, registration, admission, and projection tests passed; independent review was clean.The fourth run found a brittle whole-process filesystem parity check in the session path-preparation test: automatic mode made zero
lstatcalls while pinned mode made one, with zero state-directory probes and environment captures in both. The test now requires zero conventional state-directory probes in each of all six pinned/automatic × list/search cases, retaining exact results and zero environment captures. This catches both modes regressing together, which parity could miss, and removes unrelated global syscall comparisons. The original 24-file shard replay passed (not proof of repair). Ontbx_01m3fwt097pfc66h5pkdhts3kj, the correction passed lint, independent review, 20 standalone runs, and three original 24-file shard replays with 310 tests each. No production code, timeout, retry policy, or baseline exception changed.Testbox setup required one dependency installation per lease. Leases were replaced after file-sync timeouts; no tests ran in those failed sync attempts. A fixture initially tried to restamp immutable creation attribution; it now uses the owner-assignment API. No live Gateway was modified or benchmarked.
Final CI: run 36277690754 passed on
3dfcbe2e1d5855bc666eca6ba0c21fe4cdea8a46: 153 successful jobs, 19 skipped, includingopenclaw/ci-gate, in 852 seconds (14m12s). The PR check rollup showed 178 passing checks, 43 skipped, and no failures or pending checks. All task-owned Testbox leases were stopped.