Fix Apple resident network recovery service label - #47
Conversation
Signed-off-by: Joseph Yaksich <gitcommit90@users.noreply.github.com>
📝 WalkthroughWalkthroughThe Apple guest-network repair now targets the namespaced vmnet launch service. A backend-source assertion verifies the corrected service label. ChangesApple vmnet repair
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/channel-computers.mjs`:
- Line 157: Update the regression assertion in the network recovery test to
verify that the Apple vmnet service label is passed specifically to the
launchctl kickstart invocation with the "-k" argument, rather than merely
appearing somewhere in backend. Keep the assertion focused on the generated
command and optionally ensure the old label is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0ef3eeb0-80ba-41d6-884f-72f9a15443a5
📒 Files selected for processing (2)
src/server/channel-computers.tstest/channel-computers.mjs
| assert.ok(calls.some((call) => call.includes("-w") && call.includes("/workspace") && call.some((word) => word.includes("/bin/bash")) && call.some((word) => word.includes("-lc"))), "resident commands execute in the correct VM workspace"); | ||
| assert.equal(db.q1("SELECT disk_bytes FROM channel_computers WHERE channel_id=?", beta.channelId).disk_bytes, computers.MANAGED_CHANNEL_DISK_BYTES, "reported storage is the managed writable allocation, not Apple's host-backed virtual capacity"); | ||
| const backend = await readFile(join(root, "src", "server", "channel-computers.ts"), "utf8"); | ||
| assert.match(backend, /com\.apple\.container\.network\.container-network-vmnet\.default/, "network recovery restarts Apple's installed vmnet launch service"); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Bind the regression assertion to the launchctl invocation.
The current assertion passes if the service label appears anywhere in backend. It does not prove that launchctl kickstart uses this label. Match the label together with the ["kickstart", "-k", label] arguments, or also assert that the old label is absent.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/channel-computers.mjs` at line 157, Update the regression assertion in
the network recovery test to verify that the Apple vmnet service label is passed
specifically to the launchctl kickstart invocation with the "-k" argument,
rather than merely appearing somewhere in backend. Keep the assertion focused on
the generated command and optionally ensure the old label is absent.
The 0.0.32 Mac release gate exposed that automatic resident-network recovery targeted a nonexistent launchd label. This uses the installed Apple container vmnet label and adds a regression assertion.
Verified:
node --test test/channel-computers.mjsnpm run typecheckgit diff --checkSummary by CodeRabbit