Repository navigation
perf(node-host): start worker launch helpers faster on session hosts - #160163
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: blocked before merge. Reviewed September 28, 2026, 6:06 AM ET / 10:06 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR builds the node host’s service relay and process-group anchor as separate launch artifacts, adjusts build and test coverage, and documents the restart needed to receive the improvement. Merge readiness⛔ Blocked before merge - 2 items remain Current main has not absorbed this startup optimization. The patch has no discrete correctness finding, but the installed node-host upgrade and older-worker compatibility case remains unproven. Priority: P2 Review scores
Verification
How this fits togetherA Gateway session turn can run on a paired node host. The host starts launch helpers before the worker; their packaged code affects startup time and must remain usable when the host updates. flowchart LR
A[Gateway session turn] --> B[Paired node host]
C[Packaged launch artifacts] --> B
B --> D[Service relay]
D --> E[Process-group anchor]
E --> F[Worker turn]
F --> G[Result and cleanup]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +12, Docs +6, Other -1. Total +17 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing standalone build owner and verify that a published node-host installation can update, restart, and complete a hosted turn with an older worker bundle. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: reported Linux hosted-turn timings provide a concrete performance check, but this read-only review did not run it. Is this the best way to solve the issue? Yes: the existing standalone build owner is a narrow place to reduce helper startup work. Installed-upgrade compatibility still needs direct proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3903ccc77726. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
393cc00 to
39c13d2
Compare
|
Merged via squash.
|
What Problem This Solves
Sessions placed on a paired node pay avoidable helper startup latency before every worker turn.
User Impact
Warm POSIX worker launch improved by about 57 ms (17%) in the original live comparison. Update and restart the node host to receive the improvement. Full parity with Gateway-local turns remains unfinished.
Why This Change Was Made
The service relay starts a group anchor, which prepares lineage completion before spawning the worker. Building both helpers in the shared runtime graph pulled unrelated chunks into that critical path. Registering them with the existing standalone build owner avoids that work without duplicating runtime logic.
Stable artifact paths, durable startup gating, capacity admission, custody, cancellation, process-tree retirement, crash recovery, and container enforcement are unchanged. There is no protocol/schema change or new capability negotiation; the released legacy-worker startup contract remains supported.
The cleanup removes the eager
runtimeProcessCoreBuildEntriesexport. Full-repository search found only its memory-test consumer, which now invokes the existing builder directly. Production LOC against the rebased merge base: +2 / −3, net −1. No coverage was removed.Evidence
Refreshed onto main
8167e77d11148eb582ed7863e6e3f4c89b94023d, which contains the container-timeout diagnostics, heartbeat fixture, and compiler-guard fixes. The branch is one commit,39c13d260e981dcbdfb0b73e8547b27ff6d2bb5a. The rebase had no conflicts, and the combined old/new diffs have identical stable patch IDs (7f3ebdba922943e707a9bc8be38fd7b3b26f5fdc).Fresh validation on the assigned Linux AWS Crabbox lease after syncing the new base and running
CI=1 pnpm install --frozen-lockfile:pnpm tsgo:core: passed, 14.07 s wall.git diff --check: passed. Production LOC remains +2 / −3, net −1 against the merge base. The requested original-base calculation reports +141788 / −175358, net −33570; it includes unrelated main history and is not this PR's savings.Focused tests, build, and live timing evidence below are retained from pre-refresh candidate
393cc005e2cd17658badc2b57003f1581d26a3d6. They were not rerun for this patch-identical, conflict-free rebase, per the refresh work order:test/scripts/tsdown-runtime-config.test.ts,test/scripts/tsdown-config.test.ts,test/scripts/tsdown-build.test.ts, andtest/scripts/tsdown-declaration-resolution.test.tsvianode scripts/run-vitest.mjs ... --maxWorkers=1: 262 passed, 4 existing skips; 80.21 s wall. The modified runtime-config file took 0.288 s test time. Standalone cost viapnpm test test/scripts/tsdown-runtime-config.test.ts --maxWorkers=1: 32 passed, 0.238 s test time / 26.02 s wrapper wall (mostly source transformation).service-child-group-anchor.preparation,service-child-relay-host.owned-worker, anddoctor-session-sqlite.memorytest files: 19 passed; 135.07 s wall. Startup cancellation, durable worker gating, cleanup, and the existing 256 MiB import budget remain covered.pnpm tsgo:core,pnpm tsgo:scripts, andpnpm tsgo:test:root: passed. Targetedoxfmt --check: passed.qaRuntimebuild: 41.2 s, then real-providermeasure.sh npl11 3succeeded. Instrumentation remains lease-only.Retained warm-turn measurements (turns 2 / 3, milliseconds):
The measurement baseline uses
204b00bf083eand the measured candidate uses merge-base56376753f832, so it verifies the retained improvement without isolating every intervening main change. Provider variability prevents attributing end-to-end movement solely to this patch. Live proof covers Linux; no new macOS, Windows, Bun, or live-container proof is claimed. Child module loading and workspace reconciliation remain unchanged; this does not add warm processes, defer durability, or cache authority.Earlier CI found a PR-caused schema-plugin expectation omission, now included in the single commit: both standalone executable graphs retain schema inlining, with negative coverage for other graphs. Later run 36389229458 passed preflight but failed on two inherited planner assertions in
test/scripts/ci-changed-node-test-plan.integration.test.ts: duplicate hourly ownership of the device-pair doctor test and mismatched UI runner size. Both reproduced on pinned main5c467fb8f27c52846ca42f6ec398d610c84c1f9c(34 passed, the same 2 failed; 148.26 s wall). That historical failure cancelled downstream coverage; those cancelled checks were not passes.Final refreshed-head CI: run 36403190142 tested
39c13d260e981dcbdfb0b73e8547b27ff6d2bb5aand completed successfully: 84 successful jobs, 23 skipped, zero failures. Preflight, all selected test shards, artifact checks, lint, and boundary checks passed. No reruns, manual workflow dispatches, CI-limit changes, or retry-only pushes were used. The PR remains open and unmerged.Both the
openclaw/ci-gatecheck run and commit status are successful on the final head. The status publication's Security Review run 36404810158 is linked for provenance. No failing or pending PR checks remained at verification.