Repository navigation
refactor(gateway): deslop gateway core files third pass - #162010
Conversation
Reuse the lazy runtime binder, remove single-use health and catalog wrappers, and consolidate equivalent Gateway validation and projection paths. Preserve protocol, authority, lifecycle, and persistence contracts.
Carry the validated reservation expiry through shared timeout handling, declare the once-initialized stream watcher as const, and shrink the Talk assertion baseline for the removed cast.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed September 30, 2026, 1:25 PM ET / 17:25 UTC. ClawSweeper reviewWhat this changesThe branch simplifies Gateway cron forwarding, connection and worker guards, account health, managed media, model loading, and Talk option handling. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this fresh maintainer PR remains distinct from current main, and the reviewed changes have no supported blocking defect. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway accepts client and worker connections, then coordinates scheduled jobs, media, and session services. Those services return replies, events, and health information to clients. flowchart LR
Clients[Clients and nodes] --> Admission[Connection admission]
Admission --> Services[Gateway services]
Services --> Cron[Cron scheduling]
Services --> Media[Media and node events]
Cron --> Results[Replies and events]
Media --> Results
Before merge
Agent review detailsSecurityNone. PR surfaceSource -180, Other 0. Total -180 across 12 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the leaner Gateway implementation with node pairing, worker cancellation, and cron handoff contracts unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports no user-facing defect to reproduce; the review compared the introduced paths with their existing dispatch and admission contracts. Is this the best way to solve the issue? Yes: the patch reuses an existing lazy-runtime binder and removes redundant wrappers without establishing a competing owner or stored-data contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e1b459ec5d04. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Coordinator admin-land on exact head c02a8f6 under the campaign's pre-existing-failure exception. CI run 36750778079's only failing test is |
) * refactor(gateway): deslop gateway core files third pass Reuse the lazy runtime binder, remove single-use health and catalog wrappers, and consolidate equivalent Gateway validation and projection paths. Preserve protocol, authority, lifecycle, and persistence contracts. * refactor(gateway): preserve narrowed admission and watcher bindings Carry the validated reservation expiry through shared timeout handling, declare the once-initialized stream watcher as const, and shrink the Talk assertion baseline for the removed cast.
What Problem This Solves
Gateway runtime code still repeats forwarding, validation, and projection work after the earlier cleanup passes.
User Impact
No user-visible behavior change. Gateway protocol, RPC inputs/results/errors, authorization, live authority checks, lifecycle fencing, and persisted state remain unchanged.
Why This Change Was Made
The reviewed diff removes 180 net production lines across 11 files (168 in the final merge after main's concurrent helper extraction):
The earlier Gateway passes and September 20 onward file history were inspected before choosing these remaining reductions. Coverage records all 373 production files over 200 lines and a separate 494-file small-module pass. Existing tests are retained; this adds no per-PR test cases. The assertion-safety baseline shrinks by one after removing the redundant Talk cast.
Evidence
Independent review completed, with the final correction re-reviewed clean. The branch was rebased before validation; the final committed source tree matches the verified Testbox snapshot.
Blacksmith Testbox proof:
pnpm protocol:checkpassed with zero generated-protocol drift;pnpm plugin-sdk:check-exportspassed.pnpm build, including built Plugin SDK export/consumer checks, passed after the admission type fix. The subsequent const-only lint correction was separately rechecked with types, lint, cycles, and affected tests.The initial build caught lost TypeScript narrowing in the cleanup; it was fixed before publication. Removing the Talk cast also required an exact shrink-only assertion-baseline update.
Lease runs: main validation, final targeted validation. Results above come from the remote command exit statuses; these links identify the supporting Testbox leases. Hosted CI on the published head remains the merge gate.
Hosted CI completed with one inherited failure:
checks-node-changed-compact-large-5failssrc/cli/update-cli.windows-lifecycle.test.ts/restores Windows Scheduled Task autostart on SIGINT during package suspensionwithExitError: exit 1atone-shot-exit.ts:155viaupdate-command-triage.ts:177. The same test and stack fail on hourly main atad8327f586926caf7a6a3e8c2e361ef162c98f84: main job 110013033066. Existing fix #161990 owns the updater defect. The failing update/Windows-task recovery route does not execute any production file changed here; Gateway dispatch and service operations are mocked. All other CI test/check jobs on this PR head passed; the aggregate gate reflects the inherited failure. PR merged as3044ac325126636ee0fb7a44fa6f1bfa52028674.Post-merge integration check: fresh-main typechecking later caught an orphaned
reconcileCronExitWatchersimport after this cleanup merged with #161007, which had moved the local adapter into the watcher module. The published head here did not contain that import. Canonical main repair d5e602f0bcf8 removes the orphaned import and now-unused adapter. The follow-up cleanup was rebased onto that repair.