Skip to content

refactor(gateway): deslop server methods and worker environments second pass - #161284

Merged
steipete merged 3 commits into
mainfrom
deslop/l176-gateway-methods2
Sep 29, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/l176-gateway-methods2

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes redundant Gateway request and worker-environment code left after the first subsystem pass, keeping validation, result projection, and lifecycle decisions with their existing owners.

User Impact

No user-visible behavior change is intended. Gateway protocol and RPC names, parameters, results, and errors remain unchanged, as do authorization and current-owner revalidation, worker lifecycle/fencing, and persisted state. Config writes retain their existing CAS, secret preparation, restart handoff, and response ordering; no update or migration behavior changes.

Related: #159752

Why This Change Was Made

The second pass removes 698 net production lines across 86 files (+818 / -1,516), entirely within src/gateway/server-methods/ and src/gateway/worker-environments/. No tests were added or changed. This is below the requested 1,000-line threshold after reading all 646 production files; the complete coverage log accounts for every one of the 272 production files over 200 lines, sorted by size. Recent merged changes and the first-pass name-only diff were inspected before implementation.

  • Share channel capability validation and node command authorization/error projection while retaining their method-specific errors and live checks.
  • Bind model-account and channel-identity operations through their existing request owners instead of repeating dispatch and error handling in every method.
  • Share APNs direct/relay transport selection and host/node desktop observation handling without changing credential selection or result errors.
  • Share message-route retention updates and inline its sole-use replay forwarder, preserving lock release before replay and expiry after settlement.
  • Fold command replies directly as dispatch operations, retaining raw-payload cloning, prepared-writer separation, and media semantics; derive completion flags from the existing deduplication sets.
  • Reuse transcript mirror, session-spawn, secret resolution, and transfer types from their owners instead of maintaining parallel shapes.
  • Reuse canonical hashing and remove redundant validated-data checks and intermediate collections.
  • Remove config, profile, skill-revision, terminal, and checkpoint forwarding layers while retaining exact targets across awaited work.
  • Share worker-tool error serialization, provisioning event projection, and placement admission/settlement mechanics.
  • Remove redundant callback forwarding, narration, and unused local exports. Legacy synchronous SQLite cleanup was withdrawn rather than expanding this pass into a worker migration.

Evidence

Current candidate: a2daaec56f0afb287d07530ed16875fefb926f2e, tree 4d5471b2d296ec949eaea770de22bf1e1b8dbc6e, based on bda22f818d967ffa3551b3a729d5bc43863844c7. The PR remains draft because runtime proof is incomplete.

Current-tree Blacksmith Testbox proof on tbx_01m3qarsr373gz9h858gt8pqha (lease Actions run) passed:

  • Original failing 50-file Gateway group: 49 files passed, one existing skipped file; 582 tests passed, one existing skipped test (391s including preparation).
  • pnpm protocol:check: zero drift (3s).
  • pnpm plugin-sdk:check-exports and pnpm plugin-sdk:surface:check: passed.
  • Six import-boundary suites: 71 tests passed (55s).
  • node scripts/check-changed.mjs --base bda22f818d967ffa3551b3a729d5bc43863844c7 --timed: passed (1,838s), including all 27 test type graphs, core types, lint, guards, and zero unused exports.
  • pnpm build: passed (388s); tracked source remained clean afterward.
  • Runtime phases 1–10: passed, covering 329 selected files. Phase 11 was interrupted by lease cancellation and is not counted as passed.

The complete runtime selection contains 1,276 file/project memberships across 50 bounded native-config groups, including both subtrees and 539 current importer/entrypoint tests. Native discovery checks the exact membership before execution. Selection digest: 9804944d3510a2fa90095384b2c0acd358fa6b2efcd7ac8f89020825d9f7cfb9. Phases 11–50 remain pending; existing native exclusions and platform/opt-in skips are unchanged.

The original runtime proof exposed a stale fixture in server-worker-placement-startup.test.ts: a one-shot mock replaced the session during the initial read, then restored the original session before the authority check. Main already fixed this in 9d9c8568c51. The scoped replacement now survives every read and asserts that recovery never starts. This branch incorporates that existing fix; it adds no duplicate fixture patch. git range-diff confirms all three cleanup commits are patch-identical after the rebase. Independent integration review found no concern in the incoming auth/catalog, cron, node-harness, publication, and worker snapshot ownership changes.

Independent P0–P2 reviews covered the cleanup and validation repair. Two findings were checked against the complete owners and rejected: unexpectedPatchError preserves SessionMutationAuthorizationChangedError.error, and the diagnostics projection is a const object whose reference remains live as fields change. The reports contain those findings, rather than a scoped-clean verdict; no accepted actionable finding remains. Withdrawing the three legacy storage cleanups passed its separate delta review with no P0–P2 findings.

Prior-tree proof is retained separately: tree 7096dd8caac22bed66ee8b2fd833874be4140da7 passed pnpm protocol:check with zero drift, SDK exports/surface checks, six import-boundary suites (71 tests), node scripts/check-changed.mjs --base 6f45aa4cf283225b8323d0c19f8f95a580e3ac61 --timed (1,407s, all 27 test type graphs, lint, guards, and zero unused exports), and pnpm build (443s). Sixteen bounded runtime phases completed before phase 17 exposed the inherited fixture failure. These results are not labeled as proof of the new tree.

All tests, validation checks, and builds ran remotely on Blacksmith Testbox. The last executing lease's Run Testbox step was cancelled at 21:00:30 UTC on September 29; the cancellation cause is unknown. Native stop confirmed that lease was already stopped. A subsequent branch-pinned warmup timed out without a lease ID, and provider creation/status/inventory requests also timed out. After inventory recovered, the complete native table and branch-specific workflow-dispatch query showed no matching allocation or run; the pending recovery key was retained.

One reconciled replacement attempt allocated tbx_01m3qhhh81rwnh9y7jqs4hwdt7 on the exact branch. It remained queued with no runner/IP throughout the native five-minute readiness wait, which timed out. No runtime tests started on that lease. The owned resume process was interrupted and native stop returned completed. All seven confirmed lane leases are stopped. Phases 11–50 remain blocked by Testbox availability; no local fallback was used, and no incomplete phase is reported as passed.

@clawsweeper

clawsweeper Bot commented Sep 29, 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 size: XL labels Sep 29, 2026
@steipete

steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Coverage log

All 646 original production files and the new shared transport helper were read. This table covers every production file over 200 lines in candidate tree 4d5471b2d296ec949eaea770de22bf1e1b8dbc6e, sorted by current size. Incoming production owners were reread after the patch-identical rebase onto bda22f818d967ffa3551b3a729d5bc43863844c7, which incorporates the existing recovery-fixture repair. Recent merged changes and the first-pass name-only diff were inspected before edits.

Complete coverage: 272 production files over 200 lines
Lines Production file Status Outcome
1203 src/gateway/server-methods/config.ts READ Inlined sole-use secret degradation, auth-change, cache-clear and noop-response forwarding while retaining CAS and response ordering.
1107 src/gateway/server-methods/agents.ts READ Deletion journal, path identity, survivor protection and post-commit cleanup fences are distinct; retain current owner.
1020 src/gateway/server-methods/cron.ts READ READ after pinned bda22f8: add/update compose retained creator-grant authority with session/caller commit guards for worker-backed mutation; each method retains existing RPC errors, replay and preview ordering.
950 src/gateway/server-methods/send.ts READ Read complete send, poll, and message.action flows; distinct provider dispatch, receipt reconciliation, partial delivery, idempotency, and post-await authority paths remain necessary after the first pass.
777 src/gateway/server-methods/doctor.ts READ Retained bounded top-eight selection, explicit public dreaming projections, and independent manager/store/cron failure contracts; recent sweeps already share action handling.
755 src/gateway/worker-environments/bootstrap.ts READ Retain generated remote installation, lock recovery, ordered receipt comparison, and operation-owned upload cleanup; phases protect different effects.
746 src/gateway/worker-environments/node-worker-tunnel.ts READ Retain exact epoch/build binding, native quiescence acquisition custody, ambiguous workspace drain and stop settlement; recent fixes already own these flows.
739 src/gateway/worker-environments/provider-lifecycle.ts READ Retain provisioning replay, allocation settlement, cancellation transfer and build admission; each guard protects an awaited owner boundary.
731 src/gateway/server-methods/chat-abort-runtime.ts READ READ after #161124: queued collector cancellation publishes inside withReadySessionRows while the kill owner retains custody; exact captured generation and caller authority remain fenced, and transient publicationRows is cleared in finally. Worker cancellation capture now uses chat-abort-ops.
729 src/gateway/worker-environments/service.ts READ Retained independent environment/provider queues, shutdown settlement, reconciliation guard lifetime, and explicit request-facing projection.
727 src/gateway/server-methods/update.ts READ Read complete update flow; preserved admitted requester lifetime, campaign adoption, managed/foreground handoff ownership, restart sentinel custody, and public outcome projection.
724 src/gateway/server-methods/sessions-patch-engine.ts READ Retain ordered group admission, catalog replay, label uniqueness, and target-specific synchronous commit guards; branches do not share interchangeable effects.
721 src/gateway/worker-environments/inference.ts READ Retain admission/replay barriers, source authority after awaits, bounded provider overlap and unknown-write settlement; no equivalent simpler owner found.
718 src/gateway/server-methods/chat-send-admission.ts READ Retain pre-registration, writer-barrier selection, exact reservation and lifecycle cleanup authority checks.
717 src/gateway/server-methods/chat-send-agent-dispatch.ts READ Retain ACK-to-dispatch custody, reply-progress title gate, queued adoption and runtime terminal classification.
715 src/gateway/worker-environments/local-workspace-projection.ts READ Retained the legacy synchronous SQLite path unchanged; a proper worker migration exceeds this behavior-preserving cleanup scope.
715 src/gateway/worker-environments/placement-dispatch-startup.ts READ Retain reserve binding, node eligibility and post-await activation fences; cold provision and recovery have distinct custody.
714 src/gateway/server-methods/approval-shared.ts READ Shared one immutable lookup argument set between pending and resolved lookups; retained all post-await authority checks.
712 src/gateway/server-methods/chat-send-reply-dispatch.ts READ Derive media-publication completion from the existing finalized transcript key set instead of a duplicate boolean.
711 src/gateway/server-methods/sessions-abort.ts READ Removed unused export and module narration; exact admitted-target matching, controller/embedded/queued cancellation and settlement ordering remain distinct.
709 src/gateway/server-methods/sessions-rewind.ts READ Retain upstream/local fork, rewind, and branch-switch contracts and owner fences; inference-cast removal requires an outside-scope SDK fixture cutover.
705 src/gateway/worker-environments/node-workspace-transfer-service.ts READ Share one TransferBinding shape across contexts and both capabilities; retain operation-specific expiry, publication and upload settlement.
705 src/gateway/worker-environments/worker-turn-launcher.ts READ Shared the four provisioning event projections; passed optional publication callbacks directly to internal execution owners, preserving all admission and recovery fences.
703 src/gateway/worker-environments/node-bootstrap-artifact.ts READ Retain immutable artifact verification, package import closure, stream backpressure, prebuilt parity and consumer pin lifetime; checks cover distinct hazards.
701 src/gateway/server-methods/question.ts READ Retained manager/session observation identity, narrow-run grants, publication fallback boundaries, and secret-store settlement; generic consolidation would hide distinct authority lifetimes.
698 src/gateway/server-methods/chat-metadata-runtime.ts READ Retained generation publication, request-local personal catalogs, exact pending-entry settlement, and shutdown joining; apparent duplicate reads protect owner replacement across yields.
698 src/gateway/server-methods/chat-send-handler.ts READ Distinct original-input custody, Goal atomic commit, upload admission and post-ACK transfer boundaries remain required.
697 src/gateway/server-methods/chat-abort-handler.ts READ Retained exact-target authorization, pending-input withdrawal custody, descendant cancellation, and committed-partial settlement boundaries. Re-read after #161124 (124ddc0): worker inference capture moved unchanged into chat-abort-ops; queued collector publication now carries the current prepared row view synchronously under kill custody. Existing transcript partial settlement remains after cancellation and independent of that publication frame; no conflict with this lane's reply/persistence cleanup.
697 src/gateway/server-methods/chat-send-pre-admission.ts READ Retained separate Stop, Goal retry, fingerprint conflict, recovery reconciliation, and admission guards; their error and replay contracts differ.
695 src/gateway/worker-environments/node-launch-adapter.ts READ Retain availability/RPC/cancellation deadline distinction, original-credential admission rearm and terminal receipt identity checks.
692 src/gateway/server-methods/sessions-sharing.ts READ Retain evidence-aware membership projection, public capability minting, and separate sharing mutation commit guards; error and publication boundaries differ.
688 src/gateway/server-methods/sessions-suggestions.ts READ Retain claim/release/finalize and typing-authority boundaries; suggestion ownership and queued typing receipts cannot be merged.
687 src/gateway/server-methods/tools-effective.ts READ Read inventory, MCP projection, cache generations, and dependency seams; pure base-cache refresh and harness-owned MCP catalogs have different lifetimes and cannot be collapsed safely.
686 src/gateway/server-methods/sessions-dispatch.ts READ Removed module narration; automatic retry, move, and reclaim carry distinct placement fences and error/publication contracts.
680 src/gateway/worker-environments/computer-transport.ts READ Use one commandIsAllowed owner for ordinary dispatch, dispatch revalidation and manual takeover; keep every live run/placement/policy guard.
680 src/gateway/worker-environments/workspace-quiescence-scripts.ts READ Retain separate acquire/renew/resume/watchdog programs and bounded PID/start identity probes; script duplication preserves standalone recovery custody.
678 src/gateway/server-methods/sessions-create.ts READ Removed module narration; preserve initial-turn custody, repository/worktree creation, and committed-input authority ordering.
677 src/gateway/server-methods/models-list-result.ts READ Retained catalog owner, runtime-specific thinking projection, and configured/provider inventory branches with different availability and account-selection contracts.
677 src/gateway/server-methods/terminal.ts READ Removed catalog authorization forwarding layer; exact live node checks still run before policy and transport dispatch.
676 src/gateway/worker-environments/worker-turn-rpc.ts READ Retained distinct credential, turn, terminal cursor, transcript, live-event and inference admission contracts; first-pass inference sharing remains intact.
673 src/gateway/worker-environments/placement-dispatch-pending-results.ts READ First-pass settlement consolidation retained. Reread repository SQL worker cutover #161124: await repository get, retain agent/session/workspace identity checks, and revalidate prepared recovery immediately after that await; accepted, staged, missing and orphan result paths retain separate custody.
668 src/gateway/worker-environments/placement-store.ts READ Retain exact generation CAS, workspace conflict binding and worker publication; cosmetic SQL edits would require migration of legacy synchronous paths.
664 src/gateway/worker-environments/placement-dispatch-test-harness.ts READ Read support module; shared lifecycle fixture preserves real placement-store transitions and deliberate fault injection. Excluded from production count.
662 src/gateway/server-methods/nodes.invoke.ts READ Applied one command authorization/error projection for admission and final dispatch; preserved both config ceilings, all awaited pairing checks, transport deadlines and approval custody.
661 src/gateway/server-methods/devices.ts READ Retained exact device/token mutation authority and response-first disconnection; prior sweep already owns common denial/lifecycle handling.
660 src/gateway/server-methods/board.ts READ Widget content admission, live tickets, MCP reconstruction and per-operation publication differ; retain explicit handlers.
658 src/gateway/worker-environments/workspace-sync.ts READ Retain SSH candidate selection, never-retry mutations, Git/plain transfer differences, inbound quotas and late-writer manifest fences.
657 src/gateway/server-methods/chat-transcript-persistence.ts READ Centralized mirror candidate/rewrite request types at the transcript owner; merged identical display-block retention branches and replaced reversed-array scans with findLast.
651 src/gateway/worker-environments/placement-turn-claims.ts READ Repeated releases have different pending-result and claim predicates; do not rewrite legacy synchronous store paths solely for cosmetic savings.
648 src/gateway/worker-environments/worker-session-tool-executor.ts READ Unified serialized error projection with the result owner and combined equivalent terminal-admission errors; durable idempotency and child authority checks unchanged.
644 src/gateway/server-methods/system-agent.ts READ Retained greeting, reset, replay, and pending approval ownership; first pass already consolidated execution and validation.
644 src/gateway/worker-environments/inference-runtime.ts READ Retain provider-route/auth ownership, diagnostic/runtime binding, stream signature and tool-call projection; no safe local collapse beyond earlier sweeps.
641 src/gateway/server-methods/exec-approval.ts READ Retained exec-only display sanitization, cron standing-grant binding, registration custody and current-authority resolution; distinct from plugin approval creation.
641 src/gateway/worker-environments/placement-move-intent.ts READ Retain durable source/target normalization, shipped additive schema tolerance and exact move CAS; schema and access migration exceed this cleanup.
639 src/gateway/worker-environments/session-attachment-service.ts READ Retained exact session attachment generations, provider cleanup retry ownership, reservation cancellation, and after-await authority checks.
637 src/gateway/server-methods/channels.ts READ Centralized plugin/capability resolution for start/stop/logout with exact method-specific errors; removed duplicate private payload types.
633 src/gateway/server-methods/sessions-files.ts READ Removed duplicate preview-limit alias and module narration; canonical workspace limit now used directly, preserving transcript folds and exact read guards.
633 src/gateway/server-methods/system-changes.ts READ Retained bounded two-journal pagination and cross-page collapse cursors; changing synchronous storage belongs to its migration owner.
632 src/gateway/worker-environments/worker-turn-execution.ts READ Removed conditional internal callback forwarding and a redundant conflict capture alias; launch and result custody remain unchanged.
631 src/gateway/worker-environments/environment-access.ts READ Retain distinct SSH/node startup and desktop transport contracts plus policy/epoch checks after awaits; first-pass cleanup already absorbed simple forwarding.
630 src/gateway/worker-environments/node-worker-workspace-actions.ts READ Share the placement-lifetime transfer binding across local/repository restore and sync; individual authorization callbacks remain per operation. Incoming #161124 async checkpoint store publication still runs through awaited prepareCheckpoint/publish and existing failure cleanup.
628 src/gateway/server-methods/projects.ts READ Fresh-base full reread after #161124: awaits repository recents through the worker-backed owner and revalidates caller/profile/config access before response. No lane diff in this file; bounded observed-checkout selection, redaction and deletion guards remain intact.
612 src/gateway/worker-environments/provider-intent.ts READ Immutable allocation admission, retained preparation and replay use different source authority checks and cannot share a weaker predicate.
609 src/gateway/server-methods/chat-history-handler.ts READ Retained page/delta/retained-history selection and post-read sharing checks; their publication and error envelopes are distinct.
600 src/gateway/server-methods/workspace-files.ts READ Read preview, browser, search, and CAS presentation; local/remote metadata handling, content caps, binary classification, and distinct path coordinates remain required.
600 src/gateway/worker-environments/live-events.ts READ Retain ordered ACK/replay, claim capacity, cancellation-finishing, reentrant publication and trajectory settlement boundaries.
596 src/gateway/server-methods/sessions-mutations.ts READ Removed module narration; patchMany, owner assignment, plugin patch, involvement and reset keep distinct commit and response contracts.
590 src/gateway/worker-environments/prepared-pool.ts READ Retained demand, expiry, retention, and live capacity distinctions; deferred policy cannot authorize allocation or discard leases.
582 src/gateway/worker-environments/placement-turn-claim-events.ts READ Retain exact captured incarnation, run delegation, approval lifetime and finishing ACK checks across callback boundaries.
571 src/gateway/worker-environments/placement-dispatch-coordinator.ts READ Shared dispatch, Move and Stop reservation/wait/settlement flow in runSessionOperation; retain cancellation and predecessor ordering. Reread composition after #161124: helper holds the full service promise across new repository-worker awaits; recovery lending and provider-settlement ownership remain unchanged.
570 src/gateway/server-methods/control-ui.ts READ READ after #161124: repository CI targets prepare through the worker-backed store, then synchronously compare live session and committed workspace identity before disclosure; local and authenticated-reader paths retain their own access guards.
570 src/gateway/worker-environments/store.ts READ Retained transaction/commit admission, uncertain-write reconciliation, revocation publication and inventory lifetime; mutation wrappers transport different guards and facts.
567 src/gateway/server-methods/models-auth-status.ts READ Retained OAuth/token rollup precedence, profile-specific logout selection and prepared auth owner publication; no safe broader unification with mutation/error contracts.
565 src/gateway/server-methods/environments.ts READ Retained node command/desktop inventory projections, current prepared-detail authority and authoritative worker mutation/error mapping.
564 src/gateway/server-methods/skills.ts READ Inlined the sole-use workshop revision forwarder into its registered handler, retaining snapshots before lazy import and the exact downstream chat request and bound proposal.
562 src/gateway/worker-environments/workspace-result-finalize.ts READ Pass optional accepted-publication callbacks directly to their internal consumer; retain exact placement claims, transcript writes and cleanup failure classification.
561 src/gateway/server-methods/chat-abort-authorization.ts READ Retained active, queued, and pre-registered identity selection; inputs differ in trust, normalization, and protected-run contracts.
560 src/gateway/worker-environments/workspace-reconcile-recovery.ts READ Retain raw Git rollback snapshots, exact byte/hash limits and conservative recovery conflict tests; no equivalent shared restoration owner.
555 src/gateway/server-methods/task-suggestions.ts READ Read acceptance orchestration and handlers; source-session delivery, deferred local/worktree setup, cloud dispatch, and rollback require distinct sequencing and error contracts.
545 src/gateway/server-methods/artifacts.ts READ Image paging, inline transfer and retained HTTP download grants have distinct authority and size contracts.
536 src/gateway/worker-environments/placement-record.ts READ Discriminated state metadata and live claim checks encode distinct persisted-state invariants; no safe simplification beyond naming-only projections.
532 src/gateway/server-methods/shared-types.ts READ Read all request/context types; structural caretaker mirror explicitly prevents an import cycle, and remaining host/transport/resident interfaces preserve separate ownership contracts.
531 src/gateway/worker-environments/store-projection.ts READ Retained revision-ordered native overlays, independent authority digests, read fencing and physical-database ownership.
527 src/gateway/server-methods/session-change-event.ts READ Removed module narration; retained generation-aware debounce, oldest tombstone, latest notice and bounded broad invalidation ownership.
525 src/gateway/worker-environments/bundle.ts READ Retain cache publication/recovery, exact npm proof and queued prune ownership; first-pass helper reuse is already present.
520 src/gateway/server-methods/agents-files.ts READ Use canonical sha256Hex for workspace read/write digests; preserve bridge, filesystem, conflict and input bounds.
518 src/gateway/worker-environments/workspace-sync-scripts.ts READ Retain standalone manifest interpreter and host/worker hooks; shared exclusion, canonical manifest and hash programs are already centralized.
514 src/gateway/server-methods/push.ts READ Applied shared direct/relay APNs transport selection with node wake, retaining environment override, relay-origin pinning and exact stale-registration cleanup.
508 src/gateway/worker-environments/workspace-result-staging.ts READ Retain private candidate preparation, atomic ref moves and recorded-result cleanup; refs and SQLite fences have different commit points.
504 src/gateway/worker-environments/placement-dispatch.ts READ Retain separate initial dispatch and idempotent Stop paths with exact captured completion and post-await authorization.
502 src/gateway/worker-environments/workspace-accepted-remote-script.ts READ Retain remote transaction phase, inode and namespace rollback contracts; historical phase normalization is persisted recovery behavior.
491 src/gateway/worker-environments/placement-session-tool-operations.ts READ Retain tool replay identity, capacity, close-before-drain ordering and transaction checks; synchronous store migration is outside this deslop.
490 src/gateway/server-methods/approval.ts READ Malformed verdict denial, durable CAS, channel custody and terminal projection remain separate from legacy approvals.
481 src/gateway/server-methods/chat-send-session.ts READ Retained prepared session identity, physical store routing, native-runtime consent preparation, and commit-time currentness checks.
481 src/gateway/server-methods/message-operation-route.ts READ Applied one route-retention update and inlined sole-use reserved replay forwarding; retained alias lock, captured route, accepted receipt, TTL and in-flight barriers.
473 src/gateway/worker-environments/prepared-environment-store.ts READ Retained distinct reservation capacity, consumption and attachment predicates; all checks bind current persisted rows.
472 src/gateway/server-methods/chat-restart-recovery.ts READ Retained durable claim adoption, retry fingerprints, and terminal state ownership; persistence eligibility protects restart-safe replay semantics.
470 src/gateway/server-methods/chat-send-dispatch-errors.ts READ Retained pre-ACK versus detached-dispatch error ownership and exact terminal/persistence ordering; no redundant state owner remains.
470 src/gateway/worker-environments/placement-workspace-result.ts READ Retain original/draining generations and accepted-result fences; separate live authority from retained recovery custody.
468 src/gateway/server-methods/sessions-read.ts READ Removed module narration; retained separate scoped search, preview capture, listing, and synchronous reauthorization before response.
464 src/gateway/worker-environments/workspace-sync-helpers.ts READ Retain shared transfer parsing, bounded inventory scan and process-command outcome helpers; error/cancellation priority is observable.
462 src/gateway/server-methods/usage.ts READ Read owner selection, visibility, cache invocation, grouping, and aggregation; limiting visible rows after all-row aggregation and refreshed context authorization remain necessary.
460 src/gateway/worker-environments/workspace-actual-manifest.ts READ Retain descriptor-bound hash/content modes, bounded concurrency and directory eligibility classification; content and snapshot wrappers select meaningful modes.
458 src/gateway/server-methods/sessions-compact.ts READ Removed module narration; retained trim versus model compaction, terminal accounting, and lifecycle fences.
458 src/gateway/worker-environments/session-repository-checkpoints.ts READ Inlined the sole publication staging helper with pre-await snapshots of staging root, digest and manifest ref; reread after #161124 confirms identical live revision checks using prepared current facts, original database custody and artifact-before-SQLite-pointer ordering.
457 src/gateway/worker-environments/placement-dispatch-failure.ts READ First-pass error/cleanup owner retained; failure paths preserve primary diagnostics and exact teardown behavior.
446 src/gateway/worker-environments/provider-owner-lifecycle.ts READ First-pass teardown cleanup retained; dedicated leases and shared hosts require different physical-stop evidence.
443 src/gateway/server-methods/chat-send-source-finalization.ts READ Used transcript-owned mirror request types, passed the existing finalization parameters directly, and removed an empty-content push guard.
443 src/gateway/server-methods/cron-caller-scope.ts READ READ after pinned bda22f8: creator grants consume once, then retained issuer/operation guards revalidate at each worker commit checkpoint; requester grants preserve the same single-consumption and live-owner contract.
443 src/gateway/worker-environments/node-workspace-retain-coordinator.ts READ Retain workspace/bundle reachability and per-node coalescing. Fresh-base #161124 prepares repository refs asynchronously, rechecks placement/session/pending owners after awaits and at dispatch, and retains null manifests when authority changed; compatible with lane transfer binding and local guard edits.
442 src/gateway/server-methods/nodes.pairing.ts READ Inlined sole-use removed-pairing event forwarding at its owning cleanup path; retained generation reconciliation and response-before-close ordering.
436 src/gateway/server-methods/session-catalog-list.ts READ Inlined one-use catalog-search normalization wrapper; retained provider coalescing, budget fallback, and consuming-frame projection rechecks.
433 src/gateway/server-methods/usage-session-selection.ts READ Unified common usage-target arguments; kept alias preference, family ownership, physical-store context batching, row identity and post-summary visibility checks.
432 src/gateway/server-methods/session-create-project.ts READ Retain workspace intent serialization, exact run authority, Git provisioning, binding and rollback; state transitions have separate ownership.
429 src/gateway/worker-environments/repository-project-admission.ts READ Retained anonymous/REST versus authenticated GraphQL contracts, immutable repository identity, visibility checks and post-await source revalidation.
425 src/gateway/server-methods/system-agent-approval.ts READ Retained exact-proposal authority, correction, and completion boundaries; callbacks settle distinct lifecycle outcomes.
423 src/gateway/server-methods/migrations.ts READ Reused canonical SHA-256 and direct configured-agent membership lookup; retained complete plan fingerprints, provider resource lifetime and apply-completed replay semantics.
420 src/gateway/worker-environments/credential-broker.ts READ Retain durable credential mint/delivery and claim-aware renewal distinctions; first pass already simplified grant projection.
415 src/gateway/worker-environments/placement-row-codec.ts READ Persisted row decoding and transition metadata normalization are the canonical owners; no SQL path change without its worker migration.
415 src/gateway/worker-environments/transcript-commit.runtime.ts READ Retained active-branch versus interrupted DAG replay distinctions, redaction admission, transaction guards and postcommit publication.
414 src/gateway/server-methods/chat-send-reply-finalization.ts READ Removed the redundant empty payload guard because the existing all-owner compatibility check already returns none for an empty batch.
414 src/gateway/server-methods/nodes.read.ts READ Removed scalar normalization/filter forwarders and guards after nodeId admission; retained read redaction and runner inventory connection/generation fences.
413 src/gateway/worker-environments/inference-control-internal.ts READ Retain service-instance controls and two-phase drain capture/accept/start/release; cancellation and uncertain native settlement cannot collapse.
411 src/gateway/worker-environments/placement-turn-authority.ts READ Retain pending publication fences, transaction rollback and incarnation sequence checks; observer snapshots avoid reentrant mutation.
408 src/gateway/server-methods/sessions-patch-model-selection.ts READ Retain status-default versus direct-pin semantics, prepared model authority and native-runtime consent/placement validation.
407 src/gateway/worker-environments/placement-dispatch-recovery.ts READ Startup, runtime and targeted recovery preserve different orphan and provisioning rules; no equivalent simpler owner.
407 src/gateway/worker-environments/project-preparation.ts READ Retained separate seed, setup, retained snapshot and repository-source authority boundaries; transport payloads and cache identity unchanged.
401 src/gateway/server-methods/themes.ts READ Retained profile authority and expected-entry CAS around async preference writes; protocol projection intentionally selects public fields.
401 src/gateway/worker-environments/node-desktop-carrier.ts READ Use existing deep equality for the exact parsed ready-only JSON payload and inline one-use launch key; preserve stream and launch fencing.
401 src/gateway/worker-environments/worker-turn-admission.ts READ Retained setup/runtime/result wait ownership, local-turn settlement and cancellation recovery; distinct errors and authority checks prohibit collapse.
400 src/gateway/server-methods/plugins.ts READ Retained remote-discovery fallback, installed/bundled inspection distinctions, skill containment and exact result projection; previous sweeps already consolidated catalog composition.
397 src/gateway/server-methods/chat-send-message-injection.ts READ Returned the injection owner result directly, removing a one-use attempt binding; admission/recovery fences and acceptance settlement remain unchanged.
395 src/gateway/server-methods/sessions-patch-archive.ts READ Retain archive preparation/drain, per-target projection checks and worktree recovery ordering; no interchangeable lifecycle phase.
391 src/gateway/worker-environments/desktop-tunnel.ts READ Retain SSH acquisition, registry epoch fencing and app launch custody; distinct one-shot versus long-lived command lifetimes are necessary.
391 src/gateway/worker-environments/node-enrollment.ts READ Retain operation reservation, token issuance/replay, exact enrollment authority and cleanup; runtime and pairing preparation have different receipts.
390 src/gateway/worker-environments/placement-reclaim.ts READ First-pass journal owner retained; final-fence retry and accepted-result handoff protect different failure points.
389 src/gateway/server-methods/chat-assistant-content.ts READ Display and persisted content intentionally differ for sensitive media, suppressed text and transcript captions.
387 src/gateway/worker-environments/provider-node-provisioning.ts READ Retain artifact admission, runtime-to-enrollment handoff and late-result cleanup; no generic policy interface would simplify these owners.
386 src/gateway/server-methods/chat-reply-media.ts READ Retain session-bound media authority, remote workspace restrictions and mixed trusted/staged media normalization.
386 src/gateway/server-methods/sessions-delete.ts READ Return canonical resolver failure directly, narrow deleted worktree ID to owning closure and remove one-use outcome aliases; deletion guards and hooks unchanged.
385 src/gateway/server-methods/skills-library.ts READ Retained-file validation consumes entries from the existing path map, removing the duplicate selected-path Set while rejecting duplicate/missing paths identically.
380 src/gateway/worker-environments/session-placement-lifecycle.ts READ Retained different archive, history mutation, retirement and Stop policies with exact captured-placement checks.
376 src/gateway/server-methods/channel-pairing.ts READ Approve and dismiss have different adapter, notification and command-owner behavior; list policy checks remain plugin-owned.
375 src/gateway/worker-environments/node-worker-repository-preparation.ts READ Retain authenticated clone/fetch, prepared-repository bind and seed fallback; commands have distinct errors and mutation contracts.
374 src/gateway/server-methods/session-mutation-guards.ts READ Removed unused authority type export; private binding, captured identity comparisons and admitted-input transfer guards remain required.
371 src/gateway/worker-environments/worker-turn-payload.ts READ Retained replay window fitting, identity token measurement/minting, usage projection and runtime admission as separate contracts.
370 src/gateway/server-methods/system.ts READ Retained cached host facts and separate presence versus wake behavior, with original session and mutation checks.
369 src/gateway/server-methods/secrets.ts READ Reused protocol request and runtime resolver result types; one ordered field scan replaces repeated validation-error prefix branches without changing public errors or secret projections.
369 src/gateway/worker-environments/inference-store.kernel.ts READ Retain row classification, UTF-8 retention accounting and exact terminal mutation predicates; changing storage admission is beyond behavior-neutral cleanup.
368 src/gateway/worker-environments/workspace-manifest.ts READ Retained manifest/journal validation and grandfathered casts; the canonical guard cleanup requires an assertion-baseline change outside this lane.
366 src/gateway/server-methods/users.ts READ Read profile, preference, role and avatar handlers; personalized settings admission, canonical writer callbacks, policy-response holds and owner invalidation retain different boundaries.
366 src/gateway/server-methods/workspace-fs.ts READ Read all local/remote filesystem adapters; remote read-only policy, old-node metadata fallback, lexical/physical containment, and atomic local CAS are distinct contracts.
365 src/gateway/worker-environments/store-transitions.ts READ Retained credential revocation, lease immutability, exact attachment and global owner-epoch transition rules.
364 src/gateway/server-methods/chat-history-page-kernel.ts READ Anchored grouping, sibling pagination, legacy compaction enrichment and incremental tail selection have separate contracts.
364 src/gateway/server-methods/sessions-lifecycle-drain.ts READ Removed module narration; retained settled worker/terminal/controller admission drainage and failure aggregation.
361 src/gateway/server-methods/chat-history-budget.ts READ Retained byte-cache identity, framing accounting, tool-activity classification, and ordered recovery-field retention; guards enforce independent payload contracts.
361 src/gateway/server-methods/chat-send-attachments.ts READ Retained parser-owned image capability and sandbox staging, cancellation cleanup, and PDF fallback contracts; mutable capability cell is required for closure-aware typing.
361 src/gateway/worker-environments/placement-move-service.ts READ First-pass move flow retained; durable abandon intent and restart authority expiration have different completion semantics.
354 src/gateway/worker-environments/workspace-manifest-worker.ts READ Retain host/worker routing, serialized owned input, hash delta acceptance and bounded blob batches; adapters enforce computation boundaries.
349 src/gateway/worker-environments/transcript-commit-store.ts READ Retained the legacy synchronous SQLite path unchanged; a proper worker migration exceeds this behavior-preserving cleanup scope.
348 src/gateway/worker-environments/workspace-inventory-computation.runtime.ts READ Retain streaming NUL Git paths, transfer budget accounting and pretransfer symlink checks; filesystem and manifest eligibility have different ordering.
344 src/gateway/server-methods/chat-send-request.ts READ Retained wire validation and mode-specific provenance, Goal, mention, and tool-binding restrictions; similar errors describe different public contracts.
340 src/gateway/server-methods/chat-send-user-turn.ts READ Retained image custody, immutable participant identity, creator selection, and prompt/transcript separation; media apply modes have distinct contracts.
336 src/gateway/worker-environments/ssh.ts READ Retained pinned host validation, secret material lifetime, advertised-port retry order and bounded transport errors.
335 src/gateway/server-methods/plugin-approval.ts READ Retained trusted policy binding, display caps, requester/reviewer metadata and manager settlement; earlier extraction already shares delivery and decision handling.
331 src/gateway/server-methods/conversations.ts READ Use canonical sha256Hex while preserving exact request identity bytes and agent-scoped replay keys.
331 src/gateway/server-methods/session-active-runs.ts READ Retain key/session-ID matcher distinctions and request-scoped indexes; exact run identity differs from terminal visibility and capacity waits.
330 src/gateway/server-methods/config-write-flow.ts READ Authored-secret overlay comparison, runtime application and restart follow-up ordering remain distinct owner responsibilities.
328 src/gateway/worker-environments/placement-test-fixtures.ts READ Read support module; transaction-scoped fault injection and canonical environment publication are required. Excluded from production count.
328 src/gateway/worker-environments/placement-turn-claims-store.ts READ Retain exact command whitelist, commit publication and uncertain-write reconciliation; broad object spreading would alter worker input contract.
325 src/gateway/server-methods/usage-date-range.ts READ Collapsed nested finite-day coercion to one conversion and bounded result; used a switch for named ranges; retained malformed-input behavior, DST/date-line handling and all error strings.
322 src/gateway/server-methods/chat-history-session-read.ts READ Retained prepared-row selection, excluded metadata refusal, retained-history revalidation, and synchronous publication fences.
319 src/gateway/worker-environments/store.kernel.ts READ Retained native mutation ownership and distinct credential, enrollment, cleanup and lifecycle transitions.
318 src/gateway/worker-environments/workspace-accepted-sync.ts READ Retain publication settlement reconciliation and rollback refusal on indeterminate transport; commit/apply failures have distinct replay contracts.
317 src/gateway/server-methods/tts.ts READ Replaced hand-written immediate promise with the Node timers promise owner; removed narrating headers.
315 src/gateway/worker-environments/node-worker-bundle-installer.ts READ Retain per-serve progress ownership and environment reference counts so joined callers cannot unsubscribe each other.
315 src/gateway/worker-environments/node-workspace-upload-reader.ts READ Retain bounded binary streaming, chunk accounting, after-await authority and error classification; the reader protects real protocol boundaries.
314 src/gateway/server-methods/session-catalog-provider-access.ts READ Retain bounded provider step admission, plugin consumer custody and config/registry-owned cache invalidation.
308 src/gateway/server-methods/agent-session-patch.ts READ Session reuse, terminal recovery, group provenance and concurrent rotation checks must stay explicit.
307 src/gateway/worker-environments/worker-turn-media.ts READ Retained canonical media facts, current versus historical availability policy, transfer budgets and transient remote path projection.
305 src/gateway/worker-environments/workspace-mutation-lock-remote-script.ts READ Retain owner/reclaimer inode CAS and receiver-group liveness; double reads guard separate namespace transitions.
304 src/gateway/worker-environments/placement-projector.ts READ State-specific public projections deliberately omit metadata and authority; retain explicit output shapes for zero protocol drift.
303 src/gateway/worker-environments/workspace-reconcile-apply.ts READ Retain source ownership, repeated freshness preflight, journal begin/commit and exact-target late-failure custody.
302 src/gateway/server-methods/session-catalog-list-lifetime.ts READ Retain synchronous versus awaited publication paths: combining them adds a response yield and changes retirement/settlement ordering.
302 src/gateway/worker-environments/workspace-sync-inventory.ts READ Retain async file-output backpressure and process-tree settlement; generic runner cannot substitute these fd/output and error-ordering contracts unchanged.
295 src/gateway/worker-environments/placement-workspace-journal.ts READ Retain forced-owner recovery and base-pack validation; repeated SQL paths cannot be cosmetically refactored without worker migration.
291 src/gateway/server-methods/web-search-status.ts READ Retained configured, managed, native, and external search route distinctions and prepared catalog authority.
290 src/gateway/server-methods/sessions-subscriptions.ts READ Removed module narration; provisional subscription, approval replay revalidation and rollback retain different failure contracts.
289 src/gateway/worker-environments/skill-resource-transfer.ts READ Retained remote inode custody, staged marker lifecycle, bounded resource chunks, content verification and cleanup ownership.
288 src/gateway/server-methods/claws-monitors.ts READ Deletion fence, exact monitor revisions, receipt drainage and config convergence checks guard different effects.
287 src/gateway/server-methods/users-personal-file.ts READ Read self-owned instructions flow; original requester and tool-run authority, current workspace, no-alias read/write, CAS and retained read checks remain necessary.
285 src/gateway/server-methods/plugin-host-hooks.ts READ Retained plugin schema/JSON validation at untrusted boundary and exact success/failure wire projection.
283 src/gateway/worker-environments/service-contract.ts READ Retained leaf request-facing contracts separate from runtime/persistence imports; canonical inference method addition delegated to worker_an.
282 src/gateway/server-methods/nodes.wake.ts READ Moved transport selection to shared APNs owner; wake/nudge keep distinct throttling, attempt accounting, timeout and post-await generation revalidation.
280 src/gateway/server-methods/models-auth-status-usage-cache.ts READ Retained credential-scoped usage keys, replacement generation checks and last-good timeout behavior; status and auth endpoints have different cold-read responses.
278 src/gateway/worker-environments/workspace-result-inventory.runtime.ts READ Retain shipped v1 versus v2 staging format, bounded Git blob batches and exact content checks; artifact preview projection uses canonical inventory.
276 src/gateway/server-methods/update-status.ts READ Read status/reconciliation and OCM routing; committed-drain reads, reversible root admission, campaign reconciliation, diagnostic timings and output validation remain required.
276 src/gateway/worker-environments/placement-worker-gate.ts READ Retain recovery-only claim denial and refresh custody transfer across worker awaits; credential checks remain separate from authority.
275 src/gateway/worker-environments/store-row-codec.ts READ Retained nullable row decoding, receipt and state validation, fallback-port aggregation and exact snapshot facts.
274 src/gateway/server-methods/sessions-patch-expectations.ts READ Retain expected-field validation, original source authority, worker preparation and cleanup aggregation.
270 src/gateway/server-methods/sessions-messaging.ts READ Removed module narration; preserve sessions.send and steer adapters, original caller custody and reactivation settlement.
270 src/gateway/worker-environments/tunnel-contract.ts READ Retained transport-specific workspace/turn interfaces and cleanup error aggregation; protocol-facing shapes unchanged.
269 src/gateway/server-methods/web-search.ts READ Retained read/admin checks and post-search current-owner validation; result/answer/error projections have distinct public shapes.
267 src/gateway/server-methods/chat-broadcast.ts READ Shared frame projection is already canonical; side-result and terminal sequencing differ intentionally.
267 src/gateway/server-methods/chat-send-commentary-media.ts READ Removed a redundant media-scope copy passed to the read-only roots resolver; retained writer-currentness, rewrite anchors, and commit-aware cleanup.
266 src/gateway/server-methods/agents-workspace.ts READ Relative-path admission, binary sniffing and bounded image/text projections retain different response contracts.
266 src/gateway/server-methods/chat-send-command-replies.ts READ Removed delivery-kind forwarding wrappers after selection; folded canonical ReplyDispatchOperation values directly while preserving cloned raw payloads, prepared writer identity, and ordered metadata merging.
266 src/gateway/server-methods/sessions-github.ts READ Reread complete retained source after main made shared publication status/latest reads asynchronous; current-session and personal-status revalidation after awaits remain intact alongside captured requester release and method-specific errors. No additional simplification applied.
265 src/gateway/server-methods/session-catalog-entry-snapshot.ts READ Retain immutable provider planning and current delivery snapshots; caches have different revision and actor-identity lifetimes.
264 src/gateway/server-methods/agent-session-prepare.ts READ Pre-attachment identity, cron continuation, failed transcript and session reset policy checks serve distinct admission contracts.
264 src/gateway/server-methods/update-report.ts READ Read report sanitization and submission; connection-bound consent, exact failed attempt/digest revalidation and disclosure projections cannot be merged with updater admission.
264 src/gateway/worker-environments/node-workspace-transfer-http.ts READ Retain manifest encoding and pack/blob/upload response differences, authority and content-length behavior; generic sendJson would change framing.
263 src/gateway/server-methods/chat-message-get-handler.ts READ Retained pending-input versus transcript ownership, visibility filtering, sharing revalidation, and message byte-limit handling.
263 src/gateway/server-methods/chat-user-turn-recorder.ts READ Retained transcript input custody, reply hydration, persisted mention verification, and original-input commit authority; separate best-effort persistence remains meaningful.
263 src/gateway/worker-environments/project-setup-script.ts READ Retained target-runtime Git/manifest proof, setup process-group settlement and completion witness publication ordering.
260 src/gateway/server-methods/approval-visible-record.ts READ Durable lookup reconciliation and live manager binding require post-await authority and exact-source checks.
259 src/gateway/server-methods/chat-origin-routing.ts READ Retained explicit origin validation and shipped CLI/main-session inheritance; local ACP shape detection intentionally differs from canonical session classification.
259 src/gateway/server-methods/environments.session.ts READ Retained session incarnation, live run authority, tool policy and attachment mutation ownership across awaits.
259 src/gateway/server-methods/models-auth-status-facts.ts READ Retained plugin/auth generation and semantic-expiry cache invalidation; provider credential and configured-account inventories have distinct inclusion contracts.
257 src/gateway/worker-environments/session-attachment-store.ts READ Retained additive attachment schema and atomic reservation closure/cancellation; identity and generation guards remain required.
255 src/gateway/server-methods/approval-record-lookup.ts READ Canonical visibility and prefix resolution are already shared; legacy requester binding remains shipped behavior.
254 src/gateway/server-methods/exec-approvals.ts READ Retained protocol file validation, stale base-hash rejection before state creation and locked write CAS; root retained the pre-existing validated-data guard, so no lane diff remains.
254 src/gateway/server-methods/tools-catalog.ts READ Read core/plugin catalog assembly; runtime-resolved and declared-but-unresolved tools require distinct fields and plugin-owned metadata keys.
253 src/gateway/server-methods/chat-history-pages.ts READ CLI import snapshots, identity-only overlays and worker projection have distinct pagination and visibility boundaries.
252 src/gateway/worker-environments/artifact-transfer-http.ts READ Retain shared rate-limit admission, resumable ranged serves, redacted diagnostics and descriptor/authority cleanup.
251 src/gateway/worker-environments/portal-node-carrier.ts READ Retained ticketed stream lifetime, exact node/epoch checks after discovery, and admitted invocation settlement before close.
246 src/gateway/worker-environments/workspace-reconcile-preflight.ts READ Retain ancestor conflict lifting, changed-path eligibility and per-pass memo; repeated scans across passes are concurrency fences.
245 src/gateway/server-methods/github-personal-authorization.ts READ Retained live socket/role intersection, durable personal owner and session incarnation checks; no credential or publication authority can be inferred from identifiers.
244 src/gateway/worker-environments/workspace-hash-memo.ts READ Retain one compiled source for standalone and resident hash helpers and placement-scoped invalidation; exported envelope type has an external test caller.
243 src/gateway/worker-environments/worker-turn-attachments.ts READ Retained managed-original admission, remote file identity, chunk budgets and cancellation-safe directory cleanup.
242 src/gateway/server-methods/session-catalog-visibility.ts READ Remove callback narration and explicit return wrapper; creator/incognito checks and after-await visibility revalidation unchanged.
241 src/gateway/server-methods/agent-session-reset.ts READ Reset ACK delivery and filesystem/session configuration handoff retain separate result and delivery contracts.
239 src/gateway/worker-environments/service-validation.ts READ Retained external provider validation and exact error strings; explicit result projection preserves absent optional fields.
238 src/gateway/server-methods/approval-request-authority.ts READ Source-specific policy capture and committed revocation observation retain independent live-authority responsibilities.
238 src/gateway/worker-environments/workspace-reconcile-fs.ts READ Retain rooted versus absolute file checks and journal versus derived-only directory semantics; empty directory rules differ.
237 src/gateway/server-methods/wizard.ts READ Retained cancellation and admission settlement ordering; existing helper already owns wizard lookup and validation.
236 src/gateway/server-methods/chat-transcript-inject.ts READ Retained label/content projection, exact aborted-producer append path, transcript parent links, and transaction-time duplicate suppression.
236 src/gateway/server-methods/commands-list-result.ts READ Replace parallel alias array/Set with one ordered Set; share choice projection and combine equivalent provider exits.
235 src/gateway/server-methods/chat-webchat-media.ts READ Derive media presence from existing dedupe sets and share synthetic transcript caption projection.
235 src/gateway/worker-environments/artifact-transfer-service.ts READ Retain exclusive serve ownership, expiry/revocation and immutable descriptor custody; no redundant capability owner remains.
234 src/gateway/worker-environments/computer-service.ts READ Retain distinct prepared attachment, turn claim and worker connection lifetimes and settlement-aware close owners.
232 src/gateway/server-methods/audit.ts READ Legacy and activity projections intentionally expose different fields; cursor families and wire compatibility stay explicit.
231 src/gateway/server-methods/agent-reset-phase.ts READ Committed reset ownership and post-reset reply failures need separate accepted/retry outcomes.
231 src/gateway/server-methods/cron-runs.ts READ All-job and exact-job history have different deleted-job visibility and pagination authorization semantics.
224 src/gateway/server-methods/chat-history-delta.ts READ Append-only delta rejection, transcript metadata projection and framing-byte limits are distinct contracts.
224 src/gateway/server-methods/web.ts READ Inlined single-use error forwarders and merged identical channel restart branches while retaining exact messages and login ordering.
223 src/gateway/server-methods/sessions-groups.ts READ Removed module narration; distinct missing/nonempty error mapping and interrupted mutation notifications retained.
223 src/gateway/server-methods/system-agent-setup-wizard.ts READ Retained queued OAuth replacement and predecessor settlement barriers from recent repair; first-pass task wrapper already canonical.
222 src/gateway/server-methods/cron-history.ts READ Exact run binding, opaque cursor and retained-transcript authority revalidation remain required.
222 src/gateway/server-methods/update-admission.ts READ Read OCM/native ownership admission and failure receipt assembly; exact admitted requester, installation inspection and failure-ledger records remain required.
218 src/gateway/server-methods/health.ts READ Retained cached topology invalidation and live process/worker/child-runtime overlays; prior sweeps already centralize lifecycle comparisons.
218 src/gateway/worker-environments/node-worker-workspace-fallback.ts READ Retain published-origin eligibility and bounded Git inspection; failure classification intentionally selects canonical transfer fallback.
216 src/gateway/server-methods/device-scope-upgrade.ts READ Retained device identity binding, current role ceilings and token-release revalidation after approval wait.
216 src/gateway/worker-environments/local-workspace-archive.ts READ Retained the legacy synchronous SQLite path unchanged; a proper worker migration exceeds this behavior-preserving cleanup scope.
215 src/gateway/server-methods/session-catalog-list-operations.ts READ Retain caller-bound coalescing, registry epochs, provider budgets and stale page identity; no shared generic cache preserves these contracts.
213 src/gateway/server-methods/chat-send-work-admission.ts READ Retained ref-counted custody, independently idempotent releases, exclusive Goal admission, and synchronous creator-policy guards.
213 src/gateway/server-methods/session-catalog.ts READ Retain canonical catalog lookup and handler adapters; read/continue/archive have distinct permission, creation and retirement behavior.
211 src/gateway/server-methods/nodes.pending-work.ts READ Retained destructive drain connection ownership and pending wake cleanup; retries and nudge results intentionally differ from synchronous invocation.
211 src/gateway/worker-environments/placement-disk-space.ts READ First-pass binding/projection cleanup retained; safe integer parsing and exact post-probe owner checks remain necessary.
210 src/gateway/server-methods/core-handlers.ts READ Literal dynamic imports preserve bundler visibility and lazy family boundaries; metadata policy already owns method inventory.
210 src/gateway/worker-environments/store-validation.ts READ Retained persisted endpoint/receipt/state invariants; normalization behavior is part of the stored contract.
209 src/gateway/server-methods/chat-send-turn-adoption.ts READ Retained queued cancellation identity, withdrawal hold, admission reference, and source-versus-followup terminal recording.
209 src/gateway/server-methods/tools-github.ts READ Joined inherit/PAT setup after their separate config commits so prior OAuth retirement and status response have one shared completion path.
206 src/gateway/server-methods/chat-metadata-session-projection.ts READ Model catalog preparation, native ownership overlay and session runtime lock have separate lifetimes.
205 src/gateway/worker-environments/provider-machine-catalog.ts READ Machine and OS loaders use different canonical validators; a generic callback interface would add complexity for little reduction.
205 src/gateway/worker-environments/workspace-reconcile-core.ts READ Retain manifest assertions, accepted state projection and directory mutation guards; re-exports have outside-lane callers.
203 src/gateway/server-methods/agents-config-mutations.ts READ Existing roster mutation owner retains model-selection and write-time identity checks.
203 src/gateway/server-methods/cron-input-validation.ts READ READ after pinned bda22f8: extracted creator-session guard preserves sessionId, lifecycle revision and skill-selection checks before guarded cron commit; authored input and delivery validation remain unchanged.
203 src/gateway/worker-environments/workspace-git-base.ts READ Retain pinned commit discovery, absent-donor fallback and byte-bounded pack preparation; reference and content contracts differ from result storage.
202 src/gateway/worker-environments/store-mutations.ts READ Retained global owner epoch and credential mutation owners; attachment repair orders conflicting rows deterministically.
202 src/gateway/worker-environments/tunnel.ts READ Retained epoch fencing, initialization publication before predecessor cleanup, and reentrant shared-stop ownership.
201 src/gateway/server-methods/portals.ts READ Retained attached environment owner epoch, transport close on revoked authority and bearer-redacted events.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 6:36 PM ET / 22:36 UTC (Revision 9).

ClawSweeper review

What this changes

The branch consolidates Gateway request handling, reply processing, push transport selection, and worker operations while removing redundant forwarding code, with no user-visible change intended.

Merge readiness

⛔ Blocked before merge - 6 items remain

This remains a distinct, useful cleanup after the merged first pass. I found no concrete introduced defect, but the reported current-head results have not been mapped to the changed delivery and worker-settlement paths.

Priority: P3
Reviewed head: a2daaec56f0afb287d07530ed16875fefb926f2e

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected patch is coherent and has substantial current-head validation, while focused behavioral coverage remains unclear.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-owned internal refactor is exempt from the external-contributor proof gate. The PR reports current-head Testbox checks and 10 completed runtime phases, but does not map observed send/retry, transcript, or worker-recovery outcomes to the changed owners; no stored-data contract change was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned internal refactor is exempt from the external-contributor proof gate. The PR reports current-head Testbox checks and 10 completed runtime phases, but does not map observed send/retry, transcript, or worker-recovery outcomes to the changed owners; no stored-data contract change was identified.
Evidence reviewed 8 items Introduced delivery changes: The pinned merge-base-to-head patch changes route-retention and replay handling, folded reply selection, and transcript-related processing.
Reply-folding owner: The branch selects final and command-block dispatch operations directly and merges matching text and media semantics before delivery.
Worker admission owner: The new shared operation helper holds a session reservation through admission and service execution for dispatch, move, and reclaim.
Findings None None.
Security None None.

How this fits together

Gateway request handlers receive client RPCs and pass validated work to channel, transcript, and worker owners. Those owners produce replies, persisted session records, and worker outcomes.

flowchart LR
A[Client RPC request] --> B[Gateway validation]
B --> C[Message route and reply processing]
C --> D[Channel reply and transcript]
B --> E[Worker placement]
E --> F[Worker outcome and session state]
Loading

Before merge

  • Resolve merge risk (P1) - The reported current-head results do not identify a send/retry and persisted-transcript outcome for the changed route-replay and folded-reply paths, leaving message deduplication and delivery equivalence unverified.
  • Resolve merge risk (P1) - The shared worker reservation path spans dispatch, move, and reclaim, but the reported current-head results do not identify a focused Stop/recovery and settlement outcome for that composition.
  • Complete next step (P2) - Map current-head results to send/retry and persisted-transcript behavior and to worker Stop/recovery settlement, then fill only the identified coverage gaps.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • 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: migration/backfill/repair: src/gateway/server-methods/migrations.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Map focused boundary results (recommended)
    Identify current-head results for send/retry through persisted transcript and for worker Stop/recovery settlement, obtaining focused proof only where the existing results leave a gap.

Technical review

Best possible solution:

Keep one owner for each route, reply, transcript, and placement decision while demonstrating that the existing delivery and session-lifecycle contracts remain intact.

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

Not applicable: this PR proposes behavior-preserving cleanup rather than reporting a current-main bug.

Is this the best way to solve the issue?

Yes, provisionally: the inspected changes reuse existing owners and remove redundant forwarding without an identified correctness defect. Focused outcome mapping is still needed for the delivery and worker paths.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-visible change or established current user regression.
  • merge-risk: 🚨 message-delivery: The branch changes route replay and folded reply dispatch, where a semantic mismatch could duplicate or suppress replies.
  • merge-risk: 🚨 session-state: The branch consolidates transcript and worker reservation paths whose ordering affects session outcomes.
  • 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: This maintainer-owned internal refactor is exempt from the external-contributor proof gate. The PR reports current-head Testbox checks and 10 completed runtime phases, but does not map observed send/retry, transcript, or worker-recovery outcomes to the changed owners; no stored-data contract change was identified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • scoootscooob: 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.

  • Map current-head send/retry, persisted-transcript, and worker-settlement results to the changed production paths.

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 (8 earlier review cycles)
  • reviewed 2026-09-29T16:49:22.679Z sha b146aaf :: blocked before merge. :: none
  • reviewed 2026-09-29T17:41:40.125Z sha b146aaf :: blocked before merge. :: none
  • reviewed 2026-09-29T18:50:09.431Z sha b146aaf :: blocked before merge. :: none
  • reviewed 2026-09-29T19:49:55.318Z sha a2daaec :: blocked before merge. :: none
  • reviewed 2026-09-29T19:57:24.630Z sha a2daaec :: blocked before merge. :: none
  • reviewed 2026-09-29T21:38:47.066Z sha a2daaec :: blocked before merge. :: none
  • reviewed 2026-09-29T21:51:51.912Z sha a2daaec :: blocked before merge. :: none
  • reviewed 2026-09-29T22:24:16.955Z sha a2daaec :: blocked before merge. :: none

Second-pass cleanup preserves Gateway protocol and RPC contracts, current-owner authority checks, worker lifecycle and fencing, and persisted state. Consolidate request and result handling, use canonical types and helpers, and remove redundant forwarding and derived state.
Retain the two original assertion-ledger-owned paths and use the narrowed desktop request alias. The resulting candidate preserves the completed review, protocol, SDK and boundary evidence; full changed checks and build pass on the exact candidate tree.
@steipete
steipete force-pushed the deslop/l176-gateway-methods2 branch from b146aaf to a2daaec Compare September 29, 2026 19:40
@steipete
steipete marked this pull request as ready for review September 29, 2026 22:18
@steipete
steipete enabled auto-merge (squash) September 29, 2026 22:18
@github-actions

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: a2daaec56f0afb287d07530ed16875fefb926f2e
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server-methods/model-auth-agent-scope.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/nodes.pairing.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/secrets.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/server-methods/users-auth-connect.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing exact head a2daaec56f0 over pre-existing main failures (CI run 36638806368).

Every failing case matches main: subagent-control / retirement / publication / store-replaced / task-replacement, cron double-announce (missing countPendingDescendantRuns mock export), gateway reload handlers, update-cli target-schema (main hourly run 36619831492 and clean-main replay 36620000716), and the Control UI splash e2e (composer gap -500). The Windows Testbox OpenSSH admission timeout is in the advisory Windows Node shard (a214e76), which also fails on main's run 36640080821; this PR does not touch scripts/.

Madge and runtime import-cycle checks report 0 on this head; check-changed, build, protocol (zero drift), SDK checks and 71 import-boundary tests passed on Testbox. Net production reduction: 698 lines.

@steipete
steipete merged commit 1397974 into main Sep 29, 2026
281 of 290 checks passed
@steipete
steipete deleted the deslop/l176-gateway-methods2 branch September 29, 2026 23:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…nd pass (openclaw#161284)

* refactor(gateway): simplify request and worker flows

Second-pass cleanup preserves Gateway protocol and RPC contracts, current-owner authority checks, worker lifecycle and fencing, and persisted state. Consolidate request and result handling, use canonical types and helpers, and remove redundant forwarding and derived state.

* refactor(gateway): keep cleanup within scoped validation contracts

Retain the two original assertion-ledger-owned paths and use the narrowed desktop request alias. The resulting candidate preserves the completed review, protocol, SDK and boundary evidence; full changed checks and build pass on the exact candidate tree.

* refactor(gateway): retain existing synchronous storage paths
steipete added a commit that referenced this pull request Sep 30, 2026
…d pass

Reuse canonical validation, sorting, normalization and placement helpers.
Consolidate duplicate RPC and workspace projections while preserving wire
errors, current-owner revalidation, worker fencing and persisted state.

Third-pass maintainer sweep following #159752 and #161284. No user-visible
behavior or protocol change is intended. Retain existing recovery assertions.
steipete added a commit that referenced this pull request Sep 30, 2026
…d pass (#161737)

Third-pass maintainer-requested Gateway cleanup following #159752 and #161284.
Reuse canonical validation, stable bounded sorting and placement matching; consolidate RPC and workspace projections and remove forwarding wrappers.

Preserve protocol, RPC results and errors, live-owner authority, worker lifecycle/fencing and persisted state. No user-visible behavior change is intended. Drop overlaps already landed in #160444, #161085 and #161642.

Validation: independent Codex review clean at P0-P2; both import-cycle checks report zero; lint clean; 401 tests passed across 28 files and five Vitest shards, with one existing opt-in Podman skip. Rebased protocol generation has zero drift and SDK export/surface checks pass. Full source reading covered 645 production files at the starting base.

Hosted CI run 36693161484 executed its build/test lanes. The sole failed test, session-activity-summaries.test.ts relocated-store recovery (expected 2 to be 3), also fails on unrelated PR #161714 head 8080a45, run 36692028664 job 109811633901. The changed RPC/workspace code is outside the failing execution path. Land under the explicitly authorized pre-existing-failure exception; retain this failure for the main-CI coordinator.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…d pass (openclaw#161737)

Third-pass maintainer-requested Gateway cleanup following openclaw#159752 and openclaw#161284.
Reuse canonical validation, stable bounded sorting and placement matching; consolidate RPC and workspace projections and remove forwarding wrappers.

Preserve protocol, RPC results and errors, live-owner authority, worker lifecycle/fencing and persisted state. No user-visible behavior change is intended. Drop overlaps already landed in openclaw#160444, openclaw#161085 and openclaw#161642.

Validation: independent Codex review clean at P0-P2; both import-cycle checks report zero; lint clean; 401 tests passed across 28 files and five Vitest shards, with one existing opt-in Podman skip. Rebased protocol generation has zero drift and SDK export/surface checks pass. Full source reading covered 645 production files at the starting base.

Hosted CI run 36693161484 executed its build/test lanes. The sole failed test, session-activity-summaries.test.ts relocated-store recovery (expected 2 to be 3), also fails on unrelated PR openclaw#161714 head 8080a45, run 36692028664 job 109811633901. The changed RPC/workspace code is outside the failing execution path. Land under the explicitly authorized pre-existing-failure exception; retain this failure for the main-CI coordinator.
steipete added a commit that referenced this pull request Oct 15, 2026
…-5 bundle A) (#172989)

* refactor(ui): remove unused page plumbing and duplicate presentation work

Fold sole-caller Config and Cron adapters into their existing owners, reuse
canonical controller types, and remove unused request arguments and login
selection options. Adopt the complete background mutation receipt instead of
rereading the write; keep authoritative preflight and live ownership checks.

Best-effort tradeoffs accepted: a later background edit in another browser is
reflected by normal preference events or refresh, not an unconditional read of
our own successful write. The introducing feature PR #168301 does not identify
a human incident requiring that reread. Settled rendering and public contracts
are unchanged; both shipping renderer paths remain intact.

* refactor(ui): consolidate presentation helpers and cached preview inputs

Share point-menu trigger attributes and deletion-first LCS traversal. Remove
an obsolete empty-badge predicate, a one-caller loading facade, and redundant
whole-map translation fallback. Preserve both active Lit and Solid paths,
positioning formulas, diff work budgets, visible text, and rendering.

Best-effort tradeoffs accepted:
- Trust successful synchronous Web Storage writes instead of reading them back.
  Introducing PR #162428 supplied synthetic storage failures, not a human
  incident where successful setItem silently failed. Nonconforming Storage
  replacements may miss a cache publication until the next refresh.
- Trust immutable message/tool-card identities for cached source previews.
  PR #148431's in-place mutation assertions were synthetic; production owners
  publish replacement snapshots. Unsupported in-place mutation may leave a
  decoration stale until replacement. Run/frame/origin and external source
  validation remain unchanged.

Net production reduction: 76 lines; tests: 20 lines removed, only synthetic
same-object mutation assertions. Kept config coercion tied to human Safari
report #13348, along with security, durability, ordinary navigation ownership,
and all active migration paths.

Focused proof: 73 boot/cache/diff tests, 82 menu tests, 46 badge/assistant tests,
20 i18n tests, 8 browser details tests, 3 lint-suppression tests; UI typecheck,
formatting, stylesheet lint and CSS declaration parity passed.

Known inherited local check failure: environment-variable count is 455 against
budget 454, independently reproduced against clean HEAD/index. Its counted
source roots exclude UI. No budget or unrelated source changes made.

* refactor(ui): remove obsolete presentation compatibility and styling

Use the native Popover capability required by the Control UI bootstrap
instead of retaining old-engine in-flow fallbacks. Keep native overlay
occlusion and all real connection/navigation ownership.

Remove retired sidebar style hooks and share identical question-panel
declarations. Supported browsers render identically; no user-visible
copy, feature, renderer selection, config, protocol, or storage change.

Best-effort tradeoffs accepted

- Old engines without Popover support, or invalid direct popover mounts,
  no longer receive an in-flow menu fallback. The fallback came from
  #105598 as generic compatibility, not a human incident; #168595 made
  native Popover support a required bootstrap capability. Invalid direct
  mounts now fail clearly rather than silently changing layering.

Deeper coverage and retained candidates are recorded in the requested
task-local y03 ledger for coordinator bundling.

Branch total: 123 net production LOC removed (+114/-237), excluding tests,
fixtures, generated files and declarations. Below the 500-line campaign
floor after the deeper components/app/lib/styles and lead-owned owner pass;
push branch-only for bundling.

* refactor(gateway): reuse server method owners

Consolidate duplicate catalog response handling,
optional catalog reads, pairing resolution, requester assertions and system
agent transcript persistence. Carry prepared pairing and actor facts instead
of probing or re-reading them. Remove redundant cache-generation and internal
receipt checks; retain security, durability, pagination and resource bounds.

Best-effort tradeoffs accepted:
- Pairing captures its selected adapter once. Repeated internal checks added
  by #112401 guarded hypothetical in-place plugin mutation, not a reported
  incident. Such a mutation now leaves this request on its selected adapter;
  later requests discover the current registration.
- Channel identity RPCs trust the canonical mutation result instead of
  repeating the action/kind assertion introduced in #161284. No human incident
  justified the redundant adapter assertion; live mutation authority remains
  with the state owner.

No user-facing feature, protocol/config/persistence shape, schema, dependency,
test coverage or standalone session memory backend changes.

Net production reduction: 100 lines (179 added / 279 deleted).
Type-aware lint, targeted production types, formatting, runtime cycles (zero),
SDK surface, suppression audit and independent P2 review pass. Gateway focused
suites and the full static import graph remain incomplete on the loaded host;
retain these proof gaps for the coordinator bundle rather than claiming green.

* refactor(gateway): trust prepared server method inputs

Remove a test-only config cache-reset wrapper, duplicate internal selection
and channel-support checks, an unused session-file metadata fallback, and
duplicate usage target shapes. Carry transcript delivery facts from their
first parsing pass. Keep all network validation, effect authority, transcript
durability, current update policy and standalone session memory machinery.

Best-effort tradeoffs accepted:
- Internal agent updates trust the selection-shape check at their sole
  production caller, agents.update. The duplicate originated in the Models
  agent-selection feature #150224; the same boundary check still rejects
  invalid user input. Live runtime choice validation stays at the effect.
- Channel start support is checked once at the synchronous request boundary.
  The inner check from #67815 / #167159 cannot observe a different plugin
  without unsupported synchronous mutation; the boundary guard remains.
- Workspace-root readers require caller-prepared metadata: both production
  consumers already provide it. The unused fallback from #161747 is deleted,
  not the Phase E backend or any factory. A future invalid internal caller
  gets a clear error instead of starting another metadata read.
- Update handlers trust the required getRuntimeConfig contract instead of
  falling back to a global schedule for an invalid context. Keep #158301's
  real scheduler-policy incident fix and its post-await current-config read.
- Usage summaries trust the canonical required target identity from #169660;
  the first-instance fallback served no production caller. The integration
  fixture now supplies that identity with all original assertions retained.

No public schema/config/SDK/protocol or persisted shape changes. The config
tests call the same canonical invalidators directly; no coverage is removed.

Follow-up removes 54 net production lines; branch total removes 154. Targeted
types (including MCP consumers), retained-file type-aware lint, formatting,
zero runtime import cycles, suppression audit and independent P2 review pass.
Gateway behavioral suites remain incomplete after a loaded-host startup run
was stopped at about ten minutes (exit 143). The prior full static-graph gap
remains pending for the coordinator bundle; no new production edge is added.

* refactor(ui): consolidate page lifecycle and config plumbing

Reuse the existing controller host, subscription and plugin-icon owners;
share cloud-worker config edit wiring and Usage query comparisons. Remove
the unused Usage detail predicate and duplicate model loading flag.

Retire the Web Awesome-era picker hiding fence now that native Popover
owns generation-bound close completion. Keep both rendering paths,
draft recovery, user-intent checks and dispatch-time write authority.
Settled rendering is unchanged. Net production reduction: 210 lines.

Best-effort tradeoffs accepted:
- Failed channel artwork retries on the next channel refresh rather than
  a queued trailing ensure. #131511 was a synthetic ordering regression;
  the human-reported owning-plugin bug #144152 remains covered.
- Picker triggers may reopen during closing. #126032's fence came from
  CI/synthetic overlap, not a human incident; #171441 transferred lifecycle
  ownership to native Popover, which ignores superseded completions.

Focused proof: 281 tests passed, including Chromium/WebKit overlay lifecycle
and responsive placement controls. Independent P0-P2 review: scoped-clean.
Final UI production and UI-pages test typechecks passed; suppression tests 3/3.
Scoped lint passed after a mechanical no-lonely-if fix.
Runtime and static import cycles: zero. No visual or locale changes.
The global environment-name budget is inherited at 455/454 on both the
untouched base and origin/main; none of its counted source roots changed.

* refactor(ui): remove unused new-session hiding selector

* refactor(gateway): retain legacy catalog and update handler contracts

Withdraw two wave-5 cleanups after focused CI failures and bounded isolated replay. Preserve the existing scalar-read concurrency and update-status handler contract. Tighten task-suggestions assertion allowance to match the cleaned source.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…-5 bundle A) (openclaw#172989)

* refactor(ui): remove unused page plumbing and duplicate presentation work

Fold sole-caller Config and Cron adapters into their existing owners, reuse
canonical controller types, and remove unused request arguments and login
selection options. Adopt the complete background mutation receipt instead of
rereading the write; keep authoritative preflight and live ownership checks.

Best-effort tradeoffs accepted: a later background edit in another browser is
reflected by normal preference events or refresh, not an unconditional read of
our own successful write. The introducing feature PR openclaw#168301 does not identify
a human incident requiring that reread. Settled rendering and public contracts
are unchanged; both shipping renderer paths remain intact.

* refactor(ui): consolidate presentation helpers and cached preview inputs

Share point-menu trigger attributes and deletion-first LCS traversal. Remove
an obsolete empty-badge predicate, a one-caller loading facade, and redundant
whole-map translation fallback. Preserve both active Lit and Solid paths,
positioning formulas, diff work budgets, visible text, and rendering.

Best-effort tradeoffs accepted:
- Trust successful synchronous Web Storage writes instead of reading them back.
  Introducing PR openclaw#162428 supplied synthetic storage failures, not a human
  incident where successful setItem silently failed. Nonconforming Storage
  replacements may miss a cache publication until the next refresh.
- Trust immutable message/tool-card identities for cached source previews.
  PR openclaw#148431's in-place mutation assertions were synthetic; production owners
  publish replacement snapshots. Unsupported in-place mutation may leave a
  decoration stale until replacement. Run/frame/origin and external source
  validation remain unchanged.

Net production reduction: 76 lines; tests: 20 lines removed, only synthetic
same-object mutation assertions. Kept config coercion tied to human Safari
report openclaw#13348, along with security, durability, ordinary navigation ownership,
and all active migration paths.

Focused proof: 73 boot/cache/diff tests, 82 menu tests, 46 badge/assistant tests,
20 i18n tests, 8 browser details tests, 3 lint-suppression tests; UI typecheck,
formatting, stylesheet lint and CSS declaration parity passed.

Known inherited local check failure: environment-variable count is 455 against
budget 454, independently reproduced against clean HEAD/index. Its counted
source roots exclude UI. No budget or unrelated source changes made.

* refactor(ui): remove obsolete presentation compatibility and styling

Use the native Popover capability required by the Control UI bootstrap
instead of retaining old-engine in-flow fallbacks. Keep native overlay
occlusion and all real connection/navigation ownership.

Remove retired sidebar style hooks and share identical question-panel
declarations. Supported browsers render identically; no user-visible
copy, feature, renderer selection, config, protocol, or storage change.

Best-effort tradeoffs accepted

- Old engines without Popover support, or invalid direct popover mounts,
  no longer receive an in-flow menu fallback. The fallback came from
  openclaw#105598 as generic compatibility, not a human incident; openclaw#168595 made
  native Popover support a required bootstrap capability. Invalid direct
  mounts now fail clearly rather than silently changing layering.

Deeper coverage and retained candidates are recorded in the requested
task-local y03 ledger for coordinator bundling.

Branch total: 123 net production LOC removed (+114/-237), excluding tests,
fixtures, generated files and declarations. Below the 500-line campaign
floor after the deeper components/app/lib/styles and lead-owned owner pass;
push branch-only for bundling.

* refactor(gateway): reuse server method owners

Consolidate duplicate catalog response handling,
optional catalog reads, pairing resolution, requester assertions and system
agent transcript persistence. Carry prepared pairing and actor facts instead
of probing or re-reading them. Remove redundant cache-generation and internal
receipt checks; retain security, durability, pagination and resource bounds.

Best-effort tradeoffs accepted:
- Pairing captures its selected adapter once. Repeated internal checks added
  by openclaw#112401 guarded hypothetical in-place plugin mutation, not a reported
  incident. Such a mutation now leaves this request on its selected adapter;
  later requests discover the current registration.
- Channel identity RPCs trust the canonical mutation result instead of
  repeating the action/kind assertion introduced in openclaw#161284. No human incident
  justified the redundant adapter assertion; live mutation authority remains
  with the state owner.

No user-facing feature, protocol/config/persistence shape, schema, dependency,
test coverage or standalone session memory backend changes.

Net production reduction: 100 lines (179 added / 279 deleted).
Type-aware lint, targeted production types, formatting, runtime cycles (zero),
SDK surface, suppression audit and independent P2 review pass. Gateway focused
suites and the full static import graph remain incomplete on the loaded host;
retain these proof gaps for the coordinator bundle rather than claiming green.

* refactor(gateway): trust prepared server method inputs

Remove a test-only config cache-reset wrapper, duplicate internal selection
and channel-support checks, an unused session-file metadata fallback, and
duplicate usage target shapes. Carry transcript delivery facts from their
first parsing pass. Keep all network validation, effect authority, transcript
durability, current update policy and standalone session memory machinery.

Best-effort tradeoffs accepted:
- Internal agent updates trust the selection-shape check at their sole
  production caller, agents.update. The duplicate originated in the Models
  agent-selection feature openclaw#150224; the same boundary check still rejects
  invalid user input. Live runtime choice validation stays at the effect.
- Channel start support is checked once at the synchronous request boundary.
  The inner check from openclaw#67815 / openclaw#167159 cannot observe a different plugin
  without unsupported synchronous mutation; the boundary guard remains.
- Workspace-root readers require caller-prepared metadata: both production
  consumers already provide it. The unused fallback from openclaw#161747 is deleted,
  not the Phase E backend or any factory. A future invalid internal caller
  gets a clear error instead of starting another metadata read.
- Update handlers trust the required getRuntimeConfig contract instead of
  falling back to a global schedule for an invalid context. Keep openclaw#158301's
  real scheduler-policy incident fix and its post-await current-config read.
- Usage summaries trust the canonical required target identity from openclaw#169660;
  the first-instance fallback served no production caller. The integration
  fixture now supplies that identity with all original assertions retained.

No public schema/config/SDK/protocol or persisted shape changes. The config
tests call the same canonical invalidators directly; no coverage is removed.

Follow-up removes 54 net production lines; branch total removes 154. Targeted
types (including MCP consumers), retained-file type-aware lint, formatting,
zero runtime import cycles, suppression audit and independent P2 review pass.
Gateway behavioral suites remain incomplete after a loaded-host startup run
was stopped at about ten minutes (exit 143). The prior full static-graph gap
remains pending for the coordinator bundle; no new production edge is added.

* refactor(ui): consolidate page lifecycle and config plumbing

Reuse the existing controller host, subscription and plugin-icon owners;
share cloud-worker config edit wiring and Usage query comparisons. Remove
the unused Usage detail predicate and duplicate model loading flag.

Retire the Web Awesome-era picker hiding fence now that native Popover
owns generation-bound close completion. Keep both rendering paths,
draft recovery, user-intent checks and dispatch-time write authority.
Settled rendering is unchanged. Net production reduction: 210 lines.

Best-effort tradeoffs accepted:
- Failed channel artwork retries on the next channel refresh rather than
  a queued trailing ensure. openclaw#131511 was a synthetic ordering regression;
  the human-reported owning-plugin bug openclaw#144152 remains covered.
- Picker triggers may reopen during closing. openclaw#126032's fence came from
  CI/synthetic overlap, not a human incident; openclaw#171441 transferred lifecycle
  ownership to native Popover, which ignores superseded completions.

Focused proof: 281 tests passed, including Chromium/WebKit overlay lifecycle
and responsive placement controls. Independent P0-P2 review: scoped-clean.
Final UI production and UI-pages test typechecks passed; suppression tests 3/3.
Scoped lint passed after a mechanical no-lonely-if fix.
Runtime and static import cycles: zero. No visual or locale changes.
The global environment-name budget is inherited at 455/454 on both the
untouched base and origin/main; none of its counted source roots changed.

* refactor(ui): remove unused new-session hiding selector

* refactor(gateway): retain legacy catalog and update handler contracts

Withdraw two wave-5 cleanups after focused CI failures and bounded isolated replay. Preserve the existing scalar-read concurrency and update-status handler contract. Tighten task-suggestions assertion allowance to match the cleaned source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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