Repository navigation
refactor(runtime): deslop runtime caches - #164520
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. |
|
Stop the rejected mock connection before installing the no-error fixture, then verify the state survives the owning app render. Preserve the original assertions and the overlapping login test file.
|
Exact-head validation for
| checks-node-changed-compact-large-6 | Five pending-final delivery recovery cases fail: two lack The branch passed both import-cycle checks (zero), focused owner tests, all 1,132 plugin contracts, both Knip checks, relevant type graphs, and runtime builds. The final login fixture correction passed an original-defect negative control, 20 consecutive Linux runs, and all 23 login cases. The channel-presentation pair also failed with its original parser and passed with the canonical QA parser. Assertions, fault injections, and timeouts remain intact. Review disposition: fresh independent review and the exact-head ClawSweeper technical review found no actionable introduced defect. The two generated compatibility checklist items do not identify a changed contract: sandbox helpers only become private; wizard and memory CLI changes keep the same deferred imports and operations; Ollama retains the same embedding provider arguments and result. No configuration defaults, stored formats, migration algorithms, package dependencies, or public SDK metadata change. The technical review independently confirms this. Measured branch production delta: −842 lines across 142 files, excluding tests, fixtures, documentation, and generated files. The coordinator accepted the cross-cutting coverage exception for this one PR. |
* refactor(runtime): deslop redundant caches Use the existing module and registry owners directly for cold command, setup, and startup lookups. Preserve lifecycle, authority, identity, and measured hot-path caches. Fix model lookup cache keys to match exact provider identity, and let Google Auth own Vertex token expiry instead of masking refreshes behind a second fixed-lifetime cache. * refactor(runtime): drop remaining cold setup import caches * test(security): complete audit workspace fixtures Create the skill files advertised by the malformed-workspace fixture so missing-file rejection cannot race directory scanning. Keep the scan assertions and reject scan-failure findings. Defer cache changes in status.scan-overview, the legacy session importer, and audit-extra.async to their active deslop owners. * test(plugins): verify markdown defaults use the loaded registry * test(telegram): stabilize concurrent monitor startup fixtures * test(migrate-hermes): preserve concurrent plans across mocked imports * refactor(runtime): close unused exports exposed by direct imports Remove dead facade and test-only exports exposed by the narrower import graph. Keep tests on existing production owners and retain loaders whose removal would expand lifecycle, diagnostic, probe, or externally owned secret-apply contracts. * test(runtime): retain usage cache cleanup consumers Keep the existing usage cache reset and loader while model-catalog and publication tests still consume that cleanup contract. * refactor(auth): retain shared login runtime loading Exclude the login runtime loader from this batch so simultaneous login flows keep their existing shared import and cancellation test contract. * test(qa): decode completion context through the shared mock parser * fix(ci): preserve scanner and QA test boundaries * test(ui): align login fixture with gateway owner state Stop the rejected mock connection before installing the no-error fixture, then verify the state survives the owning app render. Preserve the original assertions and the overlapping login test file.
Use the shared mock-provider turn resolver for protected developer/system completion context. Preserve suppressed delivery, observer, and ambiguous-custody assertions. Companion backported from 19e87bf (openclaw#164520). Thanks @steipete. (cherry picked from commit c695668) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Cold commands, setup, and startup paths retained caches that duplicated the existing module, registry, or auth owner and required extra state, resets, and forwarding code.
User Impact
Configuration, protocol shapes, command output, tool descriptions, and UI appearance stay the same. Model discovery no longer lets one provider spelling poison another lookup, and Vertex requests consume refreshed tokens from Google Auth immediately.
Why This Change Was Made
Fixes found along the way
The login-gate E2E fixture now clears the rejected connection through the Gateway owner before projecting a no-error state. A forced parent render verifies that the old auth error cannot return. The original assertions, timeouts, and overlapping login test file are unchanged.
The channel-presentation E2E proxy now uses the canonical QA request parser through the plugin test API, including system/developer completion carriers. Its old user-only parser missed completion markers and failed to activate Slack suppression and Discord missing-message-identity faults. The existing assertions, fault injections, and timeouts are unchanged.
Model registry cache keys now use the exact provider identity accepted by the underlying lookup. An uppercase miss can no longer mask a later lowercase hit, or vice versa.
Vertex delegates token freshness to Google Auth's expiry-aware client rather than hiding refreshed tokens behind an invented five-minute cache. Manual authorized-user token caching, deadlines, and client recovery stay intact.
The malformed-workspace audit test now creates the SKILL.md files advertised by its mock. Missing files raced the scanner import; a warm cache masked the invalid fixture. The existing scan assertions remain, and the test now also rejects scan-failure findings.
Telegram and Hermes fixtures now settle Vitest’s manual-mocked imports before overlapping the live operations. Two token leases and two pending plans still coexist, with the original shutdown, reacquisition, identity, forwarding, and error assertions preserved. This avoids Vitest’s documented concurrent-import limitation without production workarounds, retries, sleeps, or weaker assertions.
Evidence
Exact-head validation for
d60bfc2386ea8006309bcd67fe6d859ccb3359e8is complete. CI run 37167324344 tested merge29ce590ea5362538fef72275adceb853abe242de(main5fc6683924d2033f32ac5de44aeb3983da2a8a91plus the PR head). Its remaining failures are two test jobs and their two aggregate CI statuses. Security-fast, all seven Security High lanes, Opengrep, and the security-sensitive review passed.@openclaw/worker-runtime.7fd8a8ea80e6cbf3b4cb4c2ad737fea38dce1e5d, has the same five failures and native loader stack. The native observer fails at test setup before the changed status scan runs. The test, SDK, worker package, native resolver, module loader, package/lock files, and tsconfig match the actual CI merge. Main has since added the missing worker aliases in #164662.| checks-node-changed-compact-large-6 | Five pending-final delivery recovery cases fail: two lack
pendingDeliveryNotice; three never reach the delivery callback. | Independent PR #164670, job 111335988743 fails the same five cases and assertions on tested merge94de6acfd394062ebc61da938aaf5094b6695dbd. A separate clean Linux checkout of the candidate's main parent5fc6683924d2033f32ac5de44aeb3983da2a8a91, with a frozen install and unchanged tests, also reproduces all five failures. Delivery recovery, completion, and worker-patch owners are unchanged by this PR. |The branch passed both import-cycle checks (zero), focused owner tests, all 1,132 plugin contracts, both Knip checks, relevant type graphs, and runtime builds. The final login fixture correction passed an original-defect negative control, 20 consecutive Linux runs, and all 23 login cases. The channel-presentation pair also failed with its original parser and passed with the canonical QA parser. Assertions, fault injections, and timeouts remain intact.
Review disposition: fresh independent review and the exact-head ClawSweeper technical review found no actionable introduced defect. The two generated compatibility checklist items do not identify a changed contract: sandbox helpers only become private; wizard and memory CLI changes keep the same deferred imports and operations; Ollama retains the same embedding provider arguments and result. No configuration defaults, stored formats, migration algorithms, package dependencies, or public SDK metadata change. The technical review independently confirms this.
Measured branch production delta: −842 lines across 142 files, excluding tests, fixtures, documentation, and generated files. The coordinator accepted the cross-cutting coverage exception for this one PR.
Login fixture proof: removing only the new owner-stop transition reproduces the original error-row assertion. The fix passed 20 consecutive Linux runs, the full 23-test login suite (36.35 seconds), both cycle checks, and all 1,132 plugin contracts. Independent P0–P2 review is clean.
Latest correction: both cycle checks are zero, both Knip checks pass on the rebased source, 31 boundary/audit tests and all 1,132 plugin contracts pass. The targeted E2E pair passes through the QA test API in 121.13 seconds (existing case budgets and assertions unchanged).
Independent review completed with no actionable P0–P2 findings, including fresh reviews of the fixture repairs and overlap exclusions.
Both model-discovery and Vertex regressions failed against the original production source and passed with the candidate fix.
The first focused run exposed the inherited inline-actions import-boundary failure introduced by refactor(skills): run skill library reads and selection authority in workers (skilllib A) #164165. Main fixed it in 5c5700d; the branch now includes that repair. None of the failing import-chain files is changed here.
All eleven runtime bundles, plugin packaging, CLI bootstrap import checks, and post-build preparation passed on the rebased candidate before the three ownership exclusions.
Audit fixture stability: 20/20 standalone runs passed using the authorized serialized local fallback after remote provisioning failed. Original four-file shard passed 3/3 runs. The remaining focused selections were completed during publication validation.
Both import-cycle checks report zero in an isolated Linux checkout with verified Git head and tree. The publication correction passed 1,005 focused tests in 41 files, plus both production and all-export Knip checks. Core typecheck passed; the final test-type shard exposed additional usage-cache cleanup consumers, so that cleanup export and loader were restored. The follow-up passed both dependency checks, both cycle checks, all selected focused targets, and all 27 affected test-type graphs. The login loader restoration passed 63 tests in the original login and login-runtime suites; no cancellation assertions changed.
Telegram monitor and Hermes lazy-provider fixtures each passed 23 consecutive Linux runs, retaining overlapping live operations and all original ownership/forwarding assertions. Hermes provider sibling tests passed as well.
After the conflict-only rebase: all 1,132 plugin contracts pass; both import-cycle checks report zero; core typecheck and 68 daemon-status tests pass. The one conflict preserved main's new daemon runtime-status projection while retaining this batch's direct imports.
Paired E2E proof uses identical rebased production source: both targeted channel-presentation cases fail with the old proxy parser and pass with the canonical parser. The remote run also built all eleven runtime bundles and packaging prerequisites. The old memory-host contract defect is repaired by main already included in the rebase.
The login-flow source is unchanged from the base. No package dependencies, public SDK entrypoint metadata, schemas, or protocols change.
Coverage
At the reviewed pre-rebase checkpoint, 1,149 files in fixed candidate inventories were read in full with matching SHA-256 receipts: 1,050 TypeScript/TSX, 98 Swift/Kotlin, and one current-base owner. Two explicitly requested ownership-exclusion sources were also fully reread, bringing the detailed log to 1,151 files. Rebase-changed files were reread; unchanged receipts were reused only while their hashes matched. The audit had zero unread files or stale hashes at that checkpoint; publication rebases preserve the patch and rerun affected proof.
The inventories select files above 200 lines using declared cache patterns; they are not every production file. Retained caches protect hot paths, lifecycle or identity, or real I/O/computation. The native audit found no safe removal candidate. Source coverage is separate from runtime/test validation.
The measured batch removes 842 net production lines (142 production files), excluding tests, fixtures, documentation, and generated files. The below-threshold batch excludes files owned by other open deslop PRs; the source audit retains caches with a real lifecycle, identity, or hot-path contract.