Repository navigation
refactor(core): deslop state, skills, logging, ACP and session helpers - #160382
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: blocked before merge. Reviewed September 29, 2026, 3:13 AM ET / 07:13 UTC (Revision 12). ClawSweeper reviewWhat this changesThe branch consolidates duplicated code across SQLite state, skill loading, ACP sessions, setup prompts, media, logging, and worker request parsing, with focused test updates. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains Keep open. Current main has not absorbed this cleanup, and the related merged work addresses adjacent behavior. Review of the storage, setup, skill, media, and worker changes found no discrete introduced defect. Priority: P3 Review scores
Verification
How this fits togetherGateway and CLI flows receive setup choices and agent requests. Skill, ACP, media, and SQLite worker owners turn those inputs into capabilities, session state, replies, and diagnostics. flowchart LR
A[Setup choices and agent requests] --> B[Gateway and CLI flows]
B --> C[Skill loading]
B --> D[ACP session control]
B --> E[SQLite state workers]
C --> F[Agent execution]
D --> F
E --> F
F --> G[Media and logging]
G --> H[Replies and diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain one owner for each internal responsibility while preserving installed-upgrade behavior, session authority, and existing plugin configuration values. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal cleanup rather than a reported broken behavior. Source comparison and the contributor's parity checks assess preservation. Is this the best way to solve the issue? Yes. The sampled changes reuse existing owners and preserve the inspected migration and setup decisions; current main does not contain the central cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 10e951e85748. 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 (11 earlier review cycles; latest 8 shown)
|
49ee48a to
176db73
Compare
l138 subsystem deslop coverageInitial base: fd9ac3e. Integrated base: ec101d5. Final retained simplifications remove 842 net production LOC, 15 test LOC, and four assertion-baseline lines. All assigned production source was read, prioritizing untouched files over 150 lines after reviewing merged changes since 2026-09-18. This log covers every production file over 200 lines on the integrated base: 292 files, sorted below by current line count after cleanup. Files reduced below 200 lines remain listed. Generated declarations remain generator-owned; test/support files are excluded. The two worker type cleanups now owned by main were removed from this lane.
|
f24f64c to
22ac22f
Compare
22ac22f to
60f131d
Compare
Consolidate repeated owner checks, projections, prompt rendering, media response cleanup, worker decoding and internal forwarding layers. Preserve SQLite effects, redaction, protocol payloads, skill serving and defaults. The complete subsystem pass removes 899 net production lines. No schema, retention, migration behavior or public contract change is intended.
60f131d to
0dd54eb
Compare
openclaw#160382) * refactor(core): deslop state, skills, logging, ACP and session helpers Consolidate repeated owner checks, projections, prompt rendering, media response cleanup, worker decoding and internal forwarding layers. Preserve SQLite effects, redaction, protocol payloads, skill serving and defaults. The complete subsystem pass removes 899 net production lines. No schema, retention, migration behavior or public contract change is intended. * refactor(core): retain narrowed values and shrink assertion counts * refactor(core): preserve emitted plugin SDK declarations * refactor(core): preserve lint-safe helper projections * fix(state): keep worker operation store aliases local to break import cycle
…s third pass (#161758) Consolidate existing state path ownership, remove duplicate ACP and Doctor projections, and simplify logging, skill, media, session, wizard, and worker helpers. Preserve storage effects, authority and cleanup settlement, redaction order, wire formats, prompts, and transcript bytes. Third pass after #160382 and #161316; 166 net production lines removed without test deletions. Independent review is clean. Remote Linux proof passed both cycle checks, 65 selected test files, SDK checks, and the full build. The pre-existing stale max-lines entry is already repaired on main by 1087139. Land under the requested inherited-failure exception: the sole final-head test failure is the Workshop rejected-review request count, independently reproduced on untouched main. CI cancelled 55 sibling jobs; those are not passing proof. Full attribution and remote checks are recorded in the PR.
…s third pass (openclaw#161758) Consolidate existing state path ownership, remove duplicate ACP and Doctor projections, and simplify logging, skill, media, session, wizard, and worker helpers. Preserve storage effects, authority and cleanup settlement, redaction order, wire formats, prompts, and transcript bytes. Third pass after openclaw#160382 and openclaw#161316; 166 net production lines removed without test deletions. Independent review is clean. Remote Linux proof passed both cycle checks, 65 selected test files, SDK checks, and the full build. The pre-existing stale max-lines entry is already repaired on main by 62fc1a3. Land under the requested inherited-failure exception: the sole final-head test failure is the Workshop rejected-review request count, independently reproduced on untouched main. CI cancelled 55 sibling jobs; those are not passing proof. Full attribution and remote checks are recorded in the PR.
What Problem This Solves
Reduces repeated internal orchestration and forwarding code across state, skills, logging, ACP, onboarding, media, and workers.
User Impact
No intended user-visible change. SQLite schemas, query effects, migration policy, retention, indexing, concurrency/recovery, redaction, ACP payloads, whole-skill serving, prompt/default text, session keys/transcript bytes, media limits, manifests, and config keys are preserved.
Why This Change Was Made
Measured reduction: 842 net production LOC (+790/−1,632), 15 net test/support LOC (+91/−106), and four assertion-baseline lines. Total: 114 files, +883/−1,744. The result is below the requested threshold after implementing the sound opportunities from the full subtree pass. Coverage: all 292 production files over 200 lines, each marked READ with its simplification or preservation rationale.
Evidence
Final candidate:
0dd54eb95c85ad967ef5446a0a32c43927170e03, treedb966e3933dc492a8c2efc8d132c2f9e3c5a83c7, integrated baseec101d561e2c852a7e3c419c1df9a5f0f620861c. All selected Testbox proof passed. A fresh merge-tree check against mainc259398c7cb3796c57b0723f15c8d0789d73ce40was conflict-free; this does not relabel that later main as the tested base.Final-head Linux proof ran through the repository Crabbox wrapper on Blacksmith Testbox, lease
tbx_01m3nt7gpp60dm1x5ef7j0jk9c, run 36526415287, with frozen dependencies and exact source/tree verification:OPENCLAW_BUILD_PRIVATE_QA=1 pnpm buildpnpm test <file> --maxWorkers=1node scripts/check-changed.mjs --base <pinned base> -- <eight integration paths>pnpm plugin-sdk:api:diff --base <pinned base> --head HEAD --require-acknowledgementff7b090fsrc/infra/fs-safe-import-boundary.test.tsand siblingsCross-shard execution used
node --import ./scripts/tsx.mjs scripts/test-projects.mts <explicit targets> -- --reporter=dot. The eight changed-check inputs cover the ACP conflict resolution and the integrated state/Doctor owners. Earlier full-branchcheck-changedpassed in 2,347s; the unchanged cleanup retains that proof. The broader lane/importer selection and later 798-file refresh completed on earlier qualified revisions, including native skips; these are retained unchanged-input evidence, not newly executed final-head files. The 31 opt-in live-provider suites were excluded. No aggregate spanning those historical runs is claimed.The actual installed
[email protected]driver ranopenclaw update --tag file:<candidate.tgz> --yes --json --no-restartin an isolated existing store created by the published CLI. Update JSON reportedok, with every step exiting 0. The updater-child candidate Doctor migrated state schema 1 → 19 before standalone repair. All 17 legacy audit fields, integer AUTOINCREMENT high-water 47 with retained row 7, three valid cron configurations/projections, and both malformed jobs' exact original JSON and recovery metadata in quarantine survived. Installed immutable application payload matched the tarball for the final commit. Repeat Doctor left the complete audit/cron/quarantine/schema/integrity snapshot unchanged. No production migration guard was altered to accommodate the fixture.Before/after proof also passed 720 exact terminal-renderer comparisons and four media blank-workspace fallback probes. The renderer harness invokes the old and new render callbacks while retaining Clack wrapping/layout, covering initial/active/error/submit/cancel, 24/80 columns, guide visibility, empty/multiline errors, selections and navigation. No appearance or rendered state changes, so the visual-change screenshot gate does not apply; the review request based on an assumed visual change is rejected on this evidence.
The other changed test files were individually measured with
pnpm test <file> --maxWorkers=1on unchanged inputs: runtime-handle reset 18.94s, model-picker 27.03s, command-specs 2.49s, skill-index 1.24s, proposal-draft 14.54s command wall. Hosted test durations were unavailable while the PR was a draft; Testbox results are not hosted-CI claims.Independent Codex review has no accepted actionable finding. Two whole-diff findings were rejected with complete-source evidence: ClawHub callers copy parameters and assign local GitHub resolution only without an explicit version; canonical media facts normalize workspace values before fallback. Subsequent fixture/counting and conflict-resolution reviews were scoped-clean. The four retained commits replayed patch-identically on the final base.
Fixes found along the way
The cancellation fixture exposed asynchronous recovery-owner release outliving temporary-store cleanup, allowing a late database registration to invalidate the next case's registry snapshot. The original order was reproduced; our repair passed 20/20 whole-file repetitions on
176db735e94(222 cases each, median 135.8575s, range 124.337–164.31s) and 3/3 original-shard replays (223 cases, 154.953/136.790/140.191s). These remain historical measurements.Main then landed a narrower repair in
863e377524avia #159527. Source inspection confirmed its lifecycle-admission wait joins the same recovery-release promise. Both our broader teardown and the identical counter cleanup were dropped, leaving no diff in that fixture. The final 223-case shard above verifies the integrated main-owned repair. An experience-review fixture defect was likewise already repaired on main in6dd3011e9f5and was not duplicated. No assertions, timeouts, retries or cases were weakened.Several earlier leases were interrupted; only unfinished phases were resumed, and prior results remain revision-qualified. The final remote command exited 0 after all gates passed; a subsequent external runner-portal sync warning did not change its result. Task-owned leases are stopped during closeout; no Gateway, release or deployment was changed.