Skip to content

refactor(gateway): deslop server methods and worker environments - #159752

Merged
steipete merged 8 commits into
mainfrom
deslop/l122-gateway-methods-workers
Sep 29, 2026
Merged

steipete merged 8 commits into
mainfrom
deslop/l122-gateway-methods-workers

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

This sweep removes redundant Gateway request handling and worker-environment code so existing owners remain responsible for validation, lifecycle decisions, and result projection.

User Impact

No user-visible behavior change is intended. RPC names, parameter/result/error shapes, authorization and current-owner revalidation, worker lifecycle/fencing, and persisted state remain unchanged.

Why This Change Was Made

The diff removes 976 net production lines across 111 production files (+1,836 / −2,812), entirely within src/gateway/server-methods/ and src/gateway/worker-environments/. Three test files add 56 net lines. The sweep is below the 1,000-line target; the complete coverage log records all 269 production files over 200 lines, sorted by size. All 646 production files were read. Coverage is pinned to base 2edf97b106a6c5cedf4abdbf694f5ac442566d85.

Recent merged sweeps were inspected before implementation, and overlapping cleanup was discarded during rebases. Existing assertions remain where removal would require changing a shared baseline outside this lane.

  • Bind repeated RPC validation through the existing helper, preserving the exact request object and each method's error and authority handling.
  • Keep approval wait projection with its sole caller and preserve synchronous native subscriber publication.
  • Reuse canonical workspace result journals, terminal-state classification, and keyed serialization while retaining commit-time guards.
  • Share configured-agent selection and retain deletion completion in the existing cleanup record instead of a parallel set.
  • Combine full-file and prefix-read metadata projection and reuse canonical hashing and normalization helpers.
  • Reuse validation bindings for skill RPCs and consume the workspace search owner's exact result without rebuilding the same fields.
  • Remove forwarding layers, redundant typed guards and projections, single-use aliases, and comments that repeat code.

Fixes Found Along the Way

Four session-file fixture failures came from mocks missing the real loader's required canonical agentId. The fixtures now carry that owner, retaining their assertions. The yield test also verifies cross-session page progress, rejecting an empty-read false positive. Its original failing hosted shard and 20 fresh-process Linux Testbox runs passed; removing only the production page yield caused the intended assertion to fail. Stop coverage exercises pre-admission behavior: stopping the selected agent must leave the compatibility owner's run accepted.

Separate fixes are merged and contribute no diff here: #160042 repairs the UTC-midnight transcript fixture (forced-rollover red/green, 20 fresh-process runs, three original-shard replays); #160843 restores config environment and node adapter lint budgets through extraction and fixture consolidation (full changed gate, 84 config/consumer tests, all 43 node cases, boundaries/protocol/SDK/build). No limits, suppressions, or baselines were increased.

Evidence

Three-pass full-diff P0–P2 review completed. Its sole finding assumed media stripping could return []; the canonical owner returns undefined for empty/filtered content, preserving the placeholder fallback. Source inspection and the passing registered-flow regression rejected it. No actionable finding remains; the raw combined report was not scoped-clean.

The original cross-shard selection covered both subtrees and 256 outside caller tests. Its main group had 14,057 passes / 874 files and an obsolete Tasks-selector failure, later repaired upstream with 80 passing artifact tests. Other groups passed; the original run was not wholly green.

Changed-test command walls (pnpm test <file> --maxWorkers=1): session files 21.19s, touched-file yield 16.00s, Stop/pre-admission 26.49s base / 21.99s candidate. Hosted case-execution totals on patch-equivalent head 0df367ed801 were 266ms, 40ms, and 2,283ms respectively (new Stop case 8ms), excluding startup/transforms.

Full Linux proof passed on 6aae84ea9f8f56d72a43401b7b9148d7970c3fe1, tree a82a3fe9454d12f87e3b6384b87e1548769ab493: full node scripts/check-changed.mjs --base origin/main (27 test-type graphs, core lint/guards, Knip), 479 tests across 26 incoming owner/caller files, the original Gateway shard (272 tests / 24 files), 20 fresh-process runs of all six queued-followup cases (120 passes), 62 import-boundary tests across six suites, pnpm protocol:check with zero drift, pnpm plugin-sdk:check-exports, pnpm plugin-sdk:surface:check, pnpm build, generated assets, and exact source/base/final cleanliness assertions. Blacksmith Testbox tbx_01m3nyaz7vx0fnq7dqeps6esw0, run 36532379537, 59m28.461s command wall, exit 0; lease stopped. Hosted CI 36532739691 also passed.

That proof includes the canonical #160465 queued-WebChat fixture repair: the fixture now joins its complete synthetic lifecycle producer before queue drain/reset, including failure-receipt persistence. This fixes the deletion CAS race; our unpublished alternative was discarded. The 20 repetitions exercise the whole six-case file, not a filtered or assertion-free selection.

The final rebase resolved an actual import conflict with #161010: main's workspace-root resolver and pending-checkout refusal remain, alongside direct canonical agentId use. It also incorporates #160909's committed-grant revocation semantics. Complete affected owners/callers and the integration delta were reviewed without actionable findings. Six commits are patch-identical; the first differs only in import context. Worker production files are unchanged from the fully proved base.

Final delta proof completed on 8bea97bd59b97d28e2ccf99b68856ea9d1a79bd9, tree 13bd51cfc3be98c01ab9462effba6110e85d5642. Blacksmith Testbox tbx_01m3p57ck3g4pqay51w8261y48, run 36544352571, 16m27.447s command wall. Passed: frozen install; changed checks for two incoming session-file/diff tests; core types and all four Gateway test-type graphs; conflict-file lint; 203 tests / ten integration files; 62 boundary tests / six suites; protocol zero drift; SDK exports; build/assets; exact source/base/final cleanliness. The sole failed phase was SDK surface budget; overall exit 1. Lease stopped. This focused conflict/incoming-delta validation reuses the preceding full proof; it is not another full 111-file changed check.

Inherited blockers: SDK surface reports 4594 public exports / 2698 callable against caps 4591 / 2695. The three documented, actively used MCP exports came from merged #160931; this lane adds none. #160444 owns a reviewed two-number correction with ten passing SDK tests, explicitly pending maintainer approval. No duplicate repair or budget increase was applied here. Hosted CI 36544687966 separately failed check-test-types: the upgrade fixture assigned readonly ChildProcess.pid on tested merge a03c9d26. Main has repaired that assignment in 64ef24b267b18ab32dc4acbe967d8c50d138c175. Refresh onto the canonical repairs and validate the affected gates before readiness; the failed/cancelled hosted run remains failed/cancelled evidence.

The passing server.sessions.create.auth-policy.test.ts exercises an isolated nonminimal Gateway and authenticated WebSocket sessions.create with explicit non-main keys. It observes committed entries before continuing the original send handler, then asserts real transcript persistence with retained authority and no write after revocation. Inference is mocked. This public creation/turn proof and the recovery harness below are separate layers; the extraction preserves custody owners and callback order.

Passing recovery proof on 6aae: worker-turn-shutdown.test.ts stages workspace bytes for non-main agent:main:worker-turn, enters restart draining, reconstructs SQLite placement state and runs startup recovery. It verifies restored bytes, no pending result, a released claim and fresh-turn reuse. placement-dispatch-staged-results.test.ts covers staged/draining and SQLite close/reopen recovery. These are real owner/SQLite/filesystem harnesses, not a WebSocket Stop plus OS-process restart.

An earlier native macOS fixture failure remains unproved/unfixed: lipo -archs receipt construction failed before the intended assertion with EPROCESSGROUP_CLEANUP_FAILED / kill EPERM, despite a terminated final tree. Six fixture/process files matched main and imported no changed Gateway code; the strict cleanup regression requires this error. A lipo dispatch shim was identified, but its causal role lacks native lineage proof. No timeout, assertion or guard was weakened. Later hosted macOS checks passed; that is not a fix claim.

NEEDS-MAINTAINER-DECISION: inherited SDK budget correction awaits its owner’s approval. Not READY; this refactor remains unmerged and unarmed.

Coverage log

All 646 production files were read. This table covers every production file over 200 lines on pinned base 2edf97b106a6c5cedf4abdbf694f5ac442566d85, sorted by base size. Test/support files are excluded. Each row records a simplification or why the retained owner remains necessary.

Complete size-sorted coverage: 269 production files over 200 lines
Lines Production file Status Outcome
1253 src/gateway/server-methods/config.ts READ Typed ID-array helper consumes its validated base; canonical record guard and narration cleanup; existing result assertion retained for strict subtree scope.
1147 src/gateway/server-methods/agents.ts READ Removed duplicate completion Set, redundant empty-loop guard and unregister forwarder; shared survivor predicate and journal projection remain. Pinned-main create/update avatar admission and accepted-identity publication order are untouched; cleanup changes stay in deletion.
1031 src/gateway/server-methods/cron.ts READ Merged identical preview exits and adjacent error boundaries; retained validated-param assertions, per-method errors, and the current-authority check after wake preparation.
954 src/gateway/server-methods/send.ts READ Removed narration and one-use completion/mirror projections. Pinned-main route/replay ownership is now message-operation-route; captured upload checks survive hydration and adapter handoff without replacing accepted receipts or partial-delivery results.
778 src/gateway/server-methods/doctor.ts READ Removed module narration; bounded top-eight selection and independent dreaming store/cron failure projection remain necessary.
755 src/gateway/worker-environments/bootstrap.ts READ Retained SSH receipt, integrity, lock-recovery, and timeout contracts; generated bootstrap phases serve different effects.
746 src/gateway/worker-environments/node-worker-tunnel.ts READ Retained exact environment/epoch authority and live node capability checks; native quiescence stays pinned to its nonce until confirmed release.
739 src/gateway/worker-environments/provider-lifecycle.ts READ No residual lane edit; upstream installation type annotation and provisioning/receipt/cancellation fences retained; refreshed upstream diff inspected.
735 src/gateway/server-methods/chat-abort-runtime.ts READ No residual lane edit; retained cancellation/partial-persistence ordering; upstream cancellation constant now belongs to the subagent-control type owner.
729 src/gateway/worker-environments/service.ts READ Canonical error recording, forced-abandon callback, and recovery fencing delegation remain necessary.
727 src/gateway/server-methods/approval-shared.ts READ Inlined the sole-use wait-result wrapper and explicit null filtering; source binding remains before decision wait, with exact authority/error projection retained.
727 src/gateway/server-methods/update.ts READ Preserve update admission/handoff/rollback and canonical redacted outcome logging after notification settlement.
724 src/gateway/server-methods/sessions-patch-engine.ts READ Retain ordered group admission, detached catalog replay, and per-target synchronous commit guards; no sound larger collapse.
722 src/gateway/worker-environments/worker-turn-launcher.ts READ Restart-specific claim retention before ordinary failure/release paths is required; no safe further simplification. Incoming main publishes refresh before preparation and waits without a turn claim; abort and admission rechecks retained.
721 src/gateway/worker-environments/inference.ts READ Retained admission/replay/cancellation settlement barriers and unknown-write fences; no equivalent simpler owner found.
720 src/gateway/server-methods/tools-effective.ts READ Derived trusted context from its producer; removed forwarding and duplicate cache-key parameters; centralized MCP notice projection; canonical method validation.
718 src/gateway/server-methods/chat-send-admission.ts READ Preserve keyed writer admission, exact session identity and post-await authority checks; no redundant admission owner remains.
717 src/gateway/server-methods/chat-send-agent-dispatch.ts READ Reply-progress title gate releases only for the matching run, unsubscribes, and always releases in dispatch cleanup; preserve these lifetime boundaries.
717 src/gateway/server-methods/devices.ts READ Combined denial responses, inlined one-use security forwarding and imported canonical authz type; existing parameter assertions and lifecycle fences retained for strict subtree scope.
715 src/gateway/server-methods/chat-send-reply-dispatch.ts READ No further sound change: transcript row identity, exact input anchors, media rewrite generation and delivery completion are distinct contracts.
715 src/gateway/worker-environments/local-workspace-projection.ts READ No residual lane edit against origin/main. Prior lane read: Retained durable baseline, pending result, journal, and quiescence ownership; broad consolidation would alter recovery boundaries.
715 src/gateway/worker-environments/placement-dispatch-startup.ts READ node admission, shutdown retention and provisioning recovery have distinct exact-owner and after-await guards; no sound collapse.
712 src/gateway/server-methods/sessions-abort.ts READ Preserve exact admitted target, synthetic-caller authority and lifecycle revalidation; distinct Stop phases remain necessary.
710 src/gateway/worker-environments/node-workspace-transfer-service.ts READ Shared queued context replacement retains previous-owner settlement, post-await authority, abort binding, and download-specific authorization.
703 src/gateway/worker-environments/node-bootstrap-artifact.ts READ Inspect package metadata before JavaScript and verify canonical archive identity; packaging and cleanup guards have separate responsibilities.
702 src/gateway/server-methods/chat-send-pre-admission.ts READ Removed one-use Stop owner projection; selected and compatibility owners now feed the real abort operation directly.
701 src/gateway/server-methods/question.ts READ Question request validation and live authority remain intact; pass the canonical scheduler to channel-retention owner.
700 src/gateway/server-methods/channels.ts READ One timeout/error/warning projection for probe/audit/summary; preserves hook-authored payloads and summary redaction.
700 src/gateway/server-methods/chat-abort-handler.ts READ Reuse canonical DedupeEntry; preserve new caller authority, lifecycle revalidation and narrow target selection.
700 src/gateway/server-methods/sessions-rewind.ts READ Unified fork/rewind response projection; existing inference-control adapter and assertions retained for strict subtree scope.
698 src/gateway/server-methods/chat-metadata-runtime.ts READ No further sound change: generation, refresh settlement, requester-local projections and stop drainage have distinct invalidation lifetimes.
698 src/gateway/server-methods/chat-send-handler.ts READ No lane edit; pinned-main attachment custody and goal guard use their extracted owners. Upload authority remains at staging, original-input commit, injection and pre-ACK handoff; accepted input custody survives separately.
695 src/gateway/server-methods/system-agent.ts READ Bound setup/history RPC validation through the existing helper and reused the runtime constructor; preserved the original auth request object and all results/errors.
695 src/gateway/worker-environments/computer-transport.ts READ Retain exact run, placement, node and policy authority; takeover replay and fresh-observation guards protect distinct lifecycle contracts.
695 src/gateway/worker-environments/node-launch-adapter.ts READ Retained launch admission, exact receipt/result projection, warm-worker negotiation and cancellation custody; new native ownership belongs to the existing supervisor.
693 src/gateway/server-methods/sessions-dispatch.ts READ Inlined one-use move response forwarding wrapper; retained placement retry and reclaim differences.
693 src/gateway/server-methods/sessions-suggestions.ts READ Inlined one-use resolution-state wrapper; retained claim/release/finalize error distinctions.
692 src/gateway/server-methods/sessions-sharing.ts READ No lane edit; upstream queued diagnostics measure profile/evidence/projection waits; membership, sharing and live authorization remain canonical.
682 src/gateway/server-methods/nodes.invoke.ts READ Removed redundant return branch only. Pinned-main upload guard still runs before wake/policy work, after awaited policy/pairing work and at final transport dispatch; approval handoff, deadlines and dispatch provenance remain unchanged.
680 src/gateway/worker-environments/workspace-quiescence-scripts.ts READ Retained platform-specific lease identity, watchdog recovery and resume ordering; these scripts execute in separate remote runtimes.
679 src/gateway/server-methods/models-list-result.ts READ Removed redundant ModelChoice alias and module narration; prepared owner/readiness and public projections stay separate.
679 src/gateway/server-methods/sessions-create.ts READ Retained creation commit, live source-authority transition and publication ordering; these are distinct lifecycle responsibilities.
678 src/gateway/worker-environments/worker-turn-rpc.ts READ Applied: share inference start/cancel identity and request validation; retain post-await owner checks.
675 src/gateway/server-methods/terminal.ts READ No lane edit; pinned-main node upload stage checks upload authority at entry and final dispatch, sending only name/base64 wire fields. Existing shell/catalog launch, pairing and deadline lifecycle remain unchanged.
670 src/gateway/server-methods/chat-transcript-persistence.ts READ Retained explicit append projection: it deliberately drops structural extra timestamp and transcript path fields.
668 src/gateway/worker-environments/placement-dispatch-pending-results.ts READ Shared finalize/publish/settle flow carries Stop conflict retention and preserves reclaim-specific teardown ordering.
668 src/gateway/worker-environments/placement-store.ts READ Observation must be acquired before read and released on failure; preserve exact result custody.
664 src/gateway/worker-environments/worker-session-tool-executor.ts READ No change: durable idempotency, lost-response recovery, and child incarnation checks have distinct outcomes.
660 src/gateway/server-methods/board.ts READ Retained distinct widget content materialization and capability guards; shared defineBoardMethod already owns errors.
658 src/gateway/worker-environments/workspace-sync.ts READ Canonical manifest decoding retains transport authentication, staging, quiescence and reconciliation ownership.
651 src/gateway/worker-environments/placement-turn-claims.ts READ Recovery fencing must precede claim publication; retain authoritative owner checks.
648 src/gateway/server-methods/sessions-files.ts READ Use loader-owned agentId and remove forwarding helper; preserve prepared-read authority forwarding, remote root selection, and host-specific reveal errors.
644 src/gateway/worker-environments/inference-runtime.ts READ Host-owned prompt-cache context and canonical usage projection serve distinct approval, cancellation and terminal-result contracts.
644 src/gateway/worker-environments/node-worker-workspace-actions.ts READ Retained workspace authority and command ownership; native/legacy quiescence selection must stay with the current node proof.
641 src/gateway/server-methods/exec-approval.ts READ No sound change: request normalization, display safety, durable approval registration and resolve guards protect distinct contracts.
641 src/gateway/worker-environments/placement-move-intent.ts READ Unused batched getPlacementMoves removed upstream; no remaining callers, preserve canonical move operations.
640 src/gateway/worker-environments/session-attachment-service.ts READ Retain upstream #158786 shared touch authority owner; narrow allocationKey to its sole branch.
639 src/gateway/worker-environments/worker-turn-execution.ts READ Capture cache identity from admitted transcript state; preserve handoff, transcript and workspace settlement ordering. Incoming main resolves destination tools before launch preparation and retains subsequent live-authority checks.
638 src/gateway/worker-environments/environment-access.ts READ Remove redundant normalization; preserve pending-destruction error projection and canonical access owner.
633 src/gateway/server-methods/system-changes.ts READ No residual lane edit against origin/main. Prior lane read: Bounded two-journal merge and cursor collapse carry distinct ordering contracts; simplification would cross SQLite read ownership.
627 src/gateway/server-methods/projects.ts READ Retained bounded sorted candidate admission, visibility fences, separate observed/registry projections and clone-specific errors.
623 src/gateway/server-methods/workspace-files.ts READ Combine inline/prefix metadata projection and consume search results directly; preserve remote read authority, read-only hashes, unsupported prefix, and remote-root git exclusion.
612 src/gateway/worker-environments/provider-intent.ts READ No residual lane edit against origin/main. Prior lane read: Removed obsolete local type export after upstream pool adopted owner-derived type; admission/retention/replay unchanged.
609 src/gateway/server-methods/chat-history-handler.ts READ Preserve worker-read exact receipts and prevent cancelled receipts from being projected as queued.
600 src/gateway/worker-environments/live-events.ts READ Retained ordered replay window and independent live-run ownership; prior refactors already share projection/window helpers.
597 src/gateway/server-methods/sessions-mutations.ts READ No residual lane edit against origin/main. Prior lane read: Retain patch/patchMany response differences and plugin/owner/reset authorization boundaries already consolidated by recent lanes.
591 src/gateway/server-methods/skills.ts READ Remaining cleanup removes the redundant SkillsUpdateParams annotation/import and uses its existing params alias. Pinned-main handleSkillsInstall extraction and proposal support-file publication guards are fully retained.
590 src/gateway/worker-environments/prepared-pool.ts READ No residual lane edit against origin/main. Prior lane read: Upstream #158786 already derives preparation options from provider-intent owner; retained upstream and removed obsolete local type export.
588 src/gateway/worker-environments/store.ts READ Capture the optional worker clock centrally at the existing mutation boundary; remove duplicated envelopes.
583 src/gateway/server-methods/task-suggestions.ts READ Canonical method validation; single RPC response capture preserves dispatch error/rollback semantics; common acceptance publication.
582 src/gateway/worker-environments/placement-turn-claim-events.ts READ Own the exact claim incarnation and frozen cache context; identifier checks cannot replace live run and approval authority.
578 src/gateway/worker-environments/placement-dispatch-coordinator.ts READ Retained per-session admission and results-only recovery loans; FIFO, original reservations, and join-before-release remain required.
570 src/gateway/worker-environments/workspace-reconcile-recovery.ts READ Applied: canonical recovery-conflict error construction preserves eight identical messages.
569 src/gateway/server-methods/models-auth-status.ts READ Removed module narration; OAuth/token rollups, profile identity redaction and source ownership have distinct contracts.
567 src/gateway/server-methods/chat-abort-authorization.ts READ Canonical normalization and DedupeEntry replace local repetition; new host-held session authority and exact target matching remain intact.
566 src/gateway/worker-environments/workspace-result-finalize.ts READ Deferred remote-exec tunnel admission and settlement guards own cancellation and custody; no safe further simplification.
565 src/gateway/server-methods/environments.ts READ No sound change: device/cloud projections and mutation error maps differ; awaited authority checks and prepared-pool privacy retained.
550 src/gateway/server-methods/push.ts READ Flattened APNs direct/relay IIFEs into branch-local dispatch while preserving secret selection and stale-token cleanup.
543 src/gateway/server-methods/agents-files.ts READ Canonical configured-agent resolver still preserves normalization/errors. Pinned-main identity IO helpers retain bounded local/remote reads, workspace identity and upload pre-mutation guards; no guard moved by cleanup.
543 src/gateway/worker-environments/bundle.ts READ Replaced parallel four-field manifest comparator with existing canonical bundle hash owner used by node bootstrap.
536 src/gateway/worker-environments/placement-record.ts READ No residual lane edit against origin/main. Prior lane read: Removed ten one-use record aliases and duplicated state inventory via exhaustive state-to-metadata union.
532 src/gateway/server-methods/control-ui.ts READ No sound change: personal GitHub identity and session-source readers own distinct authority and late-read lifetimes.
532 src/gateway/server-methods/shared-types.ts READ Retained shared request/lifecycle contracts consumed across Gateway callers; authorization source is bound to the exact request object.
531 src/gateway/worker-environments/store-projection.ts READ Native overlays can temporarily contain mixed SSH/node identities; existing shape checks protect independent projection reads.
520 src/gateway/server-methods/message-operation-route.ts READ New pinned-main owner; READ full. Owns route-alias locking, bounded replay retention and canonical in-flight admission. Prior receipts replay before new-input upload policy; scheduled reads reauthorize and do not replay cached results. No competing route owner retained.
519 src/gateway/server-methods/artifacts.ts READ Removed narrating module/handler comments; retained queued-download sharing and per-caller disclosure fences.
518 src/gateway/worker-environments/workspace-sync-scripts.ts READ One manifest program serves child and resident-worker adapters; inventory bounds, path exclusions and mutation checks remain required.
514 src/gateway/server-methods/session-change-event.ts READ Retain coalesced deletion identity, leading/trailing delivery, and bounded publication ownership.
508 src/gateway/worker-environments/workspace-result-staging.ts READ Own prepared/canonical ref custody and unchanged journal acceptance; preserve durable publication and recoverable cleanup.
504 src/gateway/worker-environments/placement-dispatch.ts READ Consume relocated recovery contract without restoring its old declaration; dispatch remains one owner.
502 src/gateway/worker-environments/workspace-accepted-remote-script.ts READ No change: explicit transaction phases and namespace commit point preserve shipped recovery state.
492 src/gateway/server-methods/approval.ts READ Removed narrating comments; lookup/CAS/reviewer custody rechecks remain distinct required authority boundaries.
491 src/gateway/worker-environments/placement-session-tool-operations.ts READ operation replay custody, tool admission closure and async drain need their distinct guards; no sound collapse.
483 src/gateway/server-methods/sessions-compact.ts READ Reused exact transcript scope and simplified target/kept-result projection; existing inference-control adapter and assertions retained for strict subtree scope.
481 src/gateway/server-methods/chat-send-session.ts READ Retained prepared session target and source identity through yields; normalization and revalidation serve distinct ownership stages.
473 src/gateway/worker-environments/prepared-environment-store.ts READ No residual lane edit against origin/main. Prior lane read: Upstream #158786 already adopted canonical mutation-method contracts and removed prepared-capacity forwarder; retained upstream.
472 src/gateway/server-methods/chat-restart-recovery.ts READ No further sound change: HMAC request identity, persisted retry claims and terminal tombstones carry shipped recovery contracts.
472 src/gateway/worker-environments/placement-dispatch-failure.ts READ Canonical terminal-state helper removes repeated cases; preserve newly required recovery fencing capability.
470 src/gateway/server-methods/chat-send-dispatch-errors.ts READ No lane edit; pinned-main preserves upload authorization errors before existing goal/unavailable mapping. Accepted/queued/aborted input persistence and terminal lifecycle custody remain distinct.
470 src/gateway/worker-environments/placement-workspace-result.ts READ Result mutations must publish invalidations for held refresh observations; no safe further simplification.
469 src/gateway/server-methods/sessions-read.ts READ No residual lane edit; retained post-await read authorization and upstream connection-ancestor invalidation before the roster response.
466 src/gateway/server-methods/chat-send-source-finalization.ts READ Inlined one-use committed-media attachment wrapper; consolidated stage diagnostics and removed redundant filtering of owned content.
465 src/gateway/worker-environments/workspace-sync-helpers.ts READ Applied: reuse abortable Node timer for quiescence wait; preserve false-on-abort contract.
462 src/gateway/server-methods/usage.ts READ Aggregation, creator identity, cache keys and source-specific response projection are distinct contracts.
460 src/gateway/worker-environments/workspace-actual-manifest.ts READ No residual lane edit against origin/main. Prior lane read: Applied: reuse exact file snapshot instead of redeclaring its projection.
459 src/gateway/worker-environments/session-repository-checkpoints.ts READ Publication and recovery checkpoint paths have separate optional-corruption and live-authority contracts; no safe collapse. Incoming main delegates unchanged bare SHA1 initialization arguments; revision and staged-result guards remain.
449 src/gateway/server-methods/nodes.pairing.ts READ No sound change: node-role removal, pending ownership and approval generation replacement require different lifecycle ordering.
448 src/gateway/worker-environments/provider-owner-lifecycle.ts READ Inline cancellation/lifecycle forwarding while preserving durable discard-before-cleanup and refresh authority checks.
441 src/gateway/server-methods/usage-session-selection.ts READ Retained-instance versus family ownership and exact stored target selection are distinct; no sound standalone reduction.
440 src/gateway/server-methods/session-catalog-list.ts READ Retain consuming-frame materialization loops; extracting an awaited helper would reopen stale-row delivery gap.
429 src/gateway/worker-environments/repository-project-admission.ts READ Retained immutable repository-instance and credential source revalidation around network reads; REST and GraphQL need separate contracts.
427 src/gateway/server-methods/cron-caller-scope.ts READ No sound change: signed creator, operator management and current-job grants intentionally have different visibility and commit guards.
427 src/gateway/server-methods/migrations.ts READ No lane edit; upstream replaced manual completion resolver with createDeferredCore; in-flight apply reservation and terminal-result ownership retained.
425 src/gateway/server-methods/system-agent-approval.ts READ Exact-proposal authority reconciliation and corrective approval flow retain required live checks after awaited work.
425 src/gateway/worker-environments/credential-broker.ts READ Unified duplicate turn-claim assertions for renewal and delivery commit; removed redundant aliases and stopping temporaries.
420 src/gateway/server-methods/nodes.read.ts READ No sound change: pending projection, plugin capability renewal and inventory persistence fence different identities.
419 src/gateway/server-methods/chat-send-reply-finalization.ts READ Consolidated repeated rejection publication at unchanged delivery authority checkpoints.
417 src/gateway/server-methods/session-create-project.ts READ Retain project/worktree rollback and live saved-intent checks before binding; no duplicate owner remains.
415 src/gateway/worker-environments/placement-row-codec.ts READ No residual lane edit against origin/main. Prior lane read: prior deslop already removed reconstruction duplication; row validation and state transition fences are required.
415 src/gateway/worker-environments/transcript-commit.runtime.ts READ No change: active-branch prefix and cross-DAG recovery prove different idempotency cases.
413 src/gateway/worker-environments/inference-control-internal.ts READ Retained exact captured registrations and deferred drain start; cancellation and settlement semantics differ intentionally.
412 src/gateway/server-methods/plugins.ts READ Bound catalog browse/categories to canonical validated-handler owner; retained local/remote fallbacks, inspection options and exact errors.
412 src/gateway/worker-environments/node-desktop-carrier.ts READ Retained desktop-registry epoch claims, stream custody, and app launch fences; transport-only wrappers carry ownership.
411 src/gateway/worker-environments/placement-turn-authority.ts READ Observation revocation, rollback recovery, and exact claim incarnation are required custody boundaries.
408 src/gateway/server-methods/sessions-patch-model-selection.ts READ Retain status-origin defaults, personal authority, native consent, queued selection, and placement checks.
408 src/gateway/worker-environments/placement-reclaim.ts READ Shared journal retains authority checks and accepted-manifest tracking.
407 src/gateway/server-methods/secrets.ts READ Bound secret-store RPCs to canonical validated-handler owner; retained redaction, exact error fields and post-persistence refresh outcomes.
407 src/gateway/worker-environments/placement-dispatch-recovery.ts READ Retained staged-result recovery and results-only stop boundary; full recovery must not run under borrowed Move admission.
407 src/gateway/worker-environments/project-preparation.ts READ Retained preparation identity, private/public pack branches, recipe authorization, and retained-build verification.
402 src/gateway/server-methods/sessions-patch-archive.ts READ Simplified target-incarnation comparison without changing expected-ID, existence, or lifecycle rejection.
401 src/gateway/server-methods/themes.ts READ Personal-tool target comes from the live participant owner; retain post-read revalidation and guarded preference writes.
401 src/gateway/worker-environments/worker-turn-admission.ts READ Deferred operation start prevents cancelled callers launching work; keep explicit lifetime observer. Both admission paths reject refresh starting during admission; claims remain bound to current placement and owner.
398 src/gateway/server-methods/chat-send-message-injection.ts READ No further sound change: accepted steering, unconfirmed receipts, fallback dispatch and progress refresh have distinct custody outcomes.
397 src/gateway/worker-environments/node-workspace-retain-coordinator.ts READ Uses canonical terminal-state predicate; removed duplicate node-id filter already guaranteed by nodeEnvironments.
392 src/gateway/server-methods/sessions-delete.ts READ Retain exact-row delete custody and post-commit hook/worktree order; archive/deletion contracts differ.
391 src/gateway/worker-environments/desktop-tunnel.ts READ No lane edit; upstream start gate now uses createDeferredCore; existing serialized startup, authority and shutdown/cleanup custody retained.
391 src/gateway/worker-environments/node-enrollment.ts READ Retained enrollment reservation and device/setup identity checks around async provisioning; distinct error boundaries and immutable captures.
389 src/gateway/server-methods/chat-assistant-content.ts READ No further sound change: prepared/raw text differs deliberately; raw wrapper has cron production caller and media/sensitive projection owns distinct persisted content.
389 src/gateway/server-methods/skills-library.ts READ Canonical validator preserves exact options and original custom error boundary. Pinned-main captured file-mutation authority and retained-file expected-revision/duplicate checks remain inside the same read/CAS/save ownership flow.
387 src/gateway/worker-environments/provider-node-provisioning.ts READ No residual lane edit; upstream explicit preparation result type retained with enrollment/finish authority checks; refreshed upstream diff inspected.
386 src/gateway/server-methods/chat-reply-media.ts READ No further sound change: workspace/remote/local-root policy and sensitive media handling retain live source-session authority.
380 src/gateway/worker-environments/session-placement-lifecycle.ts READ Mutation/archive/retirement/reclaim guards have distinct state allowances and failure messages; no safe merge.
378 src/gateway/worker-environments/placement-move-service.ts READ Retain canonical identity and terminal predicates plus intent passing; preserve projection-supplied initial placement.
376 src/gateway/server-methods/channel-pairing.ts READ No residual lane edit against origin/main. Prior lane read: Removed module narration; approval notification/bootstrap and dismissal deliberately have distinct failure/result contracts.
375 src/gateway/worker-environments/node-worker-repository-preparation.ts READ Retained credential-free Git subprocess boundary and seed fallback diagnostics; prior authority fix must remain intact.
374 src/gateway/server-methods/session-mutation-guards.ts READ Retained current owner-held mutation authority, exact request binding and post-await revocation guards; no redundant guard remains.
371 src/gateway/worker-environments/worker-turn-payload.ts READ Bind host-prepared cache facts through the live runtime owner; main already consolidated redundant wrappers.
370 src/gateway/server-methods/system.ts READ Presence deltas and host snapshots already use canonical owners; recent idle/presence optimizations preserved.
369 src/gateway/worker-environments/inference-store.kernel.ts READ No residual lane edit against origin/main. Prior lane read: Retained normalization, exact turn predicates, and replay retention; prior deslop recently consolidated this storage kernel.
368 src/gateway/worker-environments/workspace-manifest.ts READ No change: raw manifest and journal parsing have separate error and persisted-shape contracts.
367 src/gateway/server-methods/workspace-fs.ts READ Use one full/prefix read-result contract; remote owner retains bounded preview/listing, local fs-safe guards, and no-CAS edit rejection.
366 src/gateway/server-methods/users.ts READ Single-participant personal preferences retain identity policy and the writer commit guard; no redundant owner remains.
365 src/gateway/server-methods/sessions-lifecycle-drain.ts READ No residual lane edit; retained existing inference-control adapter, mutex-free drain and worker settlement to avoid out-of-subtree assertion baseline changes.
365 src/gateway/worker-environments/store-transitions.ts READ Synchronous exact retained-result validation is required during bootstrap refresh.
364 src/gateway/server-methods/chat-history-page-kernel.ts READ No further sound change: anchor neighborhoods, replay-safe offsets and CLI-tail pagination have distinct reader contracts.
361 src/gateway/server-methods/chat-history-budget.ts READ No residual lane edit; retained private unavailable sentinel and byte/recovery bounds. Pinned-main response-page owner supplies omission count/bytes instead of rebuilding survivor state on the host.
361 src/gateway/server-methods/chat-send-attachments.ts READ No lane edit; pinned-main composes cancellation, work and upload guards across parse/stage awaits and preserves typed authorization errors. Prepared-media custody now has one recorder-binding owner until durable input or dispatch owns it.
354 src/gateway/worker-environments/workspace-manifest-worker.ts READ Own dispatch, transferable buffers, input accounting and hash-memo publication; callers use canonical computation operations.
352 src/gateway/worker-environments/ssh.ts READ Represented repeated -o arguments through one ordered option list; inlined one-use exit-255 predicate without changing retry selection.
349 src/gateway/worker-environments/transcript-commit-store.ts READ No change: pending/replay/recovery decisions and exact sequence updates preserve persisted ledger semantics.
348 src/gateway/worker-environments/workspace-inventory-computation.runtime.ts READ No residual lane edit; current budget class owns validation directly and the obsolete five-scalar forwarder is absent.
346 src/gateway/server-methods/chat-send-request.ts READ Reused canonical SHA-256 helper for immutable request identity with byte-identical JSON input.
340 src/gateway/server-methods/chat-send-user-turn.ts READ Host-only requester binding for authenticated browser input retains live source/client/profile checks and distinct user-turn preparation.
336 src/gateway/server-methods/usage-date-range.ts READ Calendar-day validation, DST/date-line lookahead and legacy offset fallback are named behavior; prior deslop preserved.
335 src/gateway/server-methods/plugin-approval.ts READ Normalized metadata once; removed redundant validated severity cast.
334 src/gateway/server-methods/config-write-flow.ts READ Removed narrating comments; retained committed previous-to-next auth snapshot handoff and rollback semantics.
333 src/gateway/server-methods/conversations.ts READ No sound change: existing shared write owner already combines send/turn while durable conflicts release speculative identity separately.
331 src/gateway/server-methods/session-active-runs.ts READ Retained helper and its test: Gateway maintenance uses registered-run state to fence media cleanup.
328 src/gateway/worker-environments/placement-turn-claims-store.ts READ Handoff command projection and uncertain-write invalidation preserve durable custody.
324 src/gateway/server-methods/tts.ts READ No residual lane edit against origin/main. Prior lane read: Shared speech/provider status owners and error mapping already consolidated; synthesis routes carry distinct payload contracts.
322 src/gateway/server-methods/chat-history-session-read.ts READ Retained resident selection and excluded-row checks; upstream retained-history contract is now Cron history with separate transcript identity and post-await authorization.
318 src/gateway/worker-environments/workspace-accepted-sync.ts READ No change: ambiguous apply/commit outcomes need separate settlement paths before any inverse mutation.
316 src/gateway/worker-environments/store.kernel.ts READ Use canonical terminal-state predicate from lightweight state owner; native typed kernels retain existing writes.
315 src/gateway/worker-environments/node-worker-bundle-installer.ts READ Retained installation integrity, progress, enrollment budgets and completion custody; each boundary protects a distinct transport or lifecycle stage.
315 src/gateway/worker-environments/node-workspace-upload-reader.ts READ Retained bounded framing, streaming digest checks, and post-await write authority; recent short-write fix is substantive.
314 src/gateway/server-methods/session-catalog-provider-access.ts READ Retain registry-scoped caches, bounded provider steps, and completion-consumer custody.
313 src/gateway/server-methods/nodes.wake.ts READ Canonical sleep replaces one-use timer helper; one reconnect projection loop retains final deadline read and pairing checks.
308 src/gateway/server-methods/agent-session-patch.ts READ No residual lane edit; current canonical session/group reuse imports trusted subagent metadata from the retained agent-subagent-registration owner.
307 src/gateway/worker-environments/worker-turn-media.ts READ No change: current versus historical media availability, private staging, and transcript projection have distinct contracts.
305 src/gateway/worker-environments/workspace-mutation-lock-remote-script.ts READ No residual lane edit against origin/main. Prior lane read: No change: inode-bound acquire/reclaim/release CAS checks are required; previous pass removed stale compatibility.
304 src/gateway/worker-environments/placement-projector.ts READ Obsolete optional reader member and narrating comment removed upstream; current state projection remains exhaustive.
303 src/gateway/worker-environments/workspace-reconcile-apply.ts READ Direct canonical manifest capture replaces its forwarding helper with identical arguments and publication guards.
302 src/gateway/server-methods/session-catalog-list-lifetime.ts READ Retain asynchronous subscriber preparation and provider publication settlement; no safe phase merger.
302 src/gateway/worker-environments/workspace-sync-inventory.ts READ No change: bounded pipe writer retains process-tree settlement and cancellation precedence.
298 src/gateway/server-methods/plugin-host-hooks.ts READ Inlined one-use schema error formatter and tightened explanatory comment.
295 src/gateway/worker-environments/placement-workspace-journal.ts READ Exact journal ownership is shared with worker projection; no sound further simplification identified.
291 src/gateway/server-methods/sessions-subscriptions.ts READ Pass narration mode and subscription ID through provisional commit/rollback and scoped unsubscribe; preserve approval replay authorization.
291 src/gateway/server-methods/web-search-status.ts READ Provider credential precedence, prepared catalog decisions and native/external routes are distinct ownership contracts.
289 src/gateway/worker-environments/skill-resource-transfer.ts READ No change: exact directory identity, bounded chunks, and generated child script protect private resources.
288 src/gateway/server-methods/claws-monitors.ts READ No sound change: inspect/quiesce/drain guard distinct deletion fences and must re-read after receipt/database awaits.
287 src/gateway/server-methods/users-personal-file.ts READ Single-participant guard composes with current-profile and filesystem CAS boundaries; preserve these independent authority checks.
283 src/gateway/worker-environments/service-contract.ts READ No residual lane edit; retained original leaf service contract after optional inference-method expansion was rolled back for strict subtree scope.
281 src/gateway/server-methods/models-auth-status-usage-cache.ts READ Removed module narration; credential/config scoped SWR generation and late completion ownership retained.
278 src/gateway/server-methods/chat-send-command-replies.ts READ Inlined one-use combined-semantic predicate; retained prepared reply ownership and raw command/media merge behavior.
278 src/gateway/worker-environments/workspace-result-inventory.runtime.ts READ Shared preview-cap import uses new canonical owner; bounded inventory/payload validation remains required.
276 src/gateway/server-methods/update-status.ts READ OCM versus native ledger status and restart drain reconciliation have distinct ownership/lifetime rules.
276 src/gateway/worker-environments/placement-worker-gate.ts READ Recovery-only fencing and retained authority across result handoff must remain explicit.
275 src/gateway/server-methods/agent-session-prepare.ts READ Combined pre-attachment deletion/rotation error path without changing either error message.
275 src/gateway/worker-environments/store-row-codec.ts READ Decoder owns persisted-state validation; fallback-port and bootstrap decoding preserve corruption failures.
274 src/gateway/server-methods/sessions-patch-expectations.ts READ No lane edit; upstream uses config/sessions tool-override equality and sqlite-lifecycle-errors; expected-session and owner-held commit guards retained.
273 src/gateway/server-methods/agents-workspace.ts READ Canonical configured-agent lookup replaces repeated normalization/membership; preserve shared preview cap and remote read behavior.
271 src/gateway/server-methods/chat-webchat-media.ts READ Removed one-use audio embedding result adapter and duplicate guards; owning media loop now handles trim and audio dedupe directly.
271 src/gateway/server-methods/sessions-messaging.ts READ No residual lane edit; pinned-main checks uploads before implicitly creating a missing main session while accepted retry receipts still flow to canonical chat replay. Bound authority, reactivation and cancellation cleanup remain distinct.
271 src/gateway/worker-environments/node-workspace-transfer-http.ts READ Centralized shared environment/digest route validation and removed redundant blob argument reprojection; same route/result contracts.
270 src/gateway/server-methods/chat-broadcast.ts READ Removed a second normalization of the already-normalized agent ID; existing empty-config assertion retained for strict subtree scope.
270 src/gateway/worker-environments/tunnel-contract.ts READ Required publication/disposal and optional unchanged-result acceptance describe distinct supported lifecycle states.
269 src/gateway/server-methods/chat-send-commentary-media.ts READ No further sound change: before-publication media preparation, captured writer authority and rollback cleanup are all lifecycle requirements.
269 src/gateway/server-methods/web-search.ts READ Read/status and administrator probe paths have distinct authority and sanitized error semantics.
265 src/gateway/server-methods/chat-user-turn-recorder.ts READ Reused canonical SHA-256 helper for stable pending-input fingerprint; retained canonical transcript recorder ownership.
265 src/gateway/server-methods/session-catalog-entry-snapshot.ts READ Retained canonical planning cache keyed by projection revision, config, and fallback agent; actor/profile identity remains request-scoped and adoption identities are rechecked. Current upstream owner read after rebase.
264 src/gateway/server-methods/update-report.ts READ Consent/connection lifetime and exact failed-attempt binding govern publication; avoid mixing report and status owners.
263 src/gateway/server-methods/chat-message-get-handler.ts READ No residual lane edit; canonical string normalization; pending-input IDs and transcript IDs deliberately have separate visibility owners.
263 src/gateway/worker-environments/project-setup-script.ts READ Retained isolated HOME, pristine Git verification, process-group cleanup, and content-addressed completion witness.
262 src/gateway/worker-environments/session-attachment-store.ts READ Use canonical mutation-method signatures and share insert/update attachment values while retaining immutable identity columns.
261 src/gateway/server-methods/sessions-github.ts READ Retain shared/personal publication authority and exact caller error mapping; helper already canonical.
260 src/gateway/server-methods/approval-visible-record.ts READ Retained live/durable reconciliation and source binding; branches enforce exact record identity and current authority.
259 src/gateway/server-methods/chat-origin-routing.ts READ No residual lane edit; canonical string normalization; retained shipped main/global/legacy delivery routing and ACP bridge identity contracts.
259 src/gateway/server-methods/environments.session.ts READ Validate personal presentation target before allocation; retain session/run/tool-policy checks and post-await authority assertions.
259 src/gateway/server-methods/models-auth-status-facts.ts READ No sound change: metadata/credential generation cache and semantic expiry invalidation protect fresh auth facts.
255 src/gateway/server-methods/approval-record-lookup.ts READ Retained canonical record lookup, visibility and source binding; pending/resolved guards protect distinct states.
254 src/gateway/server-methods/exec-approvals.ts READ No residual lane edit against origin/main. Prior lane read: Removed redundant file validation after schema guard; shared node payload parser replaces identical callbacks.
254 src/gateway/server-methods/tools-catalog.ts READ Resolved tool entries and unresolved declared tools need distinct metadata/default projections.
253 src/gateway/server-methods/chat-history-pages.ts READ No lane edit; CLI import, incognito/local reads and forwarded/profile-label projection remain distinct. Pinned-main admitted encoded pages pass through; host-owned label cases retain object projection.
253 src/gateway/server-methods/commands-list-result.ts READ Removed narrating comments; separate text/native/plugin projections preserve bounds and plugin naming policy.
252 src/gateway/worker-environments/artifact-transfer-http.ts READ Retained canonical range serving: descriptor ownership, live authorization, per-chunk revocation, and close-before-release ordering remain necessary. Incoming main adds bounded range-serving progress; chunk authority and expiry checks remain required.
251 src/gateway/worker-environments/portal-node-carrier.ts READ Retained per-request stream tickets and durable portal binding; cancellation and connection lifetimes intentionally differ.
249 src/gateway/server-methods/agent-session-reset.ts READ Passed existing request facts into pure reset-result owner instead of rebuilding same projection twice.
246 src/gateway/worker-environments/workspace-reconcile-preflight.ts READ Preserve filesystem conflict classification and ancestor lifting; replacement and retained-input cases have distinct safety contracts.
245 src/gateway/server-methods/github-personal-authorization.ts READ No sound change: live scope intersection, durable profile owner and session incarnation checks are independent authorization boundaries.
244 src/gateway/server-methods/session-catalog-visibility.ts READ Retain current privacy recheck after provider IO and adopted-instance fencing.
244 src/gateway/worker-environments/workspace-hash-memo.ts READ No change: explicit standalone source and host memo share canonical owner after prior refactor.
243 src/gateway/worker-environments/worker-turn-attachments.ts READ No change: original attachment transfer preserves directory/file identities and per-chunk budgets.
239 src/gateway/worker-environments/service-validation.ts READ Unknown provider data requires runtime admission and exact errors; normalizers intentionally omit undefined fields.
238 src/gateway/server-methods/approval-request-authority.ts READ Retained request-bound authority, source-policy narrowing, committed revocation latch, and commit-time live-owner checks; no safe simplification remains.
238 src/gateway/server-methods/web.ts READ Provider resolution already centralized; start takeover/restoration and wait activation have different lifecycle rules.
238 src/gateway/worker-environments/workspace-reconcile-fs.ts READ No residual lane edit against origin/main. Prior lane read: Applied: reuse exact worker file snapshot projection.
237 src/gateway/server-methods/wizard.ts READ Shared wizard lookup/status/runtime owners already exist; start/next/cancel settlement order is deliberate.
236 src/gateway/server-methods/chat-transcript-inject.ts READ No further sound change: stopped producer appends and ordinary transcript writes have different owner predicates and receipt semantics.
235 src/gateway/worker-environments/artifact-transfer-service.ts READ Separate capability and attempt identities are required for bounded retries and stale-attempt fencing. Incoming main isolates progress callback failure while retaining owner, expiry, abort, and per-chunk checks.
234 src/gateway/worker-environments/computer-service.ts READ Retained prepared/bound/native cleanup ownership and exact worker-socket binding; recent shared-authority refactor already applies.
232 src/gateway/server-methods/audit.ts READ Recent deslop already shares list owner; event variants enforce distinct protocol projections.
231 src/gateway/server-methods/agent-reset-phase.ts READ Retained reset commit/replay custody and admission revalidation; no safe duplicate owner remains.
231 src/gateway/server-methods/cron-runs.ts READ No sound change: all/job history differ for deleted jobs and sharing preparation; both retain final live scope checks.
226 src/gateway/server-methods/system-agent-setup-wizard.ts READ Reused the canonical Gateway runtime; preserved retry reservation, predecessor cancellation, settlement barriers, current authority, and wizard replies.
224 src/gateway/server-methods/chat-history-delta.ts READ No further sound change: incognito local scope, worker reads and reset-only projections preserve cursor and snapshot contracts.
224 src/gateway/server-methods/sessions-groups.ts READ Retain operation-specific errors and success/finally invalidation timing; authorization stays with group owner.
223 src/gateway/server-methods/health.ts READ Remove narration; keep live child-runtime facts fresh across cached and forced reads.
222 src/gateway/server-methods/cron-history.ts READ No sound change: exact run cursor binding and retained transcript source custody protect deleted-session history reads.
222 src/gateway/server-methods/update-admission.ts READ External manager handoff and native install admission retain independent effects/error facts.
221 src/gateway/server-methods/tools-github.ts READ Canonical validator already used; configure, authorization start/poll/cancel retain distinct service and failure semantics.
218 src/gateway/worker-environments/node-worker-workspace-fallback.ts READ Retained optional published-origin optimization and canonical transfer fallback; local Git safety and diagnostic reasons are distinct.
216 src/gateway/server-methods/device-scope-upgrade.ts READ No sound change: request and wait require separate current role ceilings; coordinator owns identity-bound completion.
216 src/gateway/worker-environments/local-workspace-archive.ts READ Retained ignored-file/empty-directory overlay archive and durable restore receipts; retention belongs to existing worktree owner.
215 src/gateway/server-methods/session-catalog-list-operations.ts READ Retain caller-specific coalescing, bounded stale pages, and config/registry retirement.
214 src/gateway/server-methods/nodes.pending-work.ts READ Removed narration; retained narrowing cast because protocol Type.String enum does not infer literal work types; queue fencing unchanged.
214 src/gateway/worker-environments/workspace-reconcile-core.ts READ Keep upstream forwarding-helper removal and our canonical manifest-node projection without redundant undefined filtering.
213 src/gateway/server-methods/chat-send-work-admission.ts READ No lane edit; pinned-main owns receipt-aware new-upload admission and goal/initial-session precommit checks alongside existing retained-work release. Distinct input and lifetime authority must remain separate.
213 src/gateway/server-methods/session-catalog.ts READ No residual lane edit against origin/main. Prior lane read: Removed forwarding authorization wrapper; read/continue/archive call existing authorization module directly.
213 src/gateway/worker-environments/placement-disk-space.ts READ Reuse binding-aware read for previous sample instead of repeating its binding predicate.
211 src/gateway/worker-environments/store-mutations.ts READ Share credential insert/update values while excluding immutable environment identity from updates.
211 src/gateway/worker-environments/store-validation.ts READ Remove parallel terminal-state list in favor of state.ts canonical owner; persisted/provider validation remains unchanged.
210 src/gateway/server-methods/core-handlers.ts READ No lane edit; pinned-main lazy registered-handler identity determines which canonical receipt owners defer upload checks. Overrides retain router admission; method spelling alone grants no exception.
209 src/gateway/server-methods/chat-send-turn-adoption.ts READ Recheck cancellation after the withdrawal hold settles; lifecycle ordering is required and offers no sound further simplification.
208 src/gateway/server-methods/agents-config-mutations.ts READ Removed narration only; pinned-main assertCurrent parameter and assertConfigPathForWrite invocation remain before model-choice validation and config publication.
206 src/gateway/server-methods/chat-metadata-session-projection.ts READ No further sound change: catalog/profile identity cache keys and native runtime metadata overlay are independent projections.
205 src/gateway/worker-environments/provider-machine-catalog.ts READ OS/machine loaders have separate provider methods and cache fields; generic descriptor layer would add policy complexity.
203 src/gateway/worker-environments/workspace-git-base.ts READ No change: retained donor and full snapshot packs have distinct Git object ownership and bounded I/O.
202 src/gateway/worker-environments/tunnel.ts READ No change: replacing epochs retain initialization and accepted workspace task drainage before dispose.
201 src/gateway/server-methods/portals.ts READ Attached environment epoch and post-await connection cleanup are distinct ownership boundaries.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: XL labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 15:32
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

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

  • Current SHA: 52f0ea5720d27324d7bb3bd2ca9986fda2f3bb5f
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server-methods/chat-abort-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/cron-creator-authority-admission.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/device-pair-setup.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/devices.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/models-auth-status-usage-cache.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/models-auth-status.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods/plugins.credentials.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • 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/worker-environments/credential-broker.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 5:30 AM ET / 09:30 UTC (Revision 32).

ClawSweeper review

What this changes

The branch consolidates Gateway request validation, response handling, and worker workspace recovery, and updates focused session-file and Stop tests.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this active PR open. Its Gateway cleanup remains distinct from current main, and the reviewed changes reveal no definite patch defect. The required public restart-recovery result for a non-main session remains unproved.

Priority: P3
Reviewed head: 52f0ea5720d27324d7bb3bd2ca9986fda2f3bb5f

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The consolidation is coherent and focused checks are reported, but a policy-required public recovery composition remains unproved.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer-authored PR is exempt from ClawSweeper's contributor proof gate. Reported Testbox and owner/SQLite recovery evidence, plus a separate authenticated sessions.create test, do not yet demonstrate the combined public non-main session result required by Gateway policy; no stored-data format 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: The maintainer-authored PR is exempt from ClawSweeper's contributor proof gate. Reported Testbox and owner/SQLite recovery evidence, plus a separate authenticated sessions.create test, do not yet demonstrate the combined public non-main session result required by Gateway policy; no stored-data format change was identified.
Evidence reviewed 11 items Introduced recovery consolidation: The PR adds a shared settlement path that publishes an accepted workspace result before settling the staged result and turn claim.
Applicable Gateway proof policy: Restart-delivery custody changes require an isolated Gateway public sessions.create path for an explicit non-main session, followed by a post-publication read or turn.
Separate public and recovery coverage: The PR body, whose live body matches the captured source hash, describes an authenticated sessions.create/initial-turn test and separate SQLite/filesystem restart-recovery tests. The public test shown here does not perform restart recovery.
Findings None None.
Security None None.

How this fits together

The Gateway accepts client requests and coordinates agent sessions with local or remote workers. Its handlers validate requests and publish results, while worker recovery restores workspace edits and settles turn claims after interruption.

flowchart LR
A[Client request] --> B[Gateway validation]
B --> C[Session handler]
C --> D[Worker placement]
D --> E{Turn completes or restarts}
E --> F[Workspace and session result]
Loading

Before merge

  • Resolve merge risk (P1) - The changed restart settlement could publish a recovered non-main workspace result or release its old turn claim without the corresponding public session being usable; existing tests prove public creation and owner-level recovery separately, but not their required composition.
  • Complete next step (P2) - Record a pinned-head public sessions.create recovery flow for an explicit non-main session, showing restored workspace bytes, a post-publication read or turn, and release of the prior turn claim.
  • 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: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove public restart recovery (recommended)
    Capture the pinned-head isolated Gateway flow for an explicit non-main session, including recovered workspace bytes, a post-publication read or turn, and a released prior claim.

Technical review

Best possible solution:

Keep the shared recovery owner and verify an explicit non-main session through public creation, restart recovery, restored workspace bytes, and a post-publication read or turn before landing.

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

Not applicable: this PR is an internal refactor, not a reported current-main bug. Its focused tests guard behavior across the changed paths.

Is this the best way to solve the issue?

Yes, reusing the existing validation and recovery owners is a maintainable direction; the public restart-recovery composition still needs verification.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 session-state: The refactor consolidates restart result publication and turn-claim settlement, whose public non-main session outcome lacks combined proof.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from ClawSweeper's contributor proof gate. Reported Testbox and owner/SQLite recovery evidence, plus a separate authenticated sessions.create test, do not yet demonstrate the combined public non-main session result required by Gateway policy; no stored-data format change was identified.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

  • Capture the pinned-head public sessions.create recovery result for an explicit non-main session, including restored bytes, a subsequent read or turn, and a null prior turn claim.

Rating scale

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

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

Workflow

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

History

Review history (31 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T23:56:41.269Z sha e186185 :: blocked before merge. :: none
  • reviewed 2026-09-29T01:54:22.627Z sha e186185 :: blocked before merge. :: none
  • reviewed 2026-09-29T02:40:43.267Z sha c21191db3c78ceed5659d03b72391a15a2837cfe :: blocked before merge. :: none
  • reviewed 2026-09-29T03:33:17.233Z sha c21191db3c78ceed5659d03b72391a15a2837cfe :: blocked before merge. :: none
  • reviewed 2026-09-29T03:56:20.163Z sha 0a9b4b3598529674b5977b2fd659755d3d4cb50e :: blocked before merge. :: none
  • reviewed 2026-09-29T05:27:50.928Z sha 6686d08721243056f041f9b2c1ff5a17de237208 :: blocked before merge. :: none
  • reviewed 2026-09-29T06:58:21.609Z sha 6aae84e :: blocked before merge. :: none
  • reviewed 2026-09-29T08:59:35.450Z sha 8bea97b :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch 2 times, most recently from 032cc20 to de14f63 Compare September 27, 2026 20:02
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 27, 2026
@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch 3 times, most recently from 7efb930 to de1888d Compare September 28, 2026 03:04
@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch from de1888d to 8e6a445 Compare September 28, 2026 07:52
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch 7 times, most recently from e186185 to c21191d Compare September 29, 2026 02:32
@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch 3 times, most recently from 6686d08 to 6aae84e Compare September 29, 2026 06:45
@steipete
steipete force-pushed the deslop/l122-gateway-methods-workers branch from 6aae84e to 8bea97b Compare September 29, 2026 08:44
@steipete
steipete enabled auto-merge (squash) September 29, 2026 09:22
@steipete
steipete merged commit 4f3a73d into main Sep 29, 2026
427 of 429 checks passed
@steipete
steipete deleted the deslop/l122-gateway-methods-workers branch September 29, 2026 10:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…nclaw#159752)

* refactor(gateway): deslop server methods and worker environments

* refactor(gateway): finish validated RPC bindings and preserve timer ownership

* refactor(gateway): consolidate skill validation within lane scope

* test(gateway): align session file fixtures with canonical ownership

* refactor(gateway): remove redundant workspace projections

* style(gateway): keep subagent audience comment with its owner

* refactor(gateway): share workspace preview read result type
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime 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