Repository navigation
refactor(state): consolidate sandbox read dispatch - #157687
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 25, 2026, 11:41 AM ET / 15:41 UTC (Revision 19). ClawSweeper reviewWhat this changesMoves four sandbox container and browser registry reads into the shared-state worker’s existing registry dispatcher and refreshes the generated database-worker inventory. Merge readiness✅ Ready for maintainer review Keep open. Current main still handles these reads inline, and the pinned merge retains this cleanup. No actionable defect was found in the introduced patch. Priority: P3 Review scores
Verification
How this fits togetherSandbox management stores container and browser records in OpenClaw’s shared state database. Sandbox APIs send read commands to a read-only worker, which returns registry results to CLI and runtime callers. flowchart LR
A[Sandbox and CLI callers] --> B[Sandbox read APIs]
B --> C[Shared state read worker]
C --> D[Admitted SQLite read]
D --> E[Registry dispatcher]
E --> F[Registry replies]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -3, Docs +8. Total +5 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep these reads in the existing admitted worker dispatcher and review later ingress changes as separate slices. Do we have a high-confidence way to reproduce the issue? Not applicable: this is code consolidation rather than a reported failure. The old and proposed dispatch paths are directly identifiable in source. Is this the best way to solve the issue? Yes: the change reuses the admitted database handle and existing sandbox queries without adding a new owner, API, or migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3241d9473856. 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 (18 earlier review cycles; latest 8 shown)
|
e90cb77 to
c9244ce
Compare
c9244ce to
94bcd27
Compare
|
Merged via squash.
|
What Problem This Solves
The shared-state read worker handles sandbox registry commands separately from its existing registry dispatcher, making that entry point harder to extend and review.
User Impact
No user-visible behavior changes. Sandbox reads retain the same worker, admission, SQL, returned data, and cleanup. Existing installs need no migration or operator action; schemas, configuration, retention, and SDK contracts are unchanged.
Why This Change Was Made
Move the four sandbox read cases into
readStateRegistryCommand, alongside its existing registry operations. The existing worker immediately uses that dispatcher; no dormant handler or parallel path is introduced. This is a behavior-neutral subset of the reviewed channel ingress worker migration, preparing the reader for the later ingress slice.Evidence
All execution uses blacksmith-testbox, lease
tbx_01m3chw0p5tnnyd6yxb8mxyaa6, run 36152376896, with an isolated checkout andpnpm install --frozen-lockfile.pnpm test src/agents/sandbox/registry-read.test.ts src/agents/sandbox/registry.test.ts src/state/openclaw-state-read-worker.test.ts --maxWorkers=1: passed, 59 tests / 3 files / 60.95s wall. Existing coverage exercises all four sandbox reads through the worker; no new or changed tests, assertions, sleeps, or Gateway boots.pnpm db:worker-inventory:genandpnpm db:worker-inventory:check: passed, 535 files / 2,532 calls. Generated documentation includes inventory drift already present on the base.node scripts/check-changed.mjs --base 53a0b854769dd6506940c9e41a3cc18b6b91fb04: 62.18s, stopped at the existing agents-root budget (721 roots / 720 limit), before type/lint lanes. Earlier selected guards and formatting passed. The exact failing command,node --import ./scripts/tsx.mjs scripts/check-tsgo-core-boundary.mts, reproduced on a separate clean checkout of that same main SHA (0.91s, exit 1), matching the candidate (1.03s, exit 1). This slice changes no test roots or shard configuration. The owner is unchanged; no guard, baseline, or environment severity was weakened. Existing GitHub Actions policy treats this size limit as advisory.pnpm tsgo:core: passed, 69.47s.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/state/openclaw-state-read-registry.ts src/state/openclaw-state-read.worker.ts: passed, 26.38s, zero warnings/errors.pnpm check:madge-import-cycles: passed, 48.70s, zero cycles.pnpm lint:docs: passed, 14.94s, 1,310 files and zero issues.Diff-scoped deslop: clean. Fresh Codex P0–P2 review: clean, no actionable findings. Generated inventory was produced and checked by its owner, not edited by hand.
Exact-head CI run 36153599916 completed success on
2e9f783042c3e4c3b69592e6ccdfcfb1ad9cc3bd;node scripts/watch-pr-ci.mjs 157687 2e9f783042c3e4c3b69592e6ccdfcfb1ad9cc3bd --repo openclaw/openclaw --completion ci-runreturned GREEN. The Testbox and its workflow are stopped. The full signed-SMS crash/replay proof runs after the final stack slice lands.Stack
The stack lands sequentially; links are added as successors open.
0dca2516a7f809579468afcb2b22b528ece324b8.f7604e5f4bc854bc707dbcba05c9f5fcaecc66fe.4082227bed20fbfb12e05be113898d68bfca2f23.c8d67d6751349528820cb4710002dc994abfffb8.Size: production +36/−39 (net −3); tests +0/−0 (net 0); generated inventory docs +80/−72 (net +8). This PR replaces the former combined ingress proposal; its complete reviewed candidate remains preserved locally for the remaining slices.
Stack closeout: all 18 slices are merged.
#157687 → #158203 → #158233 → #158288 → #158412 → #158477 → #158628 → #158637 → #158860 → #158887 → #158896 → #158928 → #158933 → #158980 → #158987 → #159006 → #159008 → #159073
Final merged-main signed-SMS SIGKILL/replay proof passed on
f0b78f55d6d5acfb052a4512d97088b408a0c28d.