Repository navigation
refactor(infra): keep SQLite signal reads out of worker runtime - #200179
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. What this changesMoves SQLite cancellation-signal reads to the existing scope context and updates internal consumers to avoid importing worker machinery. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused ownership cleanup that current main still needs, with no actionable correctness or security findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDoctor, credential storage, and database inspection consumers combine caller cancellation with the existing SQLite scope signal; actual worker operations continue through the worker facade. flowchart TD
A[Internal consumers] --> B[Worker scope context]
C[Caller cancellation] --> B
D[Scope cancellation] --> B
B --> E[Combined inspection signal]
A --> F[Worker facade for operations]
Technical reviewBest possible solution: Keep the unchanged signal getter with its existing scope owner and retain worker imports only for actual worker operations. Do we have a high-confidence way to reproduce the issue? Source shows signal-only consumers importing a facade that initializes the worker pool; this read-only review executed no target code. Is this the best way to solve the issue? The move uses the existing scope owner, preserves cancellation semantics, removes the superseded export, and migrates internal callers without adding another abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a0e45492b89. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -5, Tests +55. Total +50 across 53 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 16, 2026, 12:19 PM ET / 17:19 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#194599) An agent database on an older schema is now reported as a required state migration, so the managed service is parked with the existing "run openclaw doctor --fix" guidance instead of restart-looping the Gateway. The session-SQLite import still defers such a target and processes the others (fixes openclaw#194580). Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 8bea0c1) Release adaptation: Classify only older canonical agent schemas as existing state-migrations maintenance; Doctor continues deferring matching targets. Keep newer schema refusal/media migration identity. No schema/version/data migration changes; retain focused Gateway parking, committed reader and Doctor regressions. Later cancellation-owner and unrelated Doctor repairs are not prerequisites. Follow-up dispositions: 410c0dd refactor(infra): read SQLite cancellation from its scope owner (openclaw#200179); 8cd7d87 chore(ci): drop retired test-lines allocation records (1/3) (openclaw#197655); 0e966cc fix: avoid agent database stalls after worker retirement (openclaw#194484); ef47e2e fix(doctor): defer update session-entry inspection when snapshot space runs out (openclaw#196370); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685) Validation: Source baseline old-schema error was generic SqliteSchemaMismatchError and did not trigger service maintenance parking. Matching existing maintenance codec and Doctor catch reviewed; exact regression group queued. diff check passed. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f61a73edfda73dc6452f3e0e534cb9e891c05ae6) (cherry picked from commit 4e8445923f2522eb6b42ab705e15624a1a674a39)
What Problem This Solves
Callers that only read the current SQLite inspection cancellation signal import the worker facade and its pool machinery. The signal's existing scope owner can answer that query directly.
User Impact
Cancellation keeps the same scope, caller-first abort reason, and retired-scope behavior. Internal consumers avoid the unnecessary worker import path. No configuration, schema, or public API changes are required; no measured RSS saving is claimed.
Why This Change Was Made
The unchanged getter moves to the existing SQLite read-only worker context module. All 48 internal consumers use that owner, with mixed consumers retaining their worker imports for actual worker operations. The old facade export is removed. Production changes are net -5 lines; tests add 55 lines.
Evidence
Baseline:
4bce7604f0a5e6a706d06cf4243708379a79f0e6. Candidate:76bb70dae25c1b391873be34bde7eb5f5ab123b2.Three fresh source-mode processes on Node 24.22.1 established the original boundary: the context control loads 7 module URLs, the doctor migration context 536, and the client credential store 953. The latter two load the read-only worker and pool modules. These are loaded file URLs including dependencies, not compiled-module or memory measurements.
On the same runtime, the candidate keeps the context control at 7 URLs and reduces the migration context from 536 to 210 and the credential store from 953 to 870. All three preserve isolated configuration. Neither consumer loads the read-only worker facade or pool through the signal query.
Seven focused suites produced 95 passing cases and six named macOS-only skips on Linux. Coverage includes scope cancellation and caller-first abort reasons, real credential-worker retirement/recreation, shared-client custody, real inspection cancellation, facade IPC/disposal, and four static import boundaries. The first proof process exited 1 because its collector expected 20 facade cases instead of the actual 22; all test commands exited 0. The saved JSON/JUnit reports were independently checked, with rejection checks for missing, duplicate, pending, failed, and unexpected skipped cases. That run has no final source seal.
The separately closed remaining-gates run passed targeted formatting, lint, four type graphs, and a full build with declarations enabled. Its before/after/build/completion seals match all 63 source files and 232 dependency inputs from the focused run. It reran no tests and preserves the first collector failure explicitly. The build completed with six soft Control UI budget warnings; these are recorded warnings, not a claim that those budgets passed.
Native proof runs: focused cases and source witnesses and remaining gates and full build. Their delegated Actions sessions ended cancelled during native cleanup; the scoped results above come from the retained command/report receipts, not that Actions conclusion.
Independent source review completed all three declared ownership groups with no actionable findings. Runtime and build evidence are tracked separately from that review.
The completed PR CI run tested merge
c29b9162ec0f3df9d6270e8caf6af4a3aa55b4e3(base472cd0a2f542599eea763f013eba2d34033ca25f, candidate above). Its 115 jobs ended with 88 successes, 25 skips, one underlying failure and the failed aggregate gate. Security and the PostgreSQL jobs passed. The two failing readiness cases wait onfs.access, while the existing executable-viability owner uses its executable probe followed byfs.stat. Those test/support/owner files are byte-identical at the base, candidate and tested merge; the viability change predates both parents. This is source/history-attributed inherited failure, not a passing baseline rerun. Existing PR #200133 owns the readiness-test repair, so it is not duplicated here. The native inherited-CI landing evidence preserves the failed run and exact tested merge.Exact-head ClawSweeper review reports no findings or remaining moves. The source head remains unchanged.