Skip to content

fix(onboard): bypass proxies for loopback readiness - #6776

Merged
cv merged 1 commit into
NVIDIA:mainfrom
HOYALIM:codex/issue-6763-loopback-http-probe
Jul 13, 2026
Merged

fix(onboard): bypass proxies for loopback readiness#6776
cv merged 1 commit into
NVIDIA:mainfrom
HOYALIM:codex/issue-6763-loopback-http-probe

Conversation

@HOYALIM

@HOYALIM HOYALIM commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Loopback HTTP readiness checks could still be routed through a host proxy despite the existing NO_PROXY augmentation, causing a running Ollama service to be reported unavailable. Loopback URLs now use a bounded native Node probe that does not consult proxy settings, while non-loopback URLs retain the validated curl path.

Related Issue

Fixes #6763

Changes

  • Probe exact loopback hosts (localhost, 127.0.0.1, and ::1) through a short-lived Node HTTP or HTTPS client with a one-second request timeout.
  • Keep non-loopback readiness probes on the existing validated curl path.
  • Add a process-level regression test with a live loopback server and a failing http_proxy, plus routing-contract tests for both probe paths.

Type of Change

  • 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)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this restores the documented loopback proxy-bypass contract without changing commands or output
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: author review confirmed the direct path is restricted to exact loopback hostnames, the URL is passed as argv rather than interpolated into code, and non-loopback requests retain curl validation
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run --project cli src/lib/core/wait.test.ts src/lib/onboard/install-ollama-macos.test.ts src/lib/onboard/ollama-startup.test.ts (33 tests passed)
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — not applicable to this focused readiness probe change; npm run typecheck:cli, Biome, test-conditional scan, and npm run check:diff passed
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds 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: Ho Lim subhoya@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved readiness checks for local HTTP and HTTPS endpoints.
    • Localhost checks now bypass configured HTTP proxies for more reliable results.
    • Non-local endpoints continue using the existing network validation behavior.
    • Added handling for common loopback address formats, including IPv6 localhost.

Signed-off-by: Ho Lim <subhoya@gmail.com>
Copilot AI review requested due to automatic review settings July 13, 2026 16:58
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

waitForHttp now uses a native Node HTTP(S) probe for loopback URLs, avoiding proxy interference. Non-loopback URLs continue using the validated curl argument path, with tests covering both behaviors.

Changes

Loopback HTTP probe

Layer / File(s) Summary
Native loopback probe
src/lib/core/wait.ts
Adds loopback URL detection and a Node-based HTTP(S) readiness probe selected by waitForHttp.
Probe behavior coverage
src/lib/core/wait.test.ts
Tests proxy-independent loopback checks, native probe invocation, and curl usage for non-loopback HTTPS targets.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant waitForHttp
  participant NodeProbe
  participant LoopbackServer
  waitForHttp->>NodeProbe: pass loopback URL and timeout
  NodeProbe->>LoopbackServer: send HTTP(S) GET
  LoopbackServer-->>NodeProbe: return response status
  NodeProbe-->>waitForHttp: report readiness result
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#4215: Updates waitForHttp loopback probing to avoid proxy interference using a different implementation.

Suggested labels: bug-fix, platform: macos, area: networking

Suggested reviewers: copilot, apurvvkumaria, cv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: bypassing proxies for loopback readiness checks.
Linked Issues check ✅ Passed The changes implement loopback proxy bypass for readiness probes while preserving the existing non-loopback curl path, matching #6763.
Out of Scope Changes check ✅ Passed The patch stays focused on the readiness probe behavior and its tests, with no clear unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: gpu-double-onboard
Optional E2E: ollama-auth-proxy

Dispatch hint: gpu-double-onboard

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E

  • gpu-double-onboard: Exercises real install.sh onboarding with the Ollama provider, including host loopback readiness, the persisted auth proxy, sandbox inference.local connectivity, and re-onboarding.

Optional E2E

  • ollama-auth-proxy: Provides an adjacent real-host validation of Ollama and localhost auth-proxy HTTP behavior, although it does not invoke the CLI waitForHttp readiness helper.

New E2E recommendations

  • installer/onboarding (medium): The new direct-probe branch is covered by a unit test but has no non-GPU end-to-end onboarding scenario that sets an unreachable HTTP proxy and verifies local Ollama readiness succeeds through the CLI.
    • Suggested test: Add a credential-free Linux local-Ollama onboarding E2E that sets http_proxy/HTTP_PROXY to an unreachable proxy, starts or installs Ollama on loopback, and verifies onboarding completes and inference.local remains reachable.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: gpu-double-onboard

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/core/wait.ts (1)

293-307: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate hostname-normalization logic vs. curl-args.ts.

isLoopbackHttpUrl's hostname normalization (bracket-strip, trailing-dot-strip, lowercase) duplicates normalizeHostname in src/lib/adapters/http/curl-args.ts (lines 167-171). Since one governs loopback classification and the other governs curl's --resolve/SSRF validation, a future fix to one path (e.g. handling a new normalization edge case) could silently diverge from the other. Consider exporting normalizeHostname and reusing it here.

♻️ Proposed fix to reuse the shared normalizer
+import { normalizeHostname } from "../adapters/http/curl-args";
+
 function isLoopbackHttpUrl(rawUrl: string): boolean {
   try {
     const url = new URL(rawUrl);
-    const hostname = url.hostname
-      .replace(/^\[(.*)\]$/u, "$1")
-      .replace(/\.$/u, "")
-      .toLowerCase();
+    const hostname = normalizeHostname(url.hostname);
     return (
       (url.protocol === "http:" || url.protocol === "https:") &&
       (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1")
     );
   } catch {
     return false;
   }
 }

And in curl-args.ts, export the existing helper:

-function normalizeHostname(hostname: string): string {
+export function normalizeHostname(hostname: string): string {
🤖 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 `@src/lib/core/wait.ts` around lines 293 - 307, Export the existing
normalizeHostname helper from curl-args.ts and update isLoopbackHttpUrl to reuse
it instead of performing its own bracket removal, trailing-dot removal, and
lowercasing. Preserve the current protocol and loopback-host checks while
removing the duplicated normalization logic.
🤖 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.

Nitpick comments:
In `@src/lib/core/wait.ts`:
- Around line 293-307: Export the existing normalizeHostname helper from
curl-args.ts and update isLoopbackHttpUrl to reuse it instead of performing its
own bracket removal, trailing-dot removal, and lowercasing. Preserve the current
protocol and loopback-host checks while removing the duplicated normalization
logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e4d85d4a-0779-4bfa-8c56-92c38e866bb3

📥 Commits

Reviewing files that changed from the base of the PR and between 3de1de6 and 60edbd3.

📒 Files selected for processing (2)
  • src/lib/core/wait.test.ts
  • src/lib/core/wait.ts

@cv
cv enabled auto-merge (squash) July 13, 2026 17:28
@cv
cv merged commit 7666b55 into NVIDIA:main Jul 13, 2026
39 of 41 checks passed
cv pushed a commit that referenced this pull request Jul 14, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Release-prep documentation for v0.0.82 now summarizes user-facing
changes merged since v0.0.81.
It also closes stale wording in the stopped-sandbox backup,
snapshot-clone, Ollama selection, and custom-policy authoring guidance.

## Changes

- Add the `v0.0.82` section to `docs/about/release-notes.mdx` with links
to the focused user guides.
- Document that snapshot clones receive a destination-owned dashboard
port before destructive replacement begins.
- Align `backup-all` guidance with eligible stopped Docker-driver
sandboxes that NemoClaw starts temporarily.
- Describe the running and stopped Ollama menu states without claiming
one fixed label.
- Document runtime rejection of catch-all hosts in custom policy files.

### Source summary

- [#6748](#6748) ->
`docs/about/release-notes.mdx`, `docs/manage-sandboxes/lifecycle.mdx`,
and `docs/reference/commands.mdx`: Summarize non-destructive sandbox
`stop` and `start` commands.
- [#6723](#6723) ->
`docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/reference/commands.mdx`: Record temporary startup and cleanup for
eligible stopped-sandbox backups.
- [#6749](#6749) ->
`docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document destination-owned
dashboard ports for snapshot clones.
- [#6764](#6764) ->
`docs/about/release-notes.mdx`: Summarize installer handling of
route-only onboarding placeholders.
- [#6771](#6771) ->
`docs/about/release-notes.mdx`, `docs/inference/set-up-vllm.mdx`,
`docs/inference/choose-inference-provider.mdx`,
`docs/reference/commands.mdx`, and
`docs/reference/platform-support.mdx`: Summarize managed-vLLM storage
gates, immutable image digests, and the explicit override boundary.
- [#6759](#6759) ->
`docs/about/release-notes.mdx`: Record early, actionable OpenShell
gateway-port conflict diagnostics.
- [#6753](#6753) ->
`docs/about/release-notes.mdx` and `docs/inference/set-up-ollama.mdx`:
Document truthful running and stopped Ollama menu states.
- [#6776](#6776) ->
`docs/about/release-notes.mdx`: Summarize proxy-independent loopback
readiness checks.
- [#6769](#6769) ->
`docs/about/release-notes.mdx`: Record compatible endpoint and agent
guidance when Chat Completions is unavailable.
- [#6730](#6730) ->
`docs/about/release-notes.mdx`: Summarize bounded reuse of an eligible
successful Chat Completions check.
- [#6768](#6768) ->
`docs/about/release-notes.mdx`: Record route-reservation repair during
resumed onboarding.
- [#6742](#6742) ->
`docs/about/release-notes.mdx`: Summarize pre-mutation resolution of
secret-free sandbox create intent.
- [#6721](#6721) ->
`docs/about/release-notes.mdx` and
`docs/get-started/quickstart-langchain-deepagents-code.mdx`: Record
bounded cleanup of completed managed Deep Agents headless sessions.
- [#6731](#6731) ->
`docs/about/release-notes.mdx` and
`docs/network-policy/customize-network-policy.mdx`: Document runtime
rejection of catch-all custom-policy destinations.
- [#6729](#6729) ->
`docs/about/release-notes.mdx` and `docs/get-started/prerequisites.mdx`:
Record the Node.js 22.19 minimum.
- [#6735](#6735) ->
`docs/about/release-notes.mdx` and
`docs/reference/platform-support.mdx`: Summarize the Ubuntu 26.04
userspace contract without claiming pending host or live validation.
- [#6775](#6775) ->
`docs/about/release-notes.mdx` and
`docs/resources/community-contributions.mdx`: Route independent
solutions outside canonical supported-product documentation.
- [#6740](#6740) ->
`docs/about/release-notes.mdx`: Summarize the semantic
dependency-upgrade contributor workflow.
- [#6777](#6777) ->
`docs/about/release-notes.mdx` and `docs/CONTRIBUTING.md`: Summarize the
route-safe documentation-refactor workflow.
- [#6741](#6741) ->
`docs/about/release-notes.mdx` and
`docs/security/openclaw-2026.6.10-dependency-review.md`: Summarize
reviewed npm archive verification and audit enforcement.
- [#6739](#6739) ->
`docs/about/release-notes.mdx` and
`docs/security/openclaw-2026.6.10-dependency-review.md`: Record the
locked offline dependency graph for the managed OpenClaw WeChat runtime.
- [#6737](#6737) ->
`docs/about/release-notes.mdx`: Record removal of the messaging build
plan from final OpenClaw and Hermes image environments.
- [#6733](#6733) ->
`docs/about/release-notes.mdx`: Summarize cached plugin dependency
layers for source and blueprint rebuilds.

### Skipped from docs-skip

- None. No commit or changed path in `v0.0.81..origin/main` matched
`openclaw-sandbox-permissive.yaml` or `config-show`, and the drafted
content contains none of the configured skip terms.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This is a documentation-only
release-prep update; behavior is protected by the merged source PRs, and
the documentation build validates the changed routes and agent variants.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — tests are not applicable for this
documentation-only change.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not run for this
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — 0
errors; two pre-existing Fern warnings remain.
- [x] 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)
— no new pages.

---
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated release notes with improvements to sandbox recovery,
onboarding, session management, policy validation, storage checks, and
system requirements.
  * Clarified Ollama setup instructions and status labels.
* Documented safer snapshot restoration, including dedicated ports and
protection against destructive failures.
* Expanded `backup-all` coverage to include eligible stopped sandboxes.
* Added guidance rejecting broad or catch-all network destinations in
custom policies.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS][Onboard] Ollama onboard readiness probe fails when host http_proxy is set — false "Ollama did not become ready", onboard blocked

4 participants