Repository navigation
feat(hosts): transparent host pools - #443
Conversation
Squashed from origin/fix/live-reply-streaming (027fedc) onto upstream/main.
… language in the file viewer Squashed from origin/fix/file-viewer-diff-highlight (95253f2) onto upstream/main.
Squashed from origin/fix/live-reply-streaming (80c8a32) onto upstream/main.
Squashed from origin/fix/literal-dollars (3768658) onto upstream/main.
…ansparent-host-pool # Conflicts: # graphify-out/graph.json
|
Important Review skippedToo many files! This PR contains 116 files, which is 16 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
Code Review Roast 🔥Verdict: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The Windows fsync guard in 💀 Worst part: 📊 Overall: Like a test suite written in a language that doesn't exist — the intent is clear, but the syntax needs fixing before any of it can execute. Files Reviewed (7 files)
Previous Review Summaries (2 snapshots, latest commit af6b133)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit af6b133)Verdict: No Issues Found | Recommendation: Merge I loaded the incremental diff expecting at least a stray semicolon or a misplaced brace, then got a 4-file, 23-line refactor that does one thing: hoist a private The one genuinely new line — Oh wait, this part is actually clean. I need to sit down. I had the flamethrower warmed up for a cross-platform path-handling regression and there isn't one. 📊 Overall: Like a furniture mover who carries every piece through the door instead of drywalling the living room — dull to watch, and the house is still standing. Files Reviewed (4 files)
Previous review (commit 7b94481)Verdict: No Issues Found | Recommendation: Merge I showed up with a flamethrower, a magnifying glass, and trust issues, then stared at a 115-file “small refactor” that adds transparent host pools, durable creation, link protocol v8, and a maintenance CLI. This PR didn’t just move furniture — it renovated the whole house while the tenants were still inside. I was ready to roast, but from the diff/state I could inspect, the changed lines behaved themselves annoyingly well. Review context: I analyzed the current PR state ( 📊 Overall: Like a deployment runbook written by someone who’s actually been paged at 3 AM — dense, intimidating, and surprisingly responsible. Files Reviewed (115 files)
Reviewed by free · Input: 109.9K · Output: 19.9K · Cached: 316.5K |
A Windows web server rejected every POSIX worker path because pool validation used the server's own path module.
Windows cannot open a directory for fsync, so the creation journal was always reported unavailable. The synced file and atomic rename remain the commit point there. Session export now routes .cmd/.bat OMP launchers through the same wrapper as RPC sessions and version checks.
Real Git fixtures keep drive letters out of SSH URLs and run a local upload-pack, clone cancellation waits for socket close events instead of marker files, capacity emulation no longer spoofs the platform for child spawns, and upload owner teardown awaits its requests and closes its stores.
| os.availableParallelism = () => 8; | ||
| os.loadavg = () => [load1, 0, 0]; | ||
| syncBuiltinESMExports(); | ||
| const capacityUrl = ${JSON.stringify(new URL("./capacity.ts", import.meta.url).href)}; |
There was a problem hiding this comment.
🔥 The Roast: You wrote ${...} without backticks. JavaScript doesn't know what a template literal is without the template part. This line is a syntax error — the test file cannot be parsed, let alone run.
🩹 The Fix:
| const capacityUrl = ${JSON.stringify(new URL("./capacity.ts", import.meta.url).href)}; | |
| const capacityUrl = new URL("./capacity.ts", import.meta.url).href; |
📏 Severity: critical
There was a problem hiding this comment.
Not a syntax error: these lines are inside a template literal that builds the source of a child process script (the backtick opens earlier in that function), so ${...} interpolates values into the generated code. node --check parses the file at c1dcb65, and the Ubuntu job runs this suite.
| // Accelerate only the five-second cadence, preserving watchdog/redial/child timers. | ||
| const interval = globalThis.setInterval; | ||
| globalThis.setInterval = (fn, ms, ...args) => interval(fn, ms === 5000 ? 25 : ms, ...args); | ||
| const { runHostDaemon } = await import(${JSON.stringify(new URL("./daemon.ts", import.meta.url).href)}); |
There was a problem hiding this comment.
🔥 The Roast: Same missing-backticks problem, this time on a dynamic import. The test file is one big syntax error waiting to happen.
🩹 The Fix:
| const { runHostDaemon } = await import(${JSON.stringify(new URL("./daemon.ts", import.meta.url).href)}); | |
| const { runHostDaemon } = await import(new URL("./daemon.ts", import.meta.url).href); |
📏 Severity: critical
There was a problem hiding this comment.
Not a syntax error: these lines are inside a template literal that builds the source of a child process script (the backtick opens earlier in that function), so ${...} interpolates values into the generated code. node --check parses the file at c1dcb65, and the Ubuntu job runs this suite.
| const interval = globalThis.setInterval; | ||
| globalThis.setInterval = (fn, ms, ...args) => interval(fn, ms === 5000 ? 25 : ms, ...args); | ||
| const { runHostDaemon } = await import(${JSON.stringify(new URL("./daemon.ts", import.meta.url).href)}); | ||
| const { decodeBlobFrame, LINK_PROTOCOL_VERSION, PartJoiner } = await import(${JSON.stringify(new URL("./link-protocol.ts", import.meta.url).href)}); |
There was a problem hiding this comment.
🔥 The Roast: Another ${...} without backticks, another dynamic import that will never execute. At this rate, the test file is more broken than working.
🩹 The Fix:
| const { decodeBlobFrame, LINK_PROTOCOL_VERSION, PartJoiner } = await import(${JSON.stringify(new URL("./link-protocol.ts", import.meta.url).href)}); | |
| const { decodeBlobFrame, LINK_PROTOCOL_VERSION, PartJoiner } = await import(new URL("./link-protocol.ts", import.meta.url).href); |
📏 Severity: critical
There was a problem hiding this comment.
Not a syntax error: these lines are inside a template literal that builds the source of a child process script (the backtick opens earlier in that function), so ${...} interpolates values into the generated code. node --check parses the file at c1dcb65, and the Ubuntu job runs this suite.
| globalThis.setInterval = (fn, ms, ...args) => interval(fn, ms === 5000 ? 25 : ms, ...args); | ||
| const { runHostDaemon } = await import(${JSON.stringify(new URL("./daemon.ts", import.meta.url).href)}); | ||
| const { decodeBlobFrame, LINK_PROTOCOL_VERSION, PartJoiner } = await import(${JSON.stringify(new URL("./link-protocol.ts", import.meta.url).href)}); | ||
| ${waitFor.toString()} |
There was a problem hiding this comment.
🔥 The Roast: A bare ${...} expression standing alone like a lost sock. Without backticks, this is not JavaScript — it's a parse error. Lines 445-448 all share this fate.
🩹 The Fix: Wrap each in backticks to make them valid template literals, or remove them if they're leftover fragments. As written, they're syntax errors that prevent the file from loading.
📏 Severity: critical
There was a problem hiding this comment.
Not a syntax error: these lines are inside a template literal that builds the source of a child process script (the backtick opens earlier in that function), so ${...} interpolates values into the generated code. node --check parses the file at c1dcb65, and the Ubuntu job runs this suite.
Summary
Adds transparent host pools: a configured pool of worker hosts appears in ompweb as one target. New independent sessions are placed on an eligible worker by effective capacity and get an isolated worktree there; after placement, the owning worker stays authoritative for resume, files, terminal, uploads, artifacts, rename and delete.
lib/hosts/capacity.ts,pool-selection.ts,pools.ts,pool-starts.ts).lib/pooled-projects.ts).ompweb host status|drain|resumeover a private Unix socket (lib/hosts/host-control.ts).MIN_LINK_PROTOCOL_VERSIONstays 4, so v7 daemons keep working for non-pool features.@xmldom/xmldomto 0.8.15 (DOCX parser vulnerabilities).The README documents pools and worker maintenance.
Deployment state
This branch (at
d6f2e170, an ancestor of this head) already runs in the maintainer's production:ompweb-apiplus threeompweb-hostdaemons, poolproxmox-aienabled with two protocol-8 workers. This PR's head adds one merge of currentmain(no rewrite).Testing
bun test --parallel --timeout 30000ond6f2e170: 3674 pass, 0 fail.mainon the same machine (5 s timeouts of real-daemon suites). The 11th,lib/hosts/pool-starts.test.mjs, passes with--timeout 30000(15/15).