refactor(onboard): extract dashboard port create resolver - #5128
Conversation
|
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 (3)
📝 WalkthroughWalkthroughThis PR refactors dashboard port and chat UI URL selection logic from inline code in ChangesDashboard Port Resolution Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
Selective E2E Results — ✅ All requested jobs passedRun: 27267579798
|
|
✨ Related open issues: |
Selective E2E Results — ✅ All requested jobs passedRun: 27332001138
|
## Summary Centralizes the reused-sandbox dashboard update path so interactive and non-interactive sandbox reuse share the same forward, CHAT_UI_URL, Hermes dashboard, and registry metadata handling. This draft PR is stacked on #5128 and keeps behavior unchanged while removing duplicated createSandbox logic. ## Related Issue Refs #3802 ## Changes - Added applyReusedSandboxDashboardState to `src/lib/onboard/sandbox-reuse.ts` for reused dashboard forward and metadata updates. - Replaced the duplicated non-interactive and interactive reuse branches in `createSandbox` with the shared helper. - Added focused coverage for CHAT_UI_URL updates, Hermes dashboard forwarding, reused metadata updates, and gateway registry fields. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification Targeted checks run: - npx @biomejs/biome lint src/lib/onboard.ts src/lib/onboard/sandbox-reuse.ts src/lib/onboard/sandbox-reuse.test.ts - npm run typecheck:cli - npm run build:cli - git diff --check - npx vitest run src/lib/onboard/sandbox-reuse.test.ts src/lib/onboard/sandbox-registry-metadata.test.ts test/onboard.test.ts test/shellquote-sandbox.test.ts GitHub validation: - PR check suite: passing after commit `2d9d81a84` - PR Review Advisor: passing, 0 needs attention / 0 worth checking / 0 nice ideas - CodeRabbit: skipped while draft - Required live E2E: `double-onboard-e2e` and `token-rotation-e2e` passed in https://github.com/NVIDIA/NemoClaw/actions/runs/27269640744 - Required scenario E2E: `ubuntu-repo-cloud-openclaw` passed in https://github.com/NVIDIA/NemoClaw/actions/runs/27269640556 - [ ] `npx prek run --all-files` passes - [ ] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Improved sandbox creation dashboard port allocation logic for more reliable port resolution and URL handling. * Enhanced sandbox reuse flow to better manage dashboard state and port forwarding across reused sandbox instances. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Extracts createSandbox dashboard port and CHAT_UI_URL resolution into the dashboard-port helper so the precedence chain can be reviewed and tested outside the full onboarding flow. This draft PR is stacked on #5125 and keeps Hermes dashboard forwarding orchestration in onboard.ts for a later slice.
Related Issue
Refs #3802
Changes
Type of Change
Verification
Targeted checks run:
Required live validation:
ubuntu-repo-cloud-openclaw passed: https://github.com/NVIDIA/NemoClaw/actions/runs/27267579584
concurrent-gateway-ports-e2e passed: https://github.com/NVIDIA/NemoClaw/actions/runs/27267579798
double-onboard-e2e passed: https://github.com/NVIDIA/NemoClaw/actions/runs/27267579798
npx prek run --all-filespassesnpm testpassesTests added or updated for new or changed behavior
No secrets, API keys, or credentials committed
Docs updated for user-facing behavior changes
npm run docsbuilds without warnings (doc changes only)Doc pages follow the style guide (doc changes only)
New doc pages include SPDX header and frontmatter (new pages only)
Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Refactor
Tests