fix(onboard): guard reserved Hermes port 8642 for all agents#5264
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds HERMES_OPENAI_API_PORT constant, new preflight-ports helpers and tests, integrates a fail-fast reserved-dashboard-port assertion into onboarding’s required-ports phase, reorders hermes-dashboard validation to run before non-Hermes early-return, and updates tests to assert the shared security message for port 8642. ChangesPort 8642 Security Validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
fcc4601 to
47d7733
Compare
cb56351 to
d35b6c0
Compare
Signed-off-by: Rui Luo <ruluo@nvidia.com>
d35b6c0 to
356714c
Compare
Summary
Extends the #4984 reserved-port guard (PR #5015) to all agents, and adds a fail-fast preflight check. The shipped guard was hermes-gated, so a plain
nemoclaw onboard(default OpenClaw agent) still acceptedNEMOCLAW_DASHBOARD_PORT=8642— and, being a single-port agent, actually bound host port 8642. That silently breaks a laternemoclaw onboard --agent hermes, whose OpenAI-compatible API must forward 8642 (it warns "cannot be reallocated" but still exits 0, leaving the API unreachable).Related Issue
Fixes #4984
Changes
core/ports.ts: addHERMES_OPENAI_API_PORT(8642) and a shared, agent-neutral rejection messageRESERVED_HERMES_DASHBOARD_PORT_MESSAGEas the single source of truth for both guards.onboard/preflight-ports.ts:buildRequiredPreflightPorts()(extracted from the inline onboard.ts array) andassertDashboardPortNotReserved().onboard.tspreflight ([1/8]) now rejects an explicit reserved dashboard port fast — before gateway/inference — instead of printing "✓ available" and then hard-failing later. Net change toonboard.tsis negative (no growth).resolveHermesDashboardOnboardState([6/8]) rejection made agent-agnostic(catches deferred
CHAT_UI_URL/ persisted-port paths the preflight can't see).Hermes OpenAI-compatible API") since the dashboard belongs to whichever agent is onboarding; the reason still names Hermes.
onboard/preflight-portstests + flipped the non-Hermes guard test.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: rluo8 ruluo@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests