Skip to content

refactor(config): deslop config fourth pass - #159588

Merged
steipete merged 6 commits into
mainfrom
deslop/l119-config4
Sep 29, 2026
Merged

steipete merged 6 commits into
mainfrom
deslop/l119-config4

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fourth-pass cleanup of redundant forwarding, duplicate type contracts, and repeated result assembly.

User Impact

Preserves config schemas, all keys/defaults, env-reference write-back, Doctor migrations, redaction, SQLite schemas, and persistent semantics. No operator action.

Why This Change Was Made

  • Remove forwarding layers, unused reset/database plumbing, and parallel type declarations; migrate callers to canonical owners.
  • Share traversal, projections, maintenance completion, origin classification, and receipt updates, retaining guards and ordering.
  • Reuse normalization/promise helpers and simplify equivalent copy-on-write and result assembly.

Measured production diff: 713 added / 1,380 removed = 667 net lines removed. Tests/support: +63/-60; assertion baseline: two entries removed; max-lines baseline: one removed. Below the 1,000-line target after full coverage: all 233 READ rows are retained below. Earlier #158295 and #159054 work was preserved.

Fixes found along the way

Completed the ACP caller cutover to structuredClone. Merged #159723 owns runner/skipped-suite repairs; merged #160360 owns the shared-include fixture repair, separating deletion-time admission from optimistic publication. No duplicate fixes.

Evidence

Head f45b543a5d8fa2c09d1c8d424c16be69538278cb, tree 8fd677c1d72233484118bb42a471f3964f8dc1ef, base 1eef6b153bfb02e9ec34bf418b1e3d7042f9c51e. Open and unmerged, without auto-merge. All five commits are patch-identical after the final CI-repair refresh. The earlier conflict in mutate.ts preserves main's new root/include locks and producer-owned environment compensation, then reapplies only shared post-commit error construction. No config behavior or ownership guard was removed.

Blacksmith Testbox tbx_01m3mzk2kva4n2xk2dexp472y9 (run 36488047638) verified pre-refresh tree bf6ec2b8c239edc144c964f87f724d6921b3828e; the reviewed refactor delta is unchanged. The original PR-exempt planner regression passed (27 s); six mutation, environment-restoration, Gateway-recovery, plugin-update, and Doctor-rollback suites passed (296 s). Config CLI, CLI update, and Gateway root type graphs passed (148 s). node scripts/check-changed.mjs --base origin/main -- src/config/mutate.ts src/config/mutate.include-io.ts passed (1,651 s), including the full selected type graph, unused scans, lint, and guards. The rebase adds no new import boundary; prior boundary proof below remains applicable. The lease is stopped.

Fresh full-branch Codex review after the include-write integration is scoped-clean through P2. An earlier exclusion-filter concern was rejected against the complete source: both producer queues filter excluded paths synchronously before combining them, with no intervening await. No accepted actionable findings remain.

Previous exact-head CI 36459534762 was cancelled after the PR-exempt planner case exceeded its 79-job cap (82 planned); its shard passed 172/173 tests. Direct-main repair df582a4010d5d244ff100b2c8d363ebee43a0fcf is included in this base. The owner closed alternative #160691 as superseded after comparing both plans; this lane retained the narrower main repair and published no competing fix. Earlier planner timeout repairs #160517 and #160531 are also included. CI 36495495376 on the preceding head was cancelled after one inherited Docker-helper shell-text assertion failed (346/347 cases passed). Main repair 8799587f34360d9630ed6f49dffc878d3b013e5c aligns three stale expectations with the runner and is included in this final refresh. No runtime budget or assertion was changed by this PR. Current-head CI 36499450000 is attached and in progress; earlier cancelled runs are not represented as green.

Earlier Blacksmith Testbox integration proof remains applicable to unchanged hunks: run 36456071833, tree 9e5e7326e9a9645f0af4c67240641d160cce4975, passed core types (47 s), config/agent-session/Gateway-method test type graphs (119 s), and two owner/sharing Vitest shards (83 s). Run 36423682791, tree fab05c334d4596e35016103bf18cdf51ef1c3d52, passed build (308 s), core types (40 s), four test type graphs (191 s), worker integration (79 s), and archive-worker suites (61 s). Its archive conflict retains main's Omit<TranscriptArchiveReadPlan, "expectedIdentity"> while sharing page options. Those leases are stopped.

Retained passing Testbox proof:

  • Runtime run 36361124766, tree f87e5ee2ee55f7ebf4727d3d636bec534547692f: all 483 config files / 6,628 tests, 840 s; two existing file skips and six case skips. Schema snapshots and generated config metadata unchanged. Nine importer shards passed, 211 s; four boundary/normalization shards passed, 24 s, including fs-safe and sibling import boundaries. Build passed, 441 s; ACP 32/32, 44 s; package integrity 58 s; installed CLI/Doctor/SDK consumers 582 s.
  • Changed gate 36368520641, tree cada0805044d54ef397d291e041531ca4b68a380: full check-changed passed, 1,563 s, including 25 test type graphs and all guards. Removed stale suppression/baseline entries without changing limits. Review had no accepted actionable findings.

Unresolved evidence and separately owned repairs:

Previous-head CI 36401635461 was cancelled after completion-expiry and pre-bootstrap child-timeout failures; it is not green. Completion expiry is repaired upstream by #160387 plus 659f4b73d8e, whose commit records 20 stable repeats. This lane also reproduced the original failure and passed 20 runs plus boundaries/changed checks on an alternate draft, then discarded that draft after finding the upstream repair; those runs are not presented as identical-source proof for upstream.

The original 42-file pre-bootstrap cohort passed a diagnostic replay on the original source/toolchain: 1,449 passed, 23 existing skips, 132.53 s command wall. The child completed its recorded work in 28.7 s under the unchanged 60 s deadline. This is a non-reproduction, not a timeout fix. Windows CIM replay likewise passed 101 tests in 113.81 s without establishing a fix.

The config candidate's [email protected] updater preserved config/env references and sessions, then failed in Doctor. Separate unmerged #160400 prevents private native-admission receipts from mutating the live index and composes with main's capture-lifetime repair. Its final tree 4b5354c3dfe5619652290bbf00c9f440f4b6fe91 passed both Doctor regressions, six sibling suites, four import boundaries, full changed checks (1,727.48 s), build (427 s), package creation (83 s), and the full published updater (408 s) on Testbox run 36468964679. Its subsequently discovered trusted-wrapper inventory omission is corrected by listing the new capture resolver; the existing extraction regression and wrapper siblings passed on Testbox. This is separate-product proof, not final-head config proof. An earlier release check exceeded the unpacked-size budget (369.1 MiB / 320 MiB) after integrity passed; downstream smoke in that command did not run. The size check was not rerun or bypassed, and full release validation is not claimed.

All execution was remote. Changed-test single-worker wall times (pnpm test <file> --maxWorkers=1):

Changed test Testbox single-worker wall Result
src/agents/internal-session-effects.test.ts 17.08 s pass
src/agents/tools/sessions.test.ts 17.91 s pass
src/config/sessions/delivery-info.test.ts 17.25 s pass
src/config/sessions/session-accessor.sqlite-entry.env-capture.test.ts 1.74 s pass
src/gateway/server-restart-sentinel.test.ts 53.39 s pass
src/gateway/server-runtime-subscriptions.access.test.ts 21.94 s pass
src/gateway/session-history-worker-runtime.test.ts 15.95 s pass

No new tests/assertions/boots. Restart-sentinel's 53.39 s covers persisted recovery and runtime delivery. Hosted per-file costs were unavailable; job totals are not substituted.

Complete production-file coverage: 233 READ entries

Baseline: 4ed8936655bd65c87980a94adb5a2e97857d2a9c. Read merged subtree PRs/name-only diffs since September 20 first, then untouched files over 150 lines and the whole subtree. A final census covers every current production file over 200 lines; session-entry admission crossed that threshold during integration and was read with its reply-admission caller. Final-head census: all 230 production files over 200 lines are covered. Rows are sorted by current production LOC; three retained rows now have 200 lines or fewer. All 229 original rows plus four additions retain their reading notes.

Lines File Result
1742 src/config/io.write-prepare.ts READ - Retained include and roster projection, explicit-path ownership and reference-identity matching; branches protect different authored-write contracts.
1162 src/config/mutate.ts READ - Unified post-commit error construction while retaining rollback status, aggregate cause and owner checks; include/root write boundaries stay distinct.
1001 src/config/zod-schema.core.ts READ — Retained the declarative schema, public literals/defaults, shared validators and dependency-owned request contracts; prior passes already consolidated repeated media/request fields.
882 src/config/config-env-vars.ts READ - Retained Windows key semantics, provenance-aware CAS, staged publication and rollback ordering; prior passes already share environment indexing.
877 src/config/sessions/session-accessor.types.ts READ — Unified identical raw/visible transcript page result structure while preserving each event type and reset-reason union.
857 src/config/sessions/types.ts READ — Collapsed repeated copy-on-write model normalization branches; valid entries retain object identity and absent model/provider fields remain deleted.
819 src/config/zod-schema.agent-runtime.ts READ — Replaced local optional-string trimming and domain trim/filter/deduplication with normalization-core owners; all schema fields, transforms and omission semantics remain identical.
810 src/config/schema.labels.ts READ — Retained curated user-facing labels, their authored insertion order and compatibility metadata; further removal would change schema output.
772 src/config/sessions/disk-budget.ts READ — Removed duplicate excluded-path filtering after both source queues already filter the same paths.
750 src/config/sessions/session-accessor.sqlite-read.ts READ — Retained differently fenced cold/raw/indexed/maintenance readers; no sound consolidation without changing snapshot, byte-budget, or corruption semantics.
748 src/config/sessions/combined-store-gateway.ts READ. Retain: topology preparation, row merging, and sync/worker loading already share their owners; sentinel ownership, source-model lineage, admission, and post-retirement currency guards are distinct contracts.
745 src/config/sessions/session-transcript-reconcile.ts READ — Retained: planner, publication, lease recovery and deferred rescheduling have distinct live-owner and cleanup contracts; merging their branches would change ordering or refusal handling.
739 src/config/sessions/session-accessor.sqlite-lifecycle.ts READ — APPLIED: native structuredClone replaces the scope forwarding helper; reset/deletion/archive publication and harness rollback guards are unchanged.
737 src/config/sessions/session-accessor.sqlite-entry-cache-publication.ts READ — Retained creation provenance, native/worker settlement, membership invalidation, and generation custody; these are distinct authority/lifecycle contracts, not duplicate policy.
733 src/config/sessions/transcript.ts READ — Removed the obsolete sqliteScope-only target wrapper, single-use parser flag and one-use patch callback; reused the already captured append target. Removed the obsolete max-lines suppression after shrinking the file. Public transcript behavior and redaction are unchanged.
728 src/config/sessions/session-accessor.sqlite-reclamation-worker.ts READ — Retained: worker reuse, pooled/native settlement, exact lease cleanup, commit gates, and pressure retirement each have distinct owner contracts from recent fixes.
727 src/config/io.snapshot.ts READ - Retained invalid/missing/source snapshot distinctions, include hashes and read-error classification; each fallback carries different write safety facts.
722 src/config/io.observe-recovery.ts READ - Retained sync/async effect drivers, fresh ownership checks and recovery phases; these preserve failure and durable-commit semantics.
716 src/config/sessions/store-maintenance.ts READ — Removed repeated model-run parsing after the exact raw-key regex already proves agent and UUID constraints.
716 src/config/sessions/targets.ts READ. Retain: ordinary discovery, existing-only lookup, recovery candidates, and CLI selection deliberately carry different containment/existence/ownership policies; further merger would broaden parameters or hide their safety boundaries.
709 src/config/sessions/session-accessor.sqlite-transcript-store.ts READ. Inlined the private one-use idempotency forwarding helper into its scoped lookup owner; append, dedupe, redaction, payload and projection order unchanged.
708 src/config/sessions/session-accessor.sqlite-projection.ts READ. Replaced the removed cloneSessionEntry forwarder with structuredClone and removed an orphaned trailing documentation comment; lifecycle planning and publication untouched.
705 src/config/runtime-snapshot.ts READ - Derived follow-up variants from the canonical after-write union; retained generation fences, publication ordering and reader ownership.
702 src/config/sessions/legacy-main-session-migration-operations.ts READ. Retain: in-place mutation already has one wrapper; cross-store copy, expected-entry deletion, quarantine, and receipt revalidation have different commit and authority boundaries. This pass must preserve Doctor migration and persistent semantics.
701 src/config/sessions/session-accessor.sqlite-reset-window.ts READ. Kept reset versus compaction boundaries, indexed versus imported identity navigation, bounded byte readers, and exact history/context semantics; no further sound structural reduction found.
700 src/config/sessions/session-transcript.worker.ts READ — Retained: per-request lazy imports, read fences, missing-database outcomes and retained-connection publication differ by operation; shared history custody already has one owner.
696 src/config/sessions/session-accessor.pending-inputs.ts READ — Retained: accepted-input bytes, idempotency receipts, current custody and restart replay differ intentionally; no safe duplicated owner or dead branch remains.
689 src/config/sessions/session-accessor.sqlite-transcript-write.ts READ — Replaced the cloneSessionEntry forwarder with structuredClone; migrated lookup-key collection directly to store-entry without unused database plumbing. Native writer fences, read snapshots, and async restore ordering remain unchanged.
687 src/config/io.write.ts READ - Retained authored/source/runtime projection, audit/rollback boundaries and update-driver receipts; no sound behavior-neutral consolidation remains.
682 src/config/sessions/session-accessor.sqlite-archive-read.ts READ. Selection and paging scans deliberately have independent decoded budgets; branch selection, visible context, cursor binding, and hash validation are separate invariants. Async read transactions cannot reuse a synchronous transaction helper. No sound reduction identified.
679 src/config/sessions/session-entry-read-runtime.ts READ. Retain: writable reads, readonly result reads, retained multi-store consumers, and detached-data reads have different source-custody and publication timing; consolidating them would require a new policy/context object rather than removing duplicate ownership.
672 src/config/sessions/session-accessor.entry-mutation.ts READ — Imported canonical session store path resolver directly after private forwarding wrapper removal.
669 src/config/sessions/legacy-main-session-migration.ts READ. Retain: arming, source identity, exact-layout receipt, detect/fix error behavior, cold restoration, and divergent quarantine are required migration behavior; no obsolete alias path was identified.
663 src/config/sessions/session-accessor.sqlite-entry.ts READ — Replaced redundant clone forwarder calls with structuredClone; retained async preparation, native re-admission, publication, and post-write maintenance ordering.
662 src/config/doc-baseline.ts READ — Retained deterministic wildcard traversal, merge precedence, lazy schema loading and artifact budgets; previous passes already own the shared traversal.
662 src/config/sessions/cleanup-service.ts READ. Retain: dry-run sets feed per-session CLI actions, not dead diagnostic state; apply must reread and retain expected-entry/transcript evidence rather than reuse preview state. Partial-result handling protects already-committed stores.
656 src/config/includes.ts READ — Removed the default resolver's forwarding lambda by referring directly to the existing guarded-read owner. Read/write containment and symlink policies remain distinct.
654 src/config/sessions/session-accessor.sqlite-history-query.ts READ. Removed the redundant serializedBytes copy after the generic positionTranscriptDisplayEvents owner, which already preserves all row fields.
644 src/config/sessions/session-accessor.sqlite-reclamation.ts READ — APPLIED: deletion shares shouldRemoveSessionEntry for expected entry, ID, revision, and timestamp checks; keeps falsy expected-entry behavior and all database, artifact, generation guards. Uses structuredClone directly.
642 src/config/sessions/session-transcript-projection-rebuild.ts READ — Derived activeRows from the existing prepared-append active-row type, removing a second declaration of the projection row contract; all runtime projection code is unchanged.
641 src/config/schema.help.runtime.ts READ — Retained user-facing runtime help text and imported shared metadata; no independent state or duplicate execution flow remains.
640 src/config/redact-snapshot.ts READ — Retained schema/heuristic redaction and SecretRef/array identity restoration; each branch enforces a frozen credential-preservation contract.
638 src/config/sessions/session-transcript-worker.types.ts READ — Removed six private result-envelope aliases from the worker map; reader methods now name their existing canonical domain result types directly.
636 src/config/channel-compat-normalization.ts READ — Simplified immutable nested-record cloning; retained all slot-specific streaming inheritance, alias precedence and Doctor messages.
636 src/config/env-preserve.ts READ — No further sound consolidation: active references, escaped literals, retained deletions, and ambiguous array moves need their distinct identity rules; earlier passes already combined their shared matching.
634 src/config/sessions/session-accessor.sqlite-entry-store.ts READ — Imported canonical key normalizer directly; readonly lifecycle input avoids recovery copies. Removed the lookup-key re-export after migrating callers directly to store-entry. Retained exact-node/window ownership and write/repair contracts.
627 src/config/validation-plugin-rules.ts READ — Retained lazy metadata/installation evidence, channel ownership, deferred migration warnings and validation ordering; differing channel/provider contracts cannot be merged safely.
622 src/config/sessions/session-accessor.sqlite-lifecycle-state.ts READ — APPLIED: structuredClone directly owns copying; retained malformed-row reference fallback, exact-key semantics, optimistic checks, builder re-admission, and delete order.
619 src/config/sessions/session-accessor.sqlite-active-events.ts READ. Separate full visit, newest-tail, sparse salvage, and append-stable cursor APIs have distinct byte/count/error-order contracts. Re-exports carry public session accessor types. No further sound structural reduction identified.
617 src/config/sessions/session-transcript-worker-resources.ts READ — Retained: separate foreground, projection, maintenance and usage lanes protect responsiveness; native sequence, cleanup and alias custody are required lifecycle state.
614 src/config/sessions/session-accessor.sqlite-archive.worker.ts READ. Retained archive plan parsers: typed scoped messages coexist with the intentionally generic object boot seam and its non-cloneable payload test. Removing validation without a complete seam cutover would exceed this behavior-preserving change.
614 src/config/sessions/session-transcript-index.ts READ — Derived projection state from the existing projection cursor type; append, suffix replacement and full rebuild retain their existing transaction and watermark contracts.
613 src/config/sessions/session-history-eviction.ts READ — Retained: archive-before-delete, lifecycle admission, protected history and physical WAL measurement are separate invariants; no safe flow collapse found.
610 src/config/sessions/session-accessor.sqlite-pending-inputs.ts READ. Current owner assertions, receipt matching, transaction-staged relocation, aggregate custody, and completion deletion enforce distinct live-authority facts; apparently repeated checks occur before different side effects. No safe reduction identified.
609 src/config/sessions/session-transcript-worker-runtime.ts READ — Retained: history readers and usage workers have different host-effect and cleanup lifetimes; merging them would obscure accepted-write settlement.
609 src/config/zod-schema.root-shape.ts READ — Retained root field definitions, exact validation messages/order, defaults and explicit legacy input contracts.
606 src/config/sessions/session-accessor.sqlite-model-context.ts READ. Navigation, byte measurement, and payload selection share one snapshot. Omission/replacement paths protect tool-frame ownership and cannot be collapsed into generic truncation. Small repeated per-batch metadata setup exists, but extracting it adds equivalent indirection and no clear net reduction.
604 src/config/io.write-safety.ts READ - Retained descriptor/path identity guards and compensating-write ownership; apparent repeated checks fence distinct side effects.
603 src/config/sessions/session-cold-storage.ts READ — Retained: cold preparation, queued restoration, cooldowns and ownership checks distinguish archive stages and preserve retained data across worker waits.
597 src/config/sessions/session-accessor.sqlite-transcript-suffix.ts READ. Kept fallback plan assembly local to its incremental planner and shared exact suffix result fields; removed repeated argument-bag plumbing without moving either planning fence or any persistent mutation.
595 src/config/sessions/session-canonical-key.ts READ. Retain: canonical admission, retained continuation, staged rollback, and bounded versus full scanning have different lifecycles. Runtime schema checks require a coordinated owner migration, outside this read-only deslop scope.
594 src/config/sessions/session-accessor.sqlite-scope.ts READ — APPLIED: removed three invariant-free forwarding exports with complete caller migration; inlined the sole write-observation caller while retaining reader ownership, FIFO, timing, and diagnostic projection.
593 src/config/io.audit.ts READ — Removed the synthetic six-null metadata object; success selects the available metadata once and fields retain their existing null/undefined behavior. Audit fields, redaction, persistence, and retention are unchanged.
586 src/config/sessions/session-cold-storage-worker.ts READ — Retained: archive preparation, verification, externalization and restoration use different persisted record and mutation contracts; cannot combine without changing protected semantics.
581 src/config/defaults.ts READ — Removed redundant no-mutation return before the existing identity-aware return; all model/catalog defaults and authored-field precedence stay identical.
579 src/config/sessions/session-history-worker-runtime.ts READ — Retained: request capture strips different private fields by request kind; shared reads, cold restoration, projection retry and source revalidation already share their proper owners.
569 src/config/sessions/restart-recovery-state.ts READ — Reused canonical normalizeUniqueTrimmedStringList; absent/empty-array distinctions preserved.
565 src/config/sessions/session-accessor.entry.ts READ — Removed pure row-selection forwarding and private store-path wrapper; consumers use existing canonical owners.
562 src/config/zod-schema.gateway.ts READ — Retained Gateway schemas and cross-field security/portal refinements; shared image-fetch shape is already canonical.
556 src/config/plugin-auto-enable.shared.ts READ — Retained distinct manifest/provider/channel/setup activation signals and lazy metadata selection; earlier passes already consolidated shared detection.
550 src/config/sessions/session-accessor.sqlite-parent-session.ts READ — Direct clone/normalizer/logical-key operations and removal of transcript append pass-through helper; preserved awaited target preparation and both transaction boundaries.
549 src/config/sessions/session-accessor.sqlite-exact-read.ts READ — Retained: canonical continuation, captured physical source, row-error settlement, exact-ID fallback, and grouped projection boundaries are independent contracts.
544 src/config/io.runtime.ts READ - Retained public loading aliases, pinned-reader ownership and managed write finalization; public facade compatibility and distinct read policies remain.
544 src/config/sessions/session-accessor.sqlite-message-cut.ts READ — Used canonical normalizeStoreSessionKey after forwarding removal; migrated lookup-key calls directly to store-entry and removed their unused database argument. Fork/rewind/switch retain their existing mutation owner.
539 src/config/sessions/transcript-tree.ts READ — Retained: legacy parentless entries, leaf controls, reset boundaries and opaque append ancestry are distinct shipped input contracts; helpers have production importers.
533 src/config/sessions/session-accessor.transcript-turn.ts READ — Retained: persisted guarded turns and mirror-only appends have named different admission contracts; callback admission and update ordering must remain intact.
518 src/config/sessions/session-accessor.sqlite-canonical-repair.ts READ — Retained Doctor-only transfer, competing-identity filtering, membership winner policy, provenance, and generation-copy ownership. No sound shared descriptor across these different persistence policies.
517 src/config/schema.ts READ — Unified plugin/channel schema budget mapping, simplified equivalent object-schema detection, and replaced cloneSchema forwarding calls with structuredClone.
507 src/config/validation-core.ts READ — Combined final validator failure projection in an ordered short-circuit loop; preserved avatar, Tailscale and model-policy priority.
500 src/config/sessions/session-accessor.sqlite-transcript-parent.ts READ. Reused the existing private readTranscriptIdentityInTransaction for the prepared-parent lookup; identical row predicates and required sequence. Did not substitute the read-module helper with different snapshot behavior.
498 src/config/sessions/session-accessor.sqlite-entry-read.ts READ — Removed unused database plumbing from the pure lookup-key call; retained cached query shapes, per-key conversion isolation, canonical validation, and participant hydration differences.
493 src/config/sessions/session-accessor.sqlite-maintenance.ts READ — Retained: union-find batches keep shared generations with their last owner; count/byte limits, sizing yield points, cancellation, and partial archive publication cannot be collapsed.
481 src/config/sessions/session-accessor.sqlite-node-artifacts.ts READ — Retained per-artifact revision/identity precedence and schema-presence checks; unifying those would alter the prohibited repair/storage boundary.
481 src/config/sessions/session-transcript-reconcile.worker.ts READ — Retained: disk and incognito sources, native lifecycle phases and independent lease release are separate contracts; framing is already bounded and shared.
472 src/config/sessions/session-accessor.sqlite-active-context.ts READ. Indexed and imported/unindexed logical parents deliberately use different sources. Header cost checks occur before payload hydration; reset retention and opaque ancestry carry different semantics. No safe larger reduction identified.
470 src/config/sessions/session-accessor.sqlite-mutation-worker.runtime.ts READ — Retained: canonical validation, cold mutations, and reclamation have distinct settlement/admission semantics; recent warm-refusal and maintenance-preparation changes preserved.
462 src/config/paths.ts READ — Retained profile/service identity checks, explicit path precedence and shipped legacy fallback; these are distinct ownership contracts.
454 src/config/sessions/session-accessor.sqlite-lifecycle-artifacts.ts READ — APPLIED: native structuredClone replaces forwarding import; coarse candidate probes remain separate from authoritative planning and retain marker/age/plugin exclusions.
446 src/config/sessions/conversation-delivery-store.ts READ. Retain: state-specific methods encode allowed transitions while one mutation owner applies updates; progress receipts and correlated turns have distinct atomicity and input guards. No worker migration is authorized in this delegation.
441 src/config/validation-plugin-config.ts READ — Removed the imported string-formatting forwarder; retained blocked/deferred plugin diagnostics, memory-slot decisions and schema validation semantics.
436 src/config/schema.lookup.ts READ — One resolveLookupSchema traversal now serves lookup and path classification; child selection, blocked segments and redaction classification semantics remain unchanged.
432 src/config/sessions/transcript-write-context.ts READ — Retained: context matching, inherited writer fences and metadata publication enforce distinct custody checks; aliases and callbacks preserve owner binding.
431 src/config/sessions/session-accessor.sqlite-transcript-turn.ts READ — Replaced the cloneSessionEntry forwarder with structuredClone; migrated lookup-key collection directly to store-entry without unused database plumbing. Grouped append, replay, and authority boundaries remain unchanged.
429 src/config/channel-config-metadata.ts READ — Retained origin and selected-owner precedence, bounded untrusted-schema traversal and sensitive-hint union; shared normalization already landed.
426 src/config/sessions/session-accessor.sqlite-transcript-reports.ts READ. Native incognito versus worker-backed report paths retain distinct ownership. Settlement must preserve committed results even when cleanup fails; custom-selection retries only follow proven no-write revision mismatch. No safe unification identified.
425 src/config/sessions/transcript-payload.ts READ — Retained: identity fallback, UTF-8 validation, compression, exact byte accounting and native JSON projection cover different encoding contracts.
420 src/config/mcp-config.ts READ — Retained agents-owned mutation facade, before/after ownership callbacks, redaction restoration and optimistic expected-server checks.
419 src/config/io.context.ts READ - Derived ConfigIoContext from its factory instead of maintaining a second function-signature inventory; runtime implementation unchanged.
419 src/config/sessions/paths.ts READ. Retain: transcript and store paths have different fallback/canonicalization contracts; existing comments identify shipped absolute-path recovery, incognito ownership, containment, and captured-cwd semantics.
419 src/config/sessions/session-accessor.sqlite-entry-cache.ts READ — Retained row-generation/data-version checks and guarded participant projections; every cache/publication path has a currentness or ownership invariant.
416 src/config/sessions/session-sqlite-target.ts READ. Retain: shared exact locators and custom fixed-store suffix ownership intentionally differ for ambiguous registry rows; replacing the similar ownership branches wholesale would change precedence.
410 src/config/sessions/conversation-registry.ts READ — Retained address association precedence, current-window checks, snapshot reads and commit-local reads; these enforce distinct persisted conversation contracts.
409 src/config/sessions/session-accessor.sqlite-history-projection.ts READ. Markers/branch/reset query shapes preserve selective indexes; duplicate-looking binary searches use distinct lower/upper-bound semantics. No existing canonical binary-search helper found in shared/utils/infra/normalization-core. No sound reduction identified.
407 src/config/sessions/session-accessor.sqlite-archive-selection.ts READ. Disk-spooled navigation bounds heap use and separate membership caches preserve invalidation across handles. Scratch transaction wrapper has simple rollback behavior that differs from coordinator helpers. No change under persistent-semantic freeze.
406 src/config/sessions/delivery-info.ts READ — Moved thread parsing directly to canonical channel owner as part of complete thread-info forwarder removal.
394 src/config/sessions/session-snapshot-merge.ts READ. Retain: explicit transaction groups, lifecycle ownership, runtime model pair, and independently touched fields protect different concurrent-update outcomes; factoring remaining small comparisons does not yield a clearer owner.
393 src/config/sessions/session-accessor.sqlite-import-stage.ts READ. Doctor-only spool defers row rewrites until scan completion, uses exact bytes after hash narrowing, retains rejected identity recency, and repairs branch custody. This is a named migration owner and protected by the hard Doctor contract; unchanged.
393 src/config/sessions/session-accessor.sqlite-replacement-projection.ts READ — Retained canonical/exact replacement distinction, selected-key authority, expected-row CAS, and native rollback exception.
392 src/config/sessions/session-accessor.sqlite-parent-fork.ts READ — Removed dead exact-context versus legacy/bytes classification and returned the used numeric estimate directly; retained label-entry inference instead of widening then casting.
391 src/config/schema.help.core.ts READ — Retained authored help strings for public infrastructure, auth, role and agent settings; output must remain byte-compatible.
390 src/config/sessions/session-accessor.sqlite-transcript-state.ts READ. Context query compilation caching, root admission, placeholder publication, sequence allocation, and monotonic mutation fences have distinct owners. Repeated retained-window checks also differ between parse validity and stored entry_valid; not interchangeable. No sound reduction identified.
384 src/config/sessions/session-accessor.sqlite-canonical-inventory.ts READ — Replaced manually duplicated selected-row fields with InferResult<ReturnType<typeof canonicalRepairQuery>>[number]; SQL and hydration unchanged.
383 src/config/sessions/session-accessor.sqlite-archive.ts READ. One-shot and scoped archive operations both remain reachable; one-shot reclamation waits for worker exit while scoped reads require captured database scope. Removing fallback would change lifecycle behavior. No safe reduction identified.
381 src/config/write-lock.ts READ — Retained live authority, nested admission/drainage and lock refusal ownership; each asynchronous guard protects a real concurrent boundary.
376 src/config/schema.tiers.ts READ — Retained indexed wildcard matching and two-pass tier resolution; they preserve specificity/authored-order and composition-branch inheritance contracts.
373 src/config/plugin-auto-enable.materialize.ts READ — Retained explicit deny/disable and preferred-owner decisions, workspace trust and authored allowlist preservation.
373 src/config/sessions/session-accessor.sqlite-transcript-reports.kernel.ts READ. Report navigation consumes compressed report facts and raw payloads differently; header validation and report collection have established parse/error order. Terminal answer suppression includes several genuinely different provenance checks. No safe reduction identified.
372 src/config/sessions/session-accessor.sqlite-projection-read.ts READ. Shared admitted projection result assembly for empty and ready snapshots; readiness, cold refusal, empty-state facts and deferred read transaction unchanged. Declined query-binder extraction because it required type gymnastics or a new cross-owner type export.
372 src/config/sessions/startup-migration.ts READ. Retain: source-level ownership, missing-database/unindexed-history deadlock avoidance, deleted-agent refusal, startup maintenance, worker readiness, and handoff cleanup all have named behavior.
367 src/config/sessions/session-entry-navigation.ts READ. Retain: shared navigation class serves both SessionManagerCore and transcript-report projection; opaque links, reset boundaries, bounded first-kept markers, labels, and branch replay are live consumers, not dead generic surface.
366 src/config/schema.help.automation.ts READ — Retained session, automation, hook and message help text; removing or templating distinct descriptions would weaken the public reference.
358 src/config/sessions/goals-operations.ts READ. Retain: canonical transition helpers already own policy, while idempotent receipts retain exact fingerprint/session/goal/time constraints; schema existence checks need an owner migration, not a deletion.
355 src/config/zod-schema.root-support.ts READ — Retained existing shared Talk selection, MCP server-name validation and root schema owners; differences across roles/providers are named public contracts.
354 src/config/sessions/session-accessor.sqlite-history.ts READ. Public page read and private binding verifier share one owner already; archive provenance reconstruction and retained run membership are necessary.
354 src/config/sessions/session-accessor.sqlite-maintenance-kick.ts READ — Retained: generation capture, bounded age facts, publication fencing, quiet-window scheduling, and stale/preservation result handling are distinct observable contracts.
354 src/config/sessions/store-entry-shape.ts READ. Retain: legacy delivery/fallback/memory shapes, model-locked exact identity, pending routing entries, and malformed persisted values require normalization; schema/persistent-semantic changes are out of scope.
353 src/config/io.load.ts READ - Retained shared generator flow and distinct host/worker execution; synchronous and asynchronous effects have different admission contracts.
352 src/config/mutate.include-io.ts READ — Consolidated duplicate post-commit error construction after the rollback attempt, preserving the original or aggregated cause, rollback status, publication phase, and authority checks.
348 src/config/sessions/session-entry-read.worker.ts READ — Retain. Backing/list, creation, replacement, sharing, lifecycle, diagnostics, and board/summary projections intentionally carry different snapshot/admission requirements. Shared result tags alone do not justify another projection-policy layer.
347 src/config/sessions/lifecycle.ts READ — Retain. Work-start refusal ordering, provider-review authority, tombstones, expired Incognito state, lazy transcript timestamps, and failed/finished reuse are observable lifecycle contracts. The async terminal-history wrapper has a live auto-reply caller; synchronous access migration is outside this bounded cleanup.
345 src/config/sessions/session-accessor.sqlite-deletion.ts READ — Retained: native harness rollback, initialization receipts, repository cleanup, and context reset differ intentionally; prepare/commit ownership cannot be merged.
344 src/config/io.clobber-snapshot.ts READ — No sound remaining consolidation: synchronous and asynchronous filesystem paths preserve different retry and failure contracts; ordering, naming, and rotation policy already have shared owners.
342 src/config/sessions/session-accessor.sqlite-replacement-worker.ts READ — Retained operation-specific receipt validation, unknown-outcome handling, FIFO custody, and committed publication settlement.
342 src/config/types.discord.ts READ — Retained SDK-facing channel types, provider-specific documentation, and explicit Doctor compatibility inputs; common messaging fields are already shared.
341 src/config/sessions/metadata.ts READ — Shared external origin-change classification across metadata and route handling; retained each caller's existing-origin, truthy-provider, and fresh-route ownership conditions, plus sparse fields and explicit thread absence.
334 src/config/sessions/session-accessor.sqlite-archive-store.ts READ. Publication retains exact database identity across async preparation, records outcome before notification, and drains pending archives. Retention checks derived-file absence then exact canonical row predicates; changing order would alter persistent behavior. No sound reduction identified.
333 src/config/sessions/session-accessor.sqlite-generation-copy.ts READ — Retained: exact/content fingerprints, byte-preserving transcript transfer, identity insertion, and post-copy projection order protect persistent semantics.
333 src/config/sessions/session-accessor.sqlite-history-interval.ts READ. Indexed and unindexed display reads preserve distinct identity sources and bounded payload hydration; historical windows use both count and anchor-neighbor reads. parseStoredTranscriptEvent has live history-query callers and is not dead.
332 src/config/sessions/session-accessor.sqlite-worker-request.ts READ — Retained: per-request AsyncLocalStorage, admission handshake, revocation, settlement, and error precedence each protect recent worker correctness fixes.
331 src/config/codex-plugin-diagnostics.ts READ — Retained effective model/runtime selection diagnostics; changing route semantics would require sibling Codex evidence and is outside this behavior-neutral pass.
330 src/config/io.health-state.ts READ - Retained health-observation supersession, postcommit publication and best-effort error policy; storage/lifecycle changes are outside frozen contracts.
327 src/config/io.plugin-metadata.ts READ — No sound remaining consolidation: current Gateway reuse, operation caching, read-only admission, and merged workspace inventory have distinct responsibilities and invalidation boundaries.
325 src/config/io.read-helpers.ts READ - Retained tilde restoration, include provenance and environment resolution; helpers own distinct public or write-back semantics.
323 src/config/sessions/session-accessor.ts READ — Removed dead reset-runner re-export after its sole production caller retired in #156377; public session facade remains.
322 src/config/sessions/session-accessor.sqlite-maintenance-store.ts READ — APPLIED: structuredClone replaces forwarding import; selected-row preparation, age fact invalidation, row revalidation, and removal planning are unchanged.
321 src/config/sessions/session-transcript-worker-readers.ts READ — Retained: prior pass #159054 already consolidated result projection; remaining custom handlers enforce distinct streaming, error, array and boolean protocols.
317 src/config/sessions/session-accessor.reset.ts READ — Deleted retired persistSessionResetLifecycle wrapper; its sole runtime caller was removed in #156377; two tests now call lifecycle owner.
316 src/config/issue-location.ts READ — Retained JSON5 token scanner and exact authored/resolved equality guard for safe source-value hints; no equivalent shared scanner found.
315 src/config/sessions/session-accessor.sqlite-page-reclamation.ts READ — Retained: native maintenance versus admitted worker execution is an explicit custody boundary; preview, archive deletion, and page-unit writer admission remain distinct.
312 src/config/sessions/session-accessor.sqlite-transcript-message-append.ts READ. Idempotent replay, exact pending custody, prepared payload reuse, and post-append collision handling differ intentionally. The v2026.9.4 media mirror compatibility path names a shipped contract. No safe reduction identified.
309 src/config/sessions/session-suggestion-store.kernel.ts READ — Retained suggestion caps, malformed-author comparison ordering, claim TTL and CAS settlement; storage semantics unchanged.
307 src/config/sessions/session-accessor.sqlite-creation-worker.ts READ — Retained fresh-entry versus legacy-alias creation paths: they intentionally have different transcript initialization and canonical replacement owners.
306 src/config/zod-schema.agent-defaults-base.ts READ — Retained declarative default-agent schemas and documented runtime defaults; shared model and owner-target definitions are already canonical.
298 src/config/sessions/store-entry.ts READ — Removed the unused database parameter from collectSessionEntryLookupKeys and migrated all nine calls directly to its owner. Retained opaque key casing, exact-entry precedence, proven legacy aliases, and lookup ordering.
296 src/config/sessions/session-accessor.sqlite-conversation.ts READ — Retained route-context preservation, role reassignment, and conversation identity projections; their serialization and association precedence remain explicit.
293 src/config/env-substitution.ts READ — No sound remaining consolidation: #156541 already unified token scanning, while the iterative walker preserves callback order and sparse arrays.
293 src/config/sessions/session-delivery-generation.ts READ — Retained generation revocation, physical database identity, publication counts and incognito custody; similar catches preserve contextual failure mapping.
292 src/config/sessions/session-store-target-inventory.ts READ — Retained configured versus retired target discovery, registry-required retry result, physical aliases and captured source lifetime.
291 src/config/sessions/session-accessor.sqlite-branches.ts READ. Used canonical getOrCreatePromise for in-flight branch-read coalescing with settlement eviction and canonical normalizeStoreSessionKey after forwarding removal; watermark, custody and cold restoration unchanged.
291 src/config/sessions/session-accessor.transcript-range.ts READ — Retained: exact target, generation, anchor, ancestry and byte-budget checks collectively prove a closed turn; no redundant authority checks removed.
291 src/config/sessions/session-transcript-reconcile-pool.ts READ — Retained: tracked operation completion, worker termination and independent lease-release recovery are necessary cleanup states, not redundant wrappers.
290 src/config/sessions/session-canonical-validation.ts READ — Retained batch byte/row bounds, immutable prepared evidence, exact compare-and-certify and per-connection compiled queries.
288 src/config/validation-issues.ts READ — Retained union-specific diagnostic selection and SecretRef policy/schema issue merging; message/path precedence is user-visible behavior.
287 src/config/sessions/session-accessor.sqlite-archive-session.ts READ. Reused worker, FIFO, per-operation identity, retirement, and resource settlement each have distinct lifecycle responsibilities; no safe structural collapse.
284 src/config/config-journal-snapshot.ts READ — Retained fingerprint key lifecycle, slot compare-and-set and current-authority worker access; no persistent semantics changed.
284 src/config/talk.ts READ — Retained permissive Talk normalization and distinct speech/realtime selection; schema parsing would reject values this normalizer intentionally omits.
282 src/config/sessions/session-sharing-store.async.ts READ — Retained native incognito owner and worker FIFO/unknown-outcome publication; add/remove/participant projections have different contracts.
279 src/config/docs-config-examples.ts READ — Retained MDX-aware fence scanner, strict whole-config candidate heuristic, plugin validation and localized-doc filtering; no compatible shared fence scanner found.
278 src/config/sessions/session-accessor.sqlite-import.ts READ. Used resolved.sessionKey directly after pure reference-format forwarding removal; Doctor import bytes, historical ownership and migration behavior unchanged.
278 src/config/types.secrets.ts READ — Retained exported secret-reference/runtime helpers and named migration forms; string-normalization wrapper is a public SDK/config API, unlike private cloneSchema.
274 src/config/sessions/restart-recovery-receipt.ts READ — Shared the exact-claim pending-receipt update and timestamp owner; beginning ambiguity, completion confirmation, proven non-delivery cancellation, stale detection, errors, and steering remain distinct.
271 src/config/sessions/session-history-archive-pruning.ts READ — Retained: canonical and legacy archives have different ownership/removal contracts, while reclamation and measurement already use their canonical owners.
269 src/config/sessions/session-accessor.sqlite-entry-availability.ts READ — Retained exact-key versus identity fallback evidence, ambiguous/corrupt-row isolation, and per-physical-store batch semantics.
267 src/config/resolution-facts.ts READ - Retained authoritative path provenance, escaped-reference distinction and rewrite invalidation; combining lookups would obscure distinct reference states.
267 src/config/sessions/session-accessor.sqlite-transcript-reports.worker.ts READ. Returned the existing refusal resolver result directly without an intermediate local; worker admission and commit ordering unchanged.
266 src/config/sessions/skill-prompt-blobs.ts READ — Retained Doctor-compatible content-addressed artifacts, cache mtime/hash validation and precommit touch; all exports have live consumers.
265 src/config/utility-model-separation-migration.ts READ — Retained legacy primary pinning, dynamic environment deferral and roster-specific write paths; frozen migration behavior.
264 src/config/schema.help.models.ts READ — Retained public model/provider/transport/memory help and exact wording; no execution flow to consolidate.
264 src/config/sessions/session-accessor.sqlite-reset.ts READ — Added on the final base. Retained offline preview, archive ownership hashes, post-await database and inventory revalidation, admission fences, transaction boundaries, and post-commit cleanup; each protects a distinct reset boundary.
262 src/config/sessions/session-accessor.sqlite-maintenance-age.ts READ — Retained: capture identity, transaction staging, conservative age advancement, and bounded foreign-write recheck are lifecycle facts rather than redundant checks.
261 src/config/sessions/session-transcript-search.ts READ — Retained: FTS virtual-table decoding, logical agent filters, read snapshots and host-owned reconciliation are required query boundaries.
260 src/config/sessions/targets-read-availability.ts READ — Retained unavailable-versus-missing distinctions and fixed/per-agent ownership proof; synchronous reader migration is outside behavior-neutral cleanup.
259 src/config/include-write-boundary.ts READ — No sound remaining consolidation: root-read-only, deepest-owner, physical-file reuse, array-boundary, and keyed-roster checks enforce different ownership constraints.
257 src/config/sessions/store-maintenance-operations.ts READ — Unified warn/enforce disk-budget and report completion; retained mode-specific warning/retention work and artifact-before-budget ordering.
252 src/config/model-provider-config.ts READ — Retained exact/authored row priority, lazy fallback projection and reentrant callback safeguards from the recent provider refactor.
252 src/config/sessions/session-accessor.sqlite-archive-store-kernel.ts READ. Keep direct narrow Kysely dependency: importing heavy session scope would undo recent archive bootstrap isolation. Immutable publication identity and conflict byte comparison are persistence contracts.
250 src/config/tools-by-sender.ts READ — Retained typed identity precedence, channel scoping and bounded deprecation warning cache; public legacy ID compatibility remains required.
249 src/config/sessions/session-entry-codec.ts READ — Retained indexed/opaque/legacy parser distinctions and original payload preservation; schemas and migration acceptance unchanged.
248 src/config/io.write-topology.ts READ - Retained agent/include/session-store ownership preparation and explicit-set projection; no default or migration contract changes.
248 src/config/sessions/session-placement-evidence.ts READ — Migrated removed SQLite key-normalization wrapper to normalizeStoreSessionKey canonical owner; retained source custody and unknown-evidence rules.
247 src/config/schema.help.agents.ts READ — Retained distinct default/per-agent settings and plugin policy help; repeated topic names document different precedence/ownership.
246 src/config/sessions/conversation-identity.ts READ — Reused canonical lowercase normalization and ChatType, simplified kind fallback, and normalized optional metadata once; preserved inbound and paired-route authority, sparse fields, and fractional numeric thread IDs.
241 src/config/channel-alias-migration.ts READ — Retained declarative channel migration owner with channel-specific delivery and inheritance differences; no second policy implementation remains.
239 src/config/sessions/session-accessor.sqlite-raw-delta-read.ts READ — APPLIED: import ResolvedTranscriptReadScope from its canonical type owner; cursor validation, limits, read fences, and byte-bound paging are unchanged.
236 src/config/sessions/session-accessor.sqlite-canonical-worker-pool.ts READ — Retained task-drain, readiness, abort, native custody, and failed-retirement states; collapsing them would change worker lifecycle semantics.
233 src/config/schema.hints.ts READ — Retained metadata composition, plugin namespace filtering and sensitive-path lifecycle; shared field walkers already own traversal.
233 src/config/types.openclaw.ts READ — Retained public root and snapshot types, branded lifecycle states, authored provenance and legacy data contracts; prior passes derived leaf contracts.
230 src/config/validation.ts READ — Retained raw preparation, immutable async metadata boundary, strict-fact validation and legacy ownership sidecar preservation.
228 src/config/sessions/goals.ts READ — Retained user-facing transition/error outcomes, explicit display-only reads and durable goal event ordering; transitions already share their owner.
227 src/config/sessions/plugin-host-cleanup.ts READ — Retained registry-owned slot pruning versus all-plugin state cleanup, locked harness preservation and normalized session selection.
227 src/config/sessions/session-accessor.sqlite-lifecycle-types.ts READ — Retained: cloneable plans and discriminated results encode distinct operation semantics, including maintenance stale/preservation outcomes.
226 src/config/backup-rotation.ts READ — Final-base addition from #159605. Retained descriptor/path identity guards, live write authority, best-effort backup preparation, atomic publication ordering, and pre-update snapshot retry semantics; each protects a distinct recovery boundary.
223 src/config/io.runtime-write-finalization.ts READ - Constructed the post-commit error once after rollback while preserving original or aggregate cause and status.
223 src/config/sessions/session-transcript-read-fence.ts READ — Retained: question-answer custody and current-turn visibility validate different authority; durable row checks cannot be replaced by matching IDs.
222 src/config/io.observe.ts READ - Retained sync/async read admission and fingerprint-only change detection; repeated async fences protect different awaited effects.
220 src/config/zod-schema.channel-messaging-common.ts READ — Retained generic shared account, reaction, bot and approval constructors; defaults must remain root-only and caller-specific enums stay narrow.
217 src/config/group-policy.ts READ — Removed naming-only GroupPolicyChannel alias in favor of the imported ChannelId owner; retained selected scope and allowlist precedence.
217 src/config/merge-patch.ts READ - Retained RFC object/null behavior, opt-in ID-array merging and conflict detection; previous passes already removed shared traversal duplication.
216 src/config/legacy.roster.ts READ — Retained shipped list ordering, explicit ownership migration and weak-map default-agent provenance; no migration edits.
216 src/config/sessions/session-accessor.sqlite-archive-artifact.ts READ. Doctor legacy filename publication and canonical registry-byte publication serve different contracts; fsync/readback and collision behavior must remain distinct.
216 src/config/sessions/session-accessor.sqlite-maintenance-candidates.ts READ — Retained: indexed candidate scans preserve SQLite byte ordering, malformed-row parser behavior, exact exclusions, and tie-breaking.
216 src/config/sessions/session-accessor.sqlite-recovery.ts READ — Direct clone/normalizer operations and readonly target inputs remove duplicate copies; recovery transaction and tombstone guards unchanged.
216 src/config/sessions/session-canonical-validation-readiness.ts READ — Retained worker admission, shared drain lifetime, contention sequence and validation-generation checks.
216 src/config/validation-channel-rules.ts READ — Removed trivial enabled and string-formatting wrappers; retained DM inheritance and wildcard warning semantics.
215 src/config/sessions/session-accessor.sqlite-entry-admission.ts READ — Retained distinct incognito/native and worker admission lifetimes, captured environment, physical identity and authority rechecks, and explicit claim transfer/release; the reply-admission caller depends on those ownership fences across awaits.
215 src/config/sessions/session-accessor.sqlite-pending-inputs-repair.ts READ. Accepted-input and terminal-completion copies have different authority, conflict, ordering, and finality rules; no common policy abstraction is justified.
215 src/config/sessions/session-transcript-projection-writer.ts READ — Retained: worker publication and incognito/native publication have different transaction owners; native fallback and commit notifications remain unchanged.
213 src/config/sessions/session-entry-provenance.ts READ — Retained creator/owner differences, incognito inheritance exclusions, normalized attribution and write-once fields.
211 src/config/sessions/session-accessor.lifecycle.ts READ — Retained ordered patch projection, per-target authorization and plugin cleanup selection; public adapter adds genuine batch semantics.
210 src/config/sessions/session-accessor.sqlite-contract.ts READ — Retained: diagnostic discriminants stay in this leaf contract; deriving them from reclamation and cold-mutation plans introduced an architecture import cycle, so that attempted simplification was reverted.
210 src/config/sessions/targets-collision.ts READ — Retained physical versus logical grouping, registry precedence, exact shared-store survival and ownership diagnostics.
209 src/config/sessions/session-accessor.sqlite-branch-summaries.ts READ. #159309 introduced append-safe prefix certification; graph path and headline memoization avoid different rescans and are not duplicate implementations.
207 src/config/sessions/session-history-types.ts READ — Grew on the final base. Retained canonical request/result discriminants and owner-derived reader types; anchored paging, encoded responses, and subagent facts have distinct contracts.
206 src/config/sessions/session-accessor.sqlite-history-navigation.ts READ. Raw and active traversal share parsing/filter owners already; joins and ordering differ. Further abstraction would require a query-policy interface larger than the duplication.
206 src/config/sessions/session-accessor.sqlite-transcript-stats.ts READ — Simplified repeated null/undefined timestamp checks while preserving optional-property omission. Point and batch reads retain their distinct costs, orphan-row coverage, and snapshot ownership.
206 src/config/types.telegram.ts READ — Retained channel SDK types and documented account/topic/direct differences, including legacy webhook migration inputs.
205 src/config/sessions/session-accessor.sqlite-participant-projection.ts READ — Retained: prepared/cache/native projection order and batch failure isolation matter; schema admission changes are outside this frozen persistence pass.
205 src/config/sessions/session-accessor.transcript.ts READ — Retained: public facade reexports keep storage loading boundaries, and compact normalization preserves visible ancestry, invalid controls and retained checkpoints.
204 src/config/sessions/group.ts READ — Retained provider-owned opaque group IDs and legacy plugin route contracts; group title/name projections intentionally differ.
203 src/config/sessions/session-accessor.lifecycle-types.ts READ — Retain. These are canonical lifecycle command/result types. Discriminated expected-raw deletion and entry/buildEntry upsert shapes prevent invalid operations; field deletion for count would weaken real contracts.
182 src/config/sessions/session-model-context-projection.ts READ — Retained SQL first-key versus JSON last-key archive behavior, Unicode/size admission and model-only projection without changing stored bytes.
171 src/config/channel-doctor-helpers.ts READ — Retained distinct recursive/root-and-account retirement and default-account streaming inheritance; one migration responsibility per helper.
157 src/config/sessions/session-accessor.sqlite-worker-coordination.ts READ — Retained: whole-request and reconciliation phase delegates own different native lifetimes; cleanup joins and uncertain-outcome handling stay intact.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 10:14
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 5ccdecd3774388e618d1aa1bbb4041ad3ede11fd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/config/official-external-channel-secret-schema.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/types.tools.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 8:31 PM ET / September 29, 2026, 00:31 UTC (Revision 32).

ClawSweeper review

What this changes

The branch removes redundant configuration and session-storage forwarding and type layers, and consolidates maintenance and receipt handling without an intended user-visible change.

Merge readiness

⛔ Blocked before merge - 4 items remain

Current main still lacks this cleanup. No discrete defect was established in the reviewed high-risk paths, but a complete existing-installation upgrade against the integrated candidate remains unproven.

Priority: P3
Reviewed head: 5ccdecd3774388e618d1aa1bbb4041ad3ede11fd

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The broad cleanup has substantial scoped validation and no established code finding, but the integrated published-updater path remains unfinished.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer PR changes configuration and session-storage owners; its captured body records relevant Testbox CLI and boundary exercises, while the published updater preserves initial state but stops in Doctor. No stored-data format change was identified, and combined upgrade completion remains a separate merge risk.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer PR changes configuration and session-storage owners; its captured body records relevant Testbox CLI and boundary exercises, while the published updater preserves initial state but stops in Doctor. No stored-data format change was identified, and combined upgrade completion remains a separate merge risk.
Evidence reviewed 11 items Introduced cleanup: The pinned branch diff replaces forwarding calls in session fork and maintenance paths while retaining the existing storage operations and guards.
Still distinct from main: Current main retains the thread-info forwarding module removed by this branch; the earlier merged cleanup passes did not absorb the entire change.
Sensitive-path review: The SecretRef schema edit replaces a private clone helper with structuredClone; the helper already called structuredClone. The tool-policy typed-key edit retains the same prefix matching.
Findings None None.
Security None None.

How this fits together

OpenClaw loads and writes user configuration, while session storage records conversation identity, transcripts, and recovery state. Doctor, the Gateway, agent tools, and channel delivery consume those results.

flowchart LR
A[Authored config] --> B[Config validation and writes]
B --> C[Gateway and Doctor]
D[Existing sessions] --> E[Session storage workers]
C --> E
E --> F[Transcripts and recovery]
F --> G[Agent turns and delivery]
Loading

Before merge

  • Resolve merge risk (P1) - An upgrade from published 2026.9.6 has not completed against a candidate containing both this refactor and the open Doctor repair at fix(doctor): preserve the live plugin index during read-only checks #160400, so existing-installation compatibility remains unverified after Doctor.
  • Complete next step (P2) - Confirm that the published 2026.9.6 updater completes Doctor and Gateway startup on the integrated candidate after the Doctor repair lands.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: database schema: src/config/schema.lookup.ts, migration/backfill/repair: src/config/sessions/session-transcript-worker.types.ts, unknown-data-model-change: src/config/schema.ts, unknown-data-model-change: src/config/sessions/session-accessor.sqlite-transcript-write.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove the combined upgrade (recommended)
    After the Doctor repair lands, verify that the published 2026.9.6 updater completes Doctor and Gateway startup with this refactor and preserves existing configuration and sessions.

Technical review

Best possible solution:

Keep one configuration and session-storage owner for each responsibility while preserving existing settings, SecretRefs, and session state through a complete installed update.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR claims behavior-preserving cleanup rather than a new bug. Its reported Doctor failure belongs to a separately owned path.

Is this the best way to solve the issue?

Yes at the code-structure level: direct owner calls and shared result assembly fit the cleanup. Complete upgrade proof is still needed to establish behavior preservation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 11bbab871ec8.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 compatibility: The branch touches configuration and session-storage paths, but its integrated published-updater upgrade has not completed.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer PR changes configuration and session-storage owners; its captured body records relevant Testbox CLI and boundary exercises, while the published updater preserves initial state but stops in Doctor. No stored-data format change was identified, and combined upgrade completion remains a separate merge risk.

Evidence

What I checked:

  • Introduced cleanup: The pinned branch diff replaces forwarding calls in session fork and maintenance paths while retaining the existing storage operations and guards. (src/config/sessions/session-accessor.sqlite-parent-session.ts:93, 5ccdecd37743)
  • Still distinct from main: Current main retains the thread-info forwarding module removed by this branch; the earlier merged cleanup passes did not absorb the entire change. (src/config/sessions/thread-info.ts:1, 11bbab871ec8)
  • Sensitive-path review: The SecretRef schema edit replaces a private clone helper with structuredClone; the helper already called structuredClone. The tool-policy typed-key edit retains the same prefix matching. (src/config/official-external-channel-secret-schema.ts:28, 5ccdecd37743)
  • Existing clone contract: The removed schema helper's implementation was a direct structuredClone call. (src/config/schema.shared.ts:28, 80fd8670e37b)
  • Local web-search boundary: The changed allowed-domain normalization feeds OpenClaw's own OpenAI Responses web-search payload builder; the inspected hunk does not change a sibling Codex harness or runtime contract. (src/agents/codex-native-web-search-core.ts:166, 5ccdecd37743)
  • Captured PR proof: The live body matches the supplied 64,524-unit source hash. It records Testbox config and session checks, but says the published 2026.9.6 updater stopped in Doctor after preserving configuration, environment references, and sessions; separate Doctor proof is not integrated-branch proof.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Show Doctor completing under the published 2026.9.6 updater against a candidate containing both this refactor and the Doctor repair.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (31 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T09:16:42.299Z sha 4e28aa0 :: blocked before merge. :: none
  • reviewed 2026-09-28T14:52:13.078Z sha 926ec0a :: blocked before merge. :: none
  • reviewed 2026-09-28T16:07:30.304Z sha 926ec0a :: blocked before merge. :: none
  • reviewed 2026-09-28T17:47:13.597Z sha 272bef1 :: blocked before merge. :: none
  • reviewed 2026-09-28T19:18:16.167Z sha 272bef1 :: blocked before merge. :: none
  • reviewed 2026-09-28T23:12:07.665Z sha 6da7c4576e65e8415c3e0d0961f61c191bd936e2 :: blocked before merge. :: none
  • reviewed 2026-09-28T23:51:34.454Z sha f45b543 :: blocked before merge. :: none
  • reviewed 2026-09-29T00:02:17.899Z sha f45b543 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 27, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 27, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-config4 branch 2 times, most recently from 236ebe3 to 8e48552 Compare September 28, 2026 04:55
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-config4 branch 2 times, most recently from b88fa5d to 16e16a4 Compare September 28, 2026 07:24
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-config4 branch 3 times, most recently from 4e28aa0 to 926ec0a Compare September 28, 2026 14:35
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-config4 branch 2 times, most recently from 272bef1 to 6da7c45 Compare September 28, 2026 22:58
@steipete
steipete enabled auto-merge (squash) September 28, 2026 23:56
@steipete
steipete merged commit b4d93d2 into main Sep 29, 2026
213 checks passed
@steipete
steipete deleted the deslop/l119-config4 branch September 29, 2026 00:44
steipete added a commit that referenced this pull request Sep 29, 2026
Take the private result-alias cleanup from b4d93d2
(#159588) without importing unrelated main changes. Keep the canonical
input declaration position while preserving the native selector, request
fields, and distributive prepared-input union.

The emitted runtime is unchanged. Core and worker-owner test types,
scoped lint, formatting, and independent review pass; the qualified native
runtime proof remains applicable.
steipete added a commit that referenced this pull request Sep 29, 2026
* fix(subagents): await native Stop persistence

Move native cancellation reads and writes through the existing worker owners while retaining exact run, session, queue and source authority. Join claim publication, terminal settlement and cleanup, preserve earlier completion, and fence uncertain writes without replay.

Validated registered Stop with real SQLite, public Gateway create/turn/Stop/describe, native lifecycle and scheduler controls, all changed checks, archive E2E and the full build.

* fix(subagents): preserve optional snapshot owner shape

* test(subagents): await finite lifecycle settlement

* ci: consume canonical UI component type shard

Take the exact landed shard repair so the native Stop branch retains all compiler roots under the unchanged budget. No native cancellation source changes.

Receiving proof passes 35 routing cases, both UI type graphs, selected changed checks, and independent review. The original 721-root baseline failure remains attributed to main.

(cherry picked from commit 52ae7e3)

* test(agents): register native cancellation fixtures through real owner

Replace resident-only run seeding and no-op persistence with awaited canonical registration. Preserve owner, foreign-run, generation-replacement, and real ACP interrupt assertions.

* test(subagents): preserve canonical controller and abort fixtures

Keep real controller resolution in tool tests and register the orphaned child through real session and registry persistence. Preserve all original cancellation assertions and isolate the running-child wait transport.

* test(agents): match restored requester batch wake messages

Update the held model fixture to recognize the batch-scoped completion prompt introduced by #158642. Preserve the two-active, third-queued, ordinary-probe, runtime-budget, and cleanup assertions.

Verified on the exact native cancellation CI merge: the original four-case order reproduced three passes and the stale-marker failure, then all four passed with this single-line correction. Owning changed checks and independent review passed.

* test(gateway): keep abort append faults connection-local

* fix(subagents): retire superseded timing reads without false warnings

* fix(subagents): retain finite completion reconciliation work

* test(gateway): preserve real descendant abort fixture custody

* test(ui): await settled native composer layout

Wait for the existing layout-settled contract after viewport changes before measuring native composer footer clearance. ResizeObserver updates transcript width asynchronously while the footer follows its container immediately. Preserve every geometry formula, threshold, and variant order.

Validation: six native-plugin UI cases, UI E2E types, scoped lint, formatting, and isolated review passed. Linux baseline passed; candidate remote attempts stopped during source synchronization before test execution.

* test(subagents): use real abort persistence and publication barriers

* fix(agents): fence collector adoption during cancellation

Pending Swarm collectors can receive an aborted Gateway response while Stop is
still persisting cancellation. Begin the existing kill claim immediately after
native admission drains, then refuse launch adoption while its write is pending.
This preserves cancellation publication before provisional-session cleanup and
retains the current caller, session, generation, and database authority checks.

Cover queued and already-started collectors whose acknowledgment races a pending
kill write. Preserve the original three Gateway preaccept Stop cases and their
publication, rollback, and timeout assertions.

Validation: causal regression RED/GREEN; 273 focused and sibling tests; original
18-file shard with 264 tests; full check-changed including all 26 core test type
graphs; independent P2 review with no actionable findings.

* test(subagents): join canonical registry completion before assertions

Reuse existing finite lifecycle/root-work settlement in collector-yield and completion-before-kill fixtures. Preserve their original assertions, order, and timeouts.

Validation: original-order regression diagnosis; twenty standalone and two original 33-file replays passed; unchanged completion siblings reuse the qualified timing shard receipt; owning changed checks and independent component/combined P2 reviews passed. A third stress replay was interrupted by provider shutdown and is not counted as a test result. Current-head hosted CI remains required.

* fix(tooling): stop reporting lazy imports as duplicate exports (#160558)

Recognize transparent literal dynamic-import forwarders in the shared export-collision guard while preserving member, argument and body restrictions. Both variable and inline forwarding paths use the same predicate; runtime behavior is unchanged.

Validation: original guard reproduces nine repository false positives and fails all three new positive fixtures. Candidate passes the repository guard and all 54 fixtures, including six new rejection cases, under a 7 GiB process-tree limit with swap disabled. Script types and formatting pass. Independent and exact-head ClawSweeper reviews identify no actionable findings.
(cherry picked from commit f010fc0)

* fix(agents): join registry writes before follow-up adoption

A child follow-up can reach source replacement while its ended-hook stamp
is still in the registry worker. Join the existing write owner before the
exact durable comparison, retaining uncertain-write errors and rechecking
the selected source and admitted caller after every await.

Carry sessions.send session authorization through the same boundary. Cover
held real writes, caller retirement, and source replacement.

* test(ui): consume canonical composer readiness check

Use the exact helper postimage from d64568e (#160266). The canonical committed-size wait supersedes this branch's layout quiet-window variation while preserving every geometry assertion and viewport order.

Validation: canonical Linux native-plugin E2E six cases and exact-head CI pass; helper and layout-owner source bindings verified; formatting, diff checks, and independent P0-P2 review pass. Native cancellation production is unchanged.

Co-authored-by: Kimi Yu <[email protected]>

* test(codex): separate protocol timing from startup cost

Keep protocol fixtures on their existing controlled deadline clock and measure unattended denial from the review-required hook to the actual decline. Preserve model, transport, history and approval assertions, the existing bounds, and all production clock and executable-integrity behavior.

Validation: identical latency controls change four failures to four passes; the original six-file envelope passes 34 tests, with eight deadline and three no-approval-request siblings. Selected changed checks and independent P0-P2 review pass. The original Unix 120-second stall was not independently reproduced; current-head CI remains required.

* refactor(config): align canonical worker result types

Take the private result-alias cleanup from b4d93d2
(#159588) without importing unrelated main changes. Keep the canonical
input declaration position while preserving the native selector, request
fields, and distributive prepared-input union.

The emitted runtime is unchanged. Core and worker-owner test types,
scoped lint, formatting, and independent review pass; the qualified native
runtime proof remains applicable.

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Kimi Yu <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
* refactor(config): deslop config fourth pass

* refactor(config): preserve leaf contracts and trim test mocks

* refactor(config): finish fourth-pass owner cleanup

* refactor(config): remove obsolete transcript line suppression

* refactor(config): prune stale transcript line-cap baseline
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…aw#160203)

* fix(subagents): await native Stop persistence

Move native cancellation reads and writes through the existing worker owners while retaining exact run, session, queue and source authority. Join claim publication, terminal settlement and cleanup, preserve earlier completion, and fence uncertain writes without replay.

Validated registered Stop with real SQLite, public Gateway create/turn/Stop/describe, native lifecycle and scheduler controls, all changed checks, archive E2E and the full build.

* fix(subagents): preserve optional snapshot owner shape

* test(subagents): await finite lifecycle settlement

* ci: consume canonical UI component type shard

Take the exact landed shard repair so the native Stop branch retains all compiler roots under the unchanged budget. No native cancellation source changes.

Receiving proof passes 35 routing cases, both UI type graphs, selected changed checks, and independent review. The original 721-root baseline failure remains attributed to main.

(cherry picked from commit e7f5a85)

* test(agents): register native cancellation fixtures through real owner

Replace resident-only run seeding and no-op persistence with awaited canonical registration. Preserve owner, foreign-run, generation-replacement, and real ACP interrupt assertions.

* test(subagents): preserve canonical controller and abort fixtures

Keep real controller resolution in tool tests and register the orphaned child through real session and registry persistence. Preserve all original cancellation assertions and isolate the running-child wait transport.

* test(agents): match restored requester batch wake messages

Update the held model fixture to recognize the batch-scoped completion prompt introduced by openclaw#158642. Preserve the two-active, third-queued, ordinary-probe, runtime-budget, and cleanup assertions.

Verified on the exact native cancellation CI merge: the original four-case order reproduced three passes and the stale-marker failure, then all four passed with this single-line correction. Owning changed checks and independent review passed.

* test(gateway): keep abort append faults connection-local

* fix(subagents): retire superseded timing reads without false warnings

* fix(subagents): retain finite completion reconciliation work

* test(gateway): preserve real descendant abort fixture custody

* test(ui): await settled native composer layout

Wait for the existing layout-settled contract after viewport changes before measuring native composer footer clearance. ResizeObserver updates transcript width asynchronously while the footer follows its container immediately. Preserve every geometry formula, threshold, and variant order.

Validation: six native-plugin UI cases, UI E2E types, scoped lint, formatting, and isolated review passed. Linux baseline passed; candidate remote attempts stopped during source synchronization before test execution.

* test(subagents): use real abort persistence and publication barriers

* fix(agents): fence collector adoption during cancellation

Pending Swarm collectors can receive an aborted Gateway response while Stop is
still persisting cancellation. Begin the existing kill claim immediately after
native admission drains, then refuse launch adoption while its write is pending.
This preserves cancellation publication before provisional-session cleanup and
retains the current caller, session, generation, and database authority checks.

Cover queued and already-started collectors whose acknowledgment races a pending
kill write. Preserve the original three Gateway preaccept Stop cases and their
publication, rollback, and timeout assertions.

Validation: causal regression RED/GREEN; 273 focused and sibling tests; original
18-file shard with 264 tests; full check-changed including all 26 core test type
graphs; independent P2 review with no actionable findings.

* test(subagents): join canonical registry completion before assertions

Reuse existing finite lifecycle/root-work settlement in collector-yield and completion-before-kill fixtures. Preserve their original assertions, order, and timeouts.

Validation: original-order regression diagnosis; twenty standalone and two original 33-file replays passed; unchanged completion siblings reuse the qualified timing shard receipt; owning changed checks and independent component/combined P2 reviews passed. A third stress replay was interrupted by provider shutdown and is not counted as a test result. Current-head hosted CI remains required.

* fix(tooling): stop reporting lazy imports as duplicate exports (openclaw#160558)

Recognize transparent literal dynamic-import forwarders in the shared export-collision guard while preserving member, argument and body restrictions. Both variable and inline forwarding paths use the same predicate; runtime behavior is unchanged.

Validation: original guard reproduces nine repository false positives and fails all three new positive fixtures. Candidate passes the repository guard and all 54 fixtures, including six new rejection cases, under a 7 GiB process-tree limit with swap disabled. Script types and formatting pass. Independent and exact-head ClawSweeper reviews identify no actionable findings.
(cherry picked from commit 34f3dab)

* fix(agents): join registry writes before follow-up adoption

A child follow-up can reach source replacement while its ended-hook stamp
is still in the registry worker. Join the existing write owner before the
exact durable comparison, retaining uncertain-write errors and rechecking
the selected source and admitted caller after every await.

Carry sessions.send session authorization through the same boundary. Cover
held real writes, caller retirement, and source replacement.

* test(ui): consume canonical composer readiness check

Use the exact helper postimage from 47c33fe (openclaw#160266). The canonical committed-size wait supersedes this branch's layout quiet-window variation while preserving every geometry assertion and viewport order.

Validation: canonical Linux native-plugin E2E six cases and exact-head CI pass; helper and layout-owner source bindings verified; formatting, diff checks, and independent P0-P2 review pass. Native cancellation production is unchanged.

Co-authored-by: Kimi Yu <[email protected]>

* test(codex): separate protocol timing from startup cost

Keep protocol fixtures on their existing controlled deadline clock and measure unattended denial from the review-required hook to the actual decline. Preserve model, transport, history and approval assertions, the existing bounds, and all production clock and executable-integrity behavior.

Validation: identical latency controls change four failures to four passes; the original six-file envelope passes 34 tests, with eight deadline and three no-approval-request siblings. Selected changed checks and independent P0-P2 review pass. The original Unix 120-second stall was not independently reproduced; current-head CI remains required.

* refactor(config): align canonical worker result types

Take the private result-alias cleanup from 886db07
(openclaw#159588) without importing unrelated main changes. Keep the canonical
input declaration position while preserving the native selector, request
fields, and distributive prepared-input union.

The emitted runtime is unchanged. Core and worker-owner test types,
scoped lint, formatting, and independent review pass; the qualified native
runtime proof remains applicable.

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Kimi Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant