Repository navigation
refactor: deslop gateway, config and infra fixtures - #182979
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. |
5e8e795 to
2ee8af0
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR consolidates repeated test fixtures and removes a config watch-selection counter. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides useful fixture consolidation, and no concrete introduced defect was found; failing exact-head CI still needs attribution. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTest suites consume shared fixture constructors, while the config file adapter converts selected filesystem paths into watch subscriptions and reload notifications. flowchart LR
A[Test suites] --> B[Shared fixture owners]
B --> C[Existing runtime owners]
D[Selected config paths] --> E[Config file adapter]
E --> F[Filesystem subscriptions]
F --> G[Reload notifications]
Technical reviewBest possible solution: Retain the focused consolidation and accepted watcher simplification once the failing CI checks are resolved or independently attributed. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a bug report; source inspection found no definite introduced failure, and no target code was executed during this read-only review. Is this the best way to solve the issue? The substitutions reuse existing owners or small shared fixture constructors while preserving allocation sites and assertions; the only runtime tradeoff is explicitly accepted by the maintainer author. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab7631a25601. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests -508. Total -504 across 78 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 October 24, 2026, 6:55 PM ET / 22:55 UTC. |
|
Exact-head inherited-failure landing evidence for
The completed CI attempt has78jobs with no unfinished or cancelled selected jobs. PostgreSQL (1/3) and (3/3) passed. Full exact-head census:222checks; the only other nonpassing check is superseded auxiliary context121007887999, with successful same-head replacements121012129660,121008014081 and121007931827. Selected security-fast and all six Security High boundary jobs passed; current dependency-review and security-sensitive-review statuses succeeded. The same-name commit-status CI gate projects these CI failures, not a security waiver. Actual CI checkout The PR body retains all per-cut tradeoffs, preservation counts and earlier local uncertainty. Scoped tests/types/lint/format, real PostgreSQL fixture proof, cycle checks and suppression tests passed as documented. Review has no accepted actionable finding. Native preparation is exact-head github_pending; standing campaign authority permits the individually attributed inherited-failure exception. Security, enforced reviews, source binding and exact-head merge guards remain required. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Duplicated test setup across Gateway, configuration, infra, state and daemon tests makes fixture ownership harder to follow and leaves a few redundant internal operations behind.
Measured complete diff: 78 paths, +416/-920 = 504 net lines removed, including 2 net production lines (+1/-3 in source-file.ts). These are disjoint changed paths, including all three new test-support owners, not cumulative counts of predecessor packets. The workspace-projection fixture and its two changed-reachable production files were conservatively excluded after a timing-sensitive local failure; all three are unchanged from the base.
User Impact
No feature, public API/config/protocol or persisted schema changes, and no required user action. Tests retain every scenario, assertion and registration. The only accepted runtime edge-case change is best-effort overlapping pre-refresh watch selection, described explicitly below; security/effect authority, common-path durability and write settlement remain intact.
Why This Change Was Made
Each independent cut gives repeated fixture data or setup one owner without moving assertions into production or sharing state that was previously fresh. The only production simplification removes a pre-refresh watcher counter. The following sections separate their ownership and tradeoffs for review.
Preservation and size by independent cut
For the original rows, assertion counts are direct
expect(...)source calls; test counts are lexical callbacks, with custom setup/registration calls shown separately. W counts terminal expect/assert expressions instead; D separately records 144 direct expects and 294 rooted expression entries. T records direct expects plus Vitest assert calls. These methods are not added into a single assertion total. Parameterized rows, hook/mock signatures and complete assertion bytes are preserved; registration counts are not expanded runtime test counts. Rows with zero assertions/tests change production/support only, not tests.The retained original 68-path census additionally preserves 2,363 direct expects, 2,366 expect entries, one assert-root call and all 4,967 rooted assertion-expression texts; those are separate representations, not additional assertions. Its aggregate is 507→507 test callbacks, 51→51 suites and 102→102 hooks. W retains 5→5 suites/9→9 hooks/16→16 mock-fn signatures; D retains 2→2 suites/6→6 hooks/2→2 mocks. All owner/consumer byte or inverse-AST checks remain supporting evidence, not substitutes for product-path tests. Shared support files and the composed claim/runtime file are counted once.
Fixed session-store configuration
Replace ten copies with existing fixed-store configuration owners; preserve the original store expression, roster and fresh nested values.
Best-effort tradeoffs accepted: Incidental property order in the tools/Talk fixtures follows the existing owner; values, own fields and evaluation timing remain unchanged.
Model fixture defaults
Reuse the existing model-definition fixture in authority, agent and fallback-transport tests, retaining explicit capabilities, limits, absences and the agent input alias.
Best-effort tradeoffs accepted: Model enumeration order follows the existing fixture owner; no provider request, fallback behavior or security boundary changes.
Outbound target registry defaults
Reuse the existing registry defaults within the same beforeEach allocation/reset scope.
Best-effort tradeoffs accepted: None. Forum identity and registry/plugin/metadata freshness remain explicit.
Scheduled-task spawn results
Reuse the typed spawn-result owner and retain the positional stop adapter's stdout/output coupling and hoisted fixture.
Best-effort tradeoffs accepted: The general factory allocates a tiny default output array that explicit overrides discard; process result values, freshness and settlement behavior remain unchanged.
Eager test gates
Replace captured promise/resolver boilerplate with the existing deferred owner without moving allocation or release sites.
Best-effort tradeoffs accepted: Deferred also supplies an unused reject field. No consumer relies on the old object's exact key set; scheduling assertions stay.
Requester test gates
Reuse that deferred owner for four eager requester gates; keep binding order, releases and requester authority local.
Best-effort tradeoffs accepted: An unused reject field is supplied by the shared owner; no scheduling or authorization guard is removed.
ACP startup metadata
Construct repeated ACP metadata through the existing test fixture owner while retaining scenario-specific fields and startup paths.
Best-effort tradeoffs accepted: None in metadata values, allocation lifetime or migration behavior.
Config promotion listeners
Share the repeated failing-runtime-overlay listener setup, allocating a fresh listener closure at every original call.
Best-effort tradeoffs accepted: No listener loss: three original registrations remain three helper invocations. The raw broad name screen gains the helper's own registration site; expansion restores the original module AST.
PostgreSQL bootstrap defaults
Move repeated bootstrap callbacks to the existing engine-store support owner; keep custom vector-search setup distinct.
Best-effort tradeoffs accepted: None in engine selection, callback freshness, schema/admission or cleanup. Real PostgreSQL conformance proof remains required; skip-only collection is not acceptance.
Pending-input history
Reuse existing pending-input support for repeated history setup without sharing stores or moving assertions.
Best-effort tradeoffs accepted: None. Each scenario retains its own state, inputs and history expectations.
Held migration locks
Reuse the existing held-Gateway-lock fixture rather than reconstructing its held promise and native import graph.
Best-effort tradeoffs accepted: None in lock admission, release/settlement or native-cohort import timing; the existing owner remains the lifecycle authority.
Avatar response bytes
Reuse the existing response fixture while retaining exact byte content and response ownership.
Best-effort tradeoffs accepted: One additional bounded setup-time byte copy; no avatar admission or response behavior changes.
Source watch selection
Remove only the pre-canonicalization selectionRevision counter. Current/stopped watcher, admitted-root, publication and durability checks remain. Introducing PR #159226 supplies no human inversion incident; related write-effect guards are untouched.
Best-effort tradeoffs accepted: Overlapping pre-refresh selection no longer guarantees latest-invocation-wins. The pinned filesystem dependency has synchronous canonicalization work; a future delayed inversion may briefly select an older watch plan and cause an extra notification/reload that rereads current config. This is not authorization to publish old config or write state.
Package publication setup
Reuse existing publication-swap transaction capture and fence scopes in boundary/durability tests; keep aliases, explicit authority, refusal callbacks and custom transaction/journal scenarios local.
Best-effort tradeoffs accepted: None. Fresh runtimes/executors, error identities, native admission, FIFO settlement and durability assertions remain unchanged.
Unused validation observer
Delete only the unimported test-only PRAGMA observer and its unused counter import, after the final callers were removed in merged #182687.
Best-effort tradeoffs accepted: None for retained behavior. Live validation fixture APIs, the general counter owner and native/schema/security/durability behavior remain.
Cron process-exit values
Delete the local duplicate runExit constructor and import the existing process-test owner; leave stronger watched-run extinction behavior local.
Best-effort tradeoffs accepted: None. Fresh result objects, overrides, mocks and lifecycle registrations retain their original sites.
Cron read-service fixtures
Reuse the existing createReadService owner at three construction sites with the same scheduler, clock and logger.
Best-effort tradeoffs accepted: Incidental logger property/spy-allocation order follows that owner; scheduler identity, clock values, fresh spies and every consumer assertion remain.
Inert socket fixtures
Give five inert socket literals one narrow test-support owner, preserving send identity/callbacks, numeric OPEN and fresh mock functions; remove only imports made unused by the move.
Best-effort tradeoffs accepted: Only incidental fixture construction is centralized. No live socket behavior, registration, transport callback or expectation changes.
Placement claim/runtime fixtures
Reuse the existing claim and runtime owners across three suites. Explicit active remote-exec versus worker-turn seed modes and claim/run IDs remain distinct. The same-file cuts are counted together once.
Best-effort tradeoffs accepted: Only internal fixture property-order normalization; owner identities, per-call freshness, store/resolver bindings, cancellation and effect checks remain.
Repository harness fixtures
Use a pure constructor in the already-imported session-test owner for the repository selection/projection pair; keep distinct failure messages and registry activation local.
Best-effort tradeoffs accepted: None. Repository provider identity, priority-free support result and fresh rejecting attempt remain.
Codex harness fixtures
Use a separate pure constructor in the existing dispatch-test owner; keep the provider list, priority, command protocol and registration timing distinct from repository fixtures.
Best-effort tradeoffs accepted: None. No universal provider factory or production registry seam is introduced.
Pending reclaim runtime
Reuse the existing sessionRuntime projection while explicitly overriding managedWorktrees with the scenario's original workspace closure.
Best-effort tradeoffs accepted: The helper creates an unused pure default closure before replacement. Workspace reference identity, fresh loader methods, canonical resolver and cancellation-failure scenario remain.
Scheduled-task settlement result
Replace the remaining literal with the existing positional spawnSyncResult adapter, retaining status, signal, output and error semantics.
Best-effort tradeoffs accepted: None. The current suite's 78 direct expectations and 22 registrations are preserved; native settlement and security authority are untouched.
CLI registry entries
Put identical CLI-backend entry data in the already-imported registry fixture owner; leave registry push, activation, callbacks and cleanup at each original site.
Best-effort tradeoffs accepted: None. The nested command configuration remains fresh and registration lifetime is unchanged.
Compaction result fixtures
Share the nested success result through the existing runtime-state owner at initialization, reset and held-result default sites.
Best-effort tradeoffs accepted: None. Each call creates fresh outer/nested data; supplied results, getters, held signals and write-capable settlement remain unchanged.
Archive snapshot fixtures
Add one type-only archive test-support owner for repeated cold snapshots; preserve the index fixture's singleton lifetime and per-page callback freshness.
Best-effort tradeoffs accepted: None. Own-undefined fields, key order, cursor/generation identity and all bounded-reader/recovery scenarios remain.
Managed-worktree records
Reuse the existing makeWorktreeRecord owner at five sites. Preserve real versus synthetic repository identity, UUID call timing, zero clocks, own optional fields, explicit paths/refs and fresh records.
Best-effort tradeoffs accepted: Incidental own-property insertion order follows the existing fixture owner. The local-workspace-projection substitution was dropped: saving two lines did not justify widening its initialization graph. The review concern is resolved by retaining that suite's original literal, not by claiming the import caused every timing-sensitive failure. Zero-net publication/abandonment proposals and the broad launcher-support proposal are excluded.
Device request/mutation helpers
Share repeated request defaults, required-value checks and paired-record mutation helpers in one infra test-support owner; retain the main suite's call-time default state directory adapter.
Best-effort tradeoffs accepted: None in device identity, fresh request arguments, store transactions, error text, credentials or mutation persistence. No production auth/approval seam changes.
Transcript event records
Add two fresh record constructors to the existing transcript-message test-support owner and migrate the actor-kernel suite as the first area. Every original field, message reference, timestamp and allocation site remains; the complete helper-expanded kernel AST and assertion/registration texts match. This is the owner-first stage, not a migration of every transcript suite.
Best-effort tradeoffs accepted: None. The existing owner's import graph is inert (type imports and pure fixture constructors); no hooks, native initialization or asynchronous work is introduced. Its existing 19 direct consumers remain unchanged. The kernel retains 95 direct expects, 2 Vitest assert calls, 6 lexical callbacks, 2 mock registrations and 192 rooted assertion entries, each before→after.
Evidence
The original 77-file focused selection completed with 1,458 passed and one existing platform skip. The added selection completed with Gateway: 140 passed, two failed, two existing skips across six files, and infra: 34 passed across two files. The added-eight driver exited 1 after 763.602 seconds; its canonical test run reported 759.24 seconds. These are focused-suite results, not a whole-suite or exact-head hosted-CI claim.
Both original failures are in local-workspace-projection's checkpoint-resume cases, for stopped=false and stopped=true: lease caller-abort results at approximately 1,002/999 ms differed from the expected outcomes. One serial full-file comparison completed: original candidate 33 passed, one failed, two existing skips (stopped=true again received the approximately 1,001 ms lease abort); untouched pinned base 34 passed, two existing skips. Canonical durations were 250.09/221.73 seconds and driver durations 274.667/250.676 seconds. All 79 changes were reversed for the base, with 302 bindings verified and a clean worktree; this was not a cut-only control. The varying false row is not labeled a proven inherited or load-only failure. No timeout, retry or expectation changed.
The initial review's P2 concern about that suite's new non-pure service.test-support import was accepted on import-footprint grounds and the entire fixture substitution was dropped. The one post-repair full-file run still failed: 33 passed, one failed, two existing skips; stopped=true received the same approximately 1,001 ms lease abort (238.58 seconds canonical / 271.818 seconds driver). Thus removing the import is not a proven timing fix. Both remaining changed production dependencies reachable from that suite, systemd-service-files.ts and openclaw-state-read-worker.ts, were then conservatively restored to base. Their hunks are excluded and retained separately, not attributed as the cause. Projection and both production files are now byte-exact base. The static/literal closure covers 12,209 modules with five parser gaps closed; 18 computed-loader boundaries remain explicit limitations, not a claim of complete runtime reachability. The two added transcript files are outside that closure. Final source guards verify 304 inputs and 20 unchanged boundary files.
A fresh independent final-candidate review reported one P2 claiming the new event helpers lose a required literal discriminator. Rejected after checking the actual API: appendTranscriptEventsInTransaction accepts Iterable, and session-accessor.types.ts defines TranscriptEvent = unknown. The owning agents-sessions type program passed. No cast or speculative type constraint was added. The engine's status remains findings, not scoped-clean; there are no accepted unresolved findings.
Scoped static checks passed: original 70-path lint/format took 103.177/6.155 seconds; added nine-path lint/format took 52.426/8.989 seconds. The actual mock-export ratchet passed with 7,067 grandfathered factories. A fresh final-candidate collision census observed at 2026-10-24 22:28:09Z covered 42 complete open manifests with zero intersections and zero errors (62 calls, at most three in flight). This includes both new transcript paths and is title-routed, timestamped collision evidence, not permanent clearance, mergeability or CI proof.
The retained added seven files account for 142 passing cases, with no overlap with the original 77-file selection. The new kernel passed all 6 cases (104.92 seconds canonical / 123.93 seconds runner / 125.506 seconds driver); the two new-file lint/format checks passed in 22.747/5.286 seconds. All eleven targeted type programs passed. Real PostgreSQL proof passed all 6 files and 45 cases (24.75 seconds canonical / 94.51 seconds runner / 104.405 seconds driver), against an isolated task-owned PostgreSQL 18 database. Final runtime cycles (zero), Madge cycle ratchet, all 14 lint-suppression tests, changed-file classification and diff checks passed. Exact-head hosted CI remains the broad proof. The unchanged conditional real-Podman scenario in the excluded projection suite is unrun and is not proved by default selection. These existing native/database-heavy suites retain their original policies and real storage boundaries; no timeout was inflated to accommodate shared-host setup time.
Local proof uses the canonical runner, serial nice10 execution, one Vitest worker and task-owned HOME/OpenClaw/XDG state. No new skips, weakened expectations or manual prerequisite bypasses are part of these cuts. No user-visible UI change or screenshot requirement is introduced.
Conflict-only integration
GitHub reported CONFLICTING on the first published head, so the branch was rebased onto main d2d9352. The sole conflict was pending-input-history's new upstream context/id table from #182883. Both rows, its stronger statement counter, every assertion and cleanup are retained; only the same eight setup literals are replaced. Expanding the eight fixture calls reproduces the complete current-main module AST, with 36→36 direct expectations and identical table/registration AST. The full diff remains 78 paths,+416/-920=504 net. The signed rebased head is 2ee8af0. Frozen dependencies were reinstalled successfully. The full affected suite passed 10/10 (169.33 seconds canonical / 190.39 seconds runner / 193.641 seconds driver); owning types, scoped lint/format, runtime cycles (zero), Madge cycles (zero), all 14 suppression tests and diff checks passed. Earlier proof remains prior-head evidence, not a claim of current-head hosted CI.
Exact-head CI failure attribution
Run 40139494507, attempt 1, tests head 2ee8 through actual merge ad66967deb3af510628a7eb72401c36a1389949f. Its ordered parents are main 0a3d2dc and this PR head; the retained merge tree equals a fresh merge of those parents. The following are failure witnesses, not a claim of green CI or repairs to the failing behaviors.
The small-3 lifecycle job fails two cases: webhook handoff with cleanup rejects=false at channels.test.ts:405:43, and timeout cleanup refusing replacement at lifecycle.test.ts:459:45. Both expect restartRequired=false and receive true. One serial complete-two-file comparison reproduced exactly those failures on the clean PR head and untouched parent d2d935: 5 passed / 2 failed on each. Canonical/runner durations were 141.97/158.96 seconds on head and 203.37/225.39 seconds on base. Both use the same Node26 launcher and pinned Bun on macOS, not Linux CI runtime parity. The local base differs from actual CI base; all 22 specifically inspected lifecycle/test/owner/frontier blobs match local versus CI base and PR head versus tested merge, but this is not a full dynamic import-closure claim. The webhook case additionally matches all six preceding completed scheduled-main runs, most recently 40134490303/job120993216566.
PostgreSQL (2/3) fails seven interactive-setup cases: sqlite onboard/setup/crestodian, PostgreSQL onboard/setup/crestodian, and PostgreSQL malformed-config onboard. Every full tail reports missing staged runtime/standalone-runtime-profile.mjs imported by runtime/packages/llm-core/src/validation.ts. Natural scheduled-main 40138789542/job121006161355, head 87f00b1, independently reproduces all seven exact cases and the same full tail. The test, staging owner, onboarding driver, importing validation module and root profile are byte-identical at PR head/parent, actual CI merge/base, and that scheduled-main head. Upstream #182856 added the import; the existing source-runtime fixture root-copy list omits its new file. Earlier six scheduled-main PG jobs predate that import, so their greens are not presented as matching failure evidence. The failure is retained, not hidden by removing readiness assertions. No retry, longer timeout, skip or expectation change was used for either attribution.