Repository navigation
feat(gateway): dispatch worker-local native inference safely - #163646
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 1:29 AM ET / 05:29 UTC (Revision 19). ClawSweeper reviewWhat this changesAdds Gateway dispatch to paired workers that run inference with node-owned model configuration and credentials, and exposes that placement in session metadata. Merge readiness✅ Ready for maintainer review This integration remains necessary: current main contains the native runtime but lacks the dispatch and node-configuration handoff. The inspected patch preserves the prior repairs and introduces no concrete blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway authorizes session turns and dispatches them to paired worker hosts. The node supervisor supplies local model configuration to an admitted worker, which calls the provider and returns events and transcript updates to the Gateway. flowchart TD
A[Session turn and worker profile] --> B[Gateway authorization and placement]
B --> C{Inference location}
C --> D[Gateway provider proxy]
C --> E[Paired node supervisor]
F[Node model configuration] --> E
E --> G[Native worker provider request]
D --> H[Session events and transcript]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1230, Tests +2672, Docs +342, Other +5. Total +4249 across 72 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use recorded paired-device placement and canonical node model configuration while preserving Gateway inference defaults and live run fencing. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request; source inspection establishes the missing main integration, and the contributor reports a passing production-path lifecycle scenario. Is this the best way to solve the issue? Yes. The patch extends existing placement, supervisor, model-configuration, and transcript owners without introducing a competing runtime service or credential store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d8612ec864bb. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (18 earlier review cycles; latest 8 shown)
|
|
@clawsweeper review Exact head: |
|
🦞👀 Re-review progress:
|
23534d1 to
342c075
Compare
005a16e to
99cafd3
Compare
342c075 to
fe04f32
Compare
99cafd3 to
e12694c
Compare
2280543 to
312d263
Compare
e12694c to
392f89a
Compare
392f89a to
9d13e40
Compare
087c428 to
e3c787e
Compare
321017d to
64ebab0
Compare
|
@clawsweeper re-review Exact head rebased onto the merged source-map-js CI repair: |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review CI fixture repair at exact head 7d5a081; real compatibility E2E passes locally. |
|
🦞👀 Re-review progress:
|
e6bcccf to
600e387
Compare
What Problem This Solves
Connects the Gateway and node-host owners to the worker native-inference runtime from #163645.
Stack
Depends on #158902 and #163645. Followed by #163647 and #158903.
Review Repairs
headers: {}map was rejected.mainwithout restoring superseded runtime or session abstractions.mainthat made the PR changed-owner manifest fail before its test matrix could start.agent.waiterror text.Evidence
pnpm check:changed(all affected gates green; final dead-export repair rerun below)pnpm tsgo:corenode --import tsx scripts/check-deadcode-exports.mtspnpm check:max-lines-ratchetpnpm check:line-cap-ratchet --base origin/mainpnpm test src/gateway/worker-environments/inference-model.test.ts src/gateway/server-methods/chat-metadata-runtime.native-session.test.ts src/gateway/worker-environments/worker-turn-execution.test.ts --maxWorkers=1pnpm test src/node-host/node-worker-native-inference.test.ts --maxWorkers=1pnpm test test/e2e/qa-lab/runtime/native-worker-slot.e2e.test.ts --maxWorkers=1— 1 passed; 46.7-second test body, 91.5-second Vitest shardpnpm test src/gateway/worker-environments/worker-inference-dispatch.test.ts --maxWorkers=1pnpm test src/infra/ci-node-plan.test.ts --maxWorkers=1— 114 passed; heavy native-worker integration remains release-onlypnpm test test/scripts/ci-node-test-plan.test.ts --maxWorkers=1— 114 passed in 111 secondspnpm docs:check-links— 14,914 links checked, 0 brokenpnpm docs:check-config-examples— 1,312 examples validatedpnpm docs:check-i18n-glossaryNew focused regressions run in roughly 1 second or less. The existing dispatch suite takes about 51–60 seconds because it exercises isolated SQLite fixtures; the CI-plan suite took 112 seconds. A cold local production build made the one-slot command take 937 seconds overall; the test itself took 46.7 seconds.