Skip to content

fix(sandbox): clear gateway marker when the start supervisor exits#5569

Merged
cv merged 15 commits into
NVIDIA:mainfrom
zhiyanliu:fix/healthcheck-stale-pidfile-marker-cleanup
Jul 10, 2026
Merged

fix(sandbox): clear gateway marker when the start supervisor exits#5569
cv merged 15 commits into
NVIDIA:mainfrom
zhiyanliu:fix/healthcheck-stale-pidfile-marker-cleanup

Conversation

@zhiyanliu

@zhiyanliu zhiyanliu commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #5568.

On OpenShell docker-driver sandboxes, scripts/nemoclaw-start.sh is not PID 1 — OpenShell's sleep infinity keeps the container alive as a sibling. The Docker HEALTHCHECK's pidfile fallback (#4952) trusts /tmp/nemoclaw-gateway.pid, which is refreshed only by record_gateway_pid inside this script's launch and respawn paths. When the supervise loop exits, the container lives on but nothing refreshes the pidfile. The in-container gateway marker stays in place, so the healthcheck keeps trusting a now-stale PID forever and reports a working sandbox as permanently unhealthy.

Change

  • Add clear_in_container_gateway_marker, symmetric to mark_in_container_gateway.
  • Arm it via trap ... EXIT right after the existing SIGTERM/SIGINT trap, in both the non-root and root supervise paths.

The EXIT trap covers every way the supervisor leaves: a clean gateway exit, a forwarded signal (cleanup_on_signal ends in exit), and errexit. This keeps the fix inside nemoclaw-start.sh and out of the shared cleanup_on_signal in sandbox-init.sh, which agents/hermes/start.sh also sources. The marker is re-dropped at each (re)launch by mark_in_container_gateway, so the respawn loop — which never exits the script — keeps it in place; only a supervisor exit clears it.

The marker semantics become: "a supervisor is actively managing the gateway and keeping the pidfile fresh." Once the marker is gone, the healthcheck takes the marker-absent → healthy branch (#4503) instead of trusting a stale PID.

Tests

Extends test/nemoclaw-start-gateway-marker.test.ts, reusing its existing extractShellFunctionFromSource / safeTmpHelpers harness so each case runs the real shell functions in isolation against a temp marker path:

  • clear_in_container_gateway_marker removes the marker and is a no-op when it is absent.
  • The marker is dropped when the supervisor reaches a clean exit (real trap ... EXIT wiring, not a direct helper call).
  • The marker is dropped when the supervisor is terminated by a signal, exercising the cleanup_on_signalexit → EXIT-trap path.
  • The marker survives respawns while the supervisor keeps running, and is cleared only once the script finally exits.

shfmt, shellcheck, Biome, and typecheck:cli pass; the new and existing marker tests pass (14/14). Happy to revisit the choice of an EXIT trap over explicit cleanup at each exit site if maintainers prefer a different shape.

Summary by CodeRabbit

  • Bug Fixes
    • Improved gateway supervisor shutdown to reliably remove the in-container gateway marker on normal exit, SIGTERM/SIGINT termination, early launch failures, and errexit/EXIT flows (including non-PID 1 scenarios).
    • Reduces risk of stale marker files misleading container health checks.
  • Tests
    • Added shell-based behavioral coverage for marker cleanup on both launch paths, SIGTERM teardown, and marker persistence across respawn iterations until final exit.
  • Documentation
    • Clarified the marker lifecycle in the deployment/architecture reference.

Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

@copy-pr-bot

copy-pr-bot Bot commented Jun 21, 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.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds best-effort removal of /tmp/nemoclaw-gateway-local when either gateway supervisor exits. Both root and non-root paths register an EXIT trap, with tests covering clean exits, signal teardown, respawn behavior, and helper idempotence. Architecture documentation describes the marker lifecycle.

Changes

Gateway marker cleanup on supervisor exit

Layer / File(s) Summary
Marker cleanup and supervisor trap wiring
scripts/nemoclaw-start.sh, docs/reference/architecture.mdx
Adds clear_in_container_gateway_marker(), registers it on EXIT in both supervisor paths, and documents marker removal during shutdown and startup failures.
Marker cleanup behavior tests
test/nemoclaw-start-gateway-marker.test.ts
Validates trap registration, idempotent deletion, clean-exit and SIGTERM cleanup, and marker persistence until final supervisor exit.

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

Sequence Diagram(s)

sequenceDiagram
  participant GatewaySupervisor
  participant ExitTrap
  participant GatewayMarker
  participant DockerHealthcheck

  GatewaySupervisor->>ExitTrap: register cleanup handler
  GatewaySupervisor->>GatewayMarker: maintain marker while active
  GatewaySupervisor->>ExitTrap: exit or receive SIGTERM
  ExitTrap->>GatewayMarker: remove marker
  DockerHealthcheck->>GatewayMarker: check marker state
Loading

Possibly related PRs

Suggested labels: v0.0.66

Suggested reviewers: ericksoa

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The script, tests, and docs match the #5568 requirements for EXIT-trap cleanup, preserved respawns, and stale-marker prevention.
Out of Scope Changes check ✅ Passed The docs update is directly tied to the marker lifecycle change, and no unrelated code changes are evident.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: clearing the gateway marker when the start supervisor exits.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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 (2)
test/nemoclaw-start-gateway-marker.test.ts (1)

337-337: ⚡ Quick win

Assert the production trap wiring, not only the manual trap behavior.

These tests manually arm trap clear_in_container_gateway_marker EXIT, so they would still pass if either supervisor path in scripts/nemoclaw-start.sh stopped registering the production EXIT trap. Add a small source assertion for both trap registrations, or extract the actual supervisor snippets before running the behavioral checks.

Suggested guard
   it("drops the marker when the supervisor reaches a clean exit (`#4952`)", () => {
     const src = fs.readFileSync(START_SCRIPT, "utf-8");
+    const exitTrapMatches =
+      src.match(/^\s*trap clear_in_container_gateway_marker EXIT$/gm) ?? [];
+    expect(exitTrapMatches).toHaveLength(2);
     const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-gw-exit-"));

Also applies to: 384-384, 431-431

🤖 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/nemoclaw-start-gateway-marker.test.ts` at line 337, The test manually
sets up the trap with the line containing "trap
clear_in_container_gateway_marker EXIT" but does not verify that the production
script scripts/nemoclaw-start.sh actually registers this trap in its supervisor
paths. This means the test would pass even if the production code stopped
registering the trap. Add source assertions to verify the actual trap
registrations exist in the supervisor sections of the production script before
running the behavioral checks, rather than relying solely on the manual trap
setup in the test. Apply this assertion fix to all affected test lines (337,
384, and 431).
scripts/nemoclaw-start.sh (1)

3846-3853: Run the sandbox lifecycle E2E set before merging.

This entrypoint change affects supervisor lifecycle and sandbox boot paths that unit tests do not fully exercise. Please trigger the selective nightly-e2e.yaml jobs listed in the repo guidance for this file. As per coding guidelines, scripts/nemoclaw-start.sh changes affect every sandbox boot and are invisible to unit tests; recommended jobs are sandbox-survival-e2e, sandbox-operations-e2e, cloud-e2e, and openclaw-slack-pairing-e2e.

Also applies to: 4104-4111

🤖 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 `@scripts/nemoclaw-start.sh` around lines 3846 - 3853, Before merging this
change to the trap statement in nemoclaw-start.sh that adds
clear_in_container_gateway_marker on EXIT, run the sandbox lifecycle E2E tests
to validate the changes affect supervisor lifecycle and sandbox boot paths
correctly. Trigger the selective nightly-e2e.yaml jobs: sandbox-survival-e2e,
sandbox-operations-e2e, cloud-e2e, and openclaw-slack-pairing-e2e. These tests
are necessary because the entrypoint changes are invisible to unit tests and
affect every sandbox boot, so E2E validation is required before merging.

Source: Coding guidelines

🤖 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 `@scripts/nemoclaw-start.sh`:
- Around line 3846-3853: Before merging this change to the trap statement in
nemoclaw-start.sh that adds clear_in_container_gateway_marker on EXIT, run the
sandbox lifecycle E2E tests to validate the changes affect supervisor lifecycle
and sandbox boot paths correctly. Trigger the selective nightly-e2e.yaml jobs:
sandbox-survival-e2e, sandbox-operations-e2e, cloud-e2e, and
openclaw-slack-pairing-e2e. These tests are necessary because the entrypoint
changes are invisible to unit tests and affect every sandbox boot, so E2E
validation is required before merging.

In `@test/nemoclaw-start-gateway-marker.test.ts`:
- Line 337: The test manually sets up the trap with the line containing "trap
clear_in_container_gateway_marker EXIT" but does not verify that the production
script scripts/nemoclaw-start.sh actually registers this trap in its supervisor
paths. This means the test would pass even if the production code stopped
registering the trap. Add source assertions to verify the actual trap
registrations exist in the supervisor sections of the production script before
running the behavioral checks, rather than relying solely on the manual trap
setup in the test. Apply this assertion fix to all affected test lines (337,
384, and 431).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 70530c73-3f7b-48c1-b4e9-728cec39f0d7

📥 Commits

Reviewing files that changed from the base of the PR and between b025230 and 16f1421.

📒 Files selected for processing (2)
  • scripts/nemoclaw-start.sh
  • test/nemoclaw-start-gateway-marker.test.ts

@zhiyanliu

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

EXIT-trap wiring assertion — addressed in 26c9c41. Rather than repeat the source check inside each behavioral test, I added a single contract-guard test that asserts both launch paths (non-root and root) register trap clear_in_container_gateway_marker EXIT. I verified it fails (expected 2, got 1) when either registration is removed, so the marker cleanup the behavioral tests exercise is pinned to actually fire in production.

Sandbox lifecycle E2E — agreed these entrypoint changes warrant sandbox-survival-e2e / sandbox-operations-e2e / cloud-e2e / openclaw-slack-pairing-e2e. As an external contributor I can't trigger the NVIDIA-runner jobs (this PR is still pending CPR vetting), so I'll leave that to a maintainer. Happy to adjust the change if the E2E run surfaces anything.

@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Jun 23, 2026
@wscurran

Copy link
Copy Markdown
Contributor

@cv cv added the v0.0.80 Release target label Jul 9, 2026
@prekshivyas prekshivyas self-assigned this Jul 9, 2026
@cv cv added the needs: rebase PR needs rebase or conflict resolution label Jul 9, 2026
@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This PR is currently conflicted, its body lacks the required Signed-off-by: declaration, and both commits are not GitHub Verified. Please publish a clean compliant history and update the PR body; if the branch cannot be rewritten safely, open a fresh PR.

@prekshivyas
prekshivyas force-pushed the fix/healthcheck-stale-pidfile-marker-cleanup branch from 26c9c41 to 5042672 Compare July 10, 2026 15:36
Clear the in-container gateway marker whenever the OpenClaw supervisor exits.

That keeps Docker healthchecks from trusting stale gateway pidfiles after the supervisor is gone.

Keep the marker present while the supervisor runs and across respawns.

Cover the current cleanup_openclaw_on_signal path through marker behavior tests.

Also require both production EXIT-trap registrations through the same behavior harness.

Co-authored-by: Zhi Yan Liu <lzy.dev@gmail.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas
prekshivyas force-pushed the fix/healthcheck-stale-pidfile-marker-cleanup branch from 5042672 to e3568b9 Compare July 10, 2026 15:39
@prekshivyas prekshivyas removed the needs: rebase PR needs rebase or conflict resolution label Jul 10, 2026
@prekshivyas

Copy link
Copy Markdown
Contributor

@coderabbitai review

@prekshivyas

Copy link
Copy Markdown
Contributor

Exact-head rewrite at e3568b9b: rebuilt the PR as a single GitHub-Verified signed commit with DCO in the commit and PR body, resolved conflicts against current main, kept the production EXIT-trap coverage through behavioral tests without adding source-shape assertions, and removed the stale rebase label. Local validation passed focused Vitest, Biome lint/format, typecheck, source-shape, pre-commit, and pre-push. Exact-head live sandbox-survival,sandbox-operations,cloud-onboard,openclaw-slack-pairing E2E is running in 29104603734.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29104603734
Workflow ref: tmp/e2e/pr-5569-gateway-marker-e3568b9b
Requested targets: sandbox-survival,sandbox-operations,cloud-onboard,openclaw-slack-pairing
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 4 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
openclaw-slack-pairing ✅ success
sandbox-operations ✅ success
sandbox-survival ✅ success

@prekshivyas

Copy link
Copy Markdown
Contributor

Exact-head live E2E is green for e3568b9b: run 29104603734 passed cloud-onboard, sandbox-survival, sandbox-operations, and openclaw-slack-pairing.

@prekshivyas

Copy link
Copy Markdown
Contributor

Follow-up validation is now green at exact head e3568b9b: live E2E passed cloud-onboard, sandbox-survival, sandbox-operations, and openclaw-slack-pairing in run 29104603734; E2E Advisor passed in run 29105073339; PR Review Advisor passed in run 29105515061 for both GPT-5.5 and Nemotron Ultra. CodeRabbit re-review command completed with no new action requested.

Comment thread test/nemoclaw-start-gateway-marker.test.ts Fixed

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head security review at e3568b9b10f792af5768301973131d25c18d78b2: changes required before approval.

The marker is created before EXIT and SIGINT/SIGTERM cleanup handlers are armed in both supervisor paths (scripts/nemoclaw-start.sh:4791-4804 and :5410-5442, with the non-root signal trap later still). Early startup exits or a signal in that window can leave /tmp/nemoclaw-gateway-local behind and recreate the stale-health condition this PR is meant to fix.

Please arm cleanup before the first marker write in both paths and add focused root/non-root regressions that fail or signal immediately after marking and prove the marker is removed. Ordinary CI and live E2E are green, but they do not exercise this ordering window; the GPT-5.5 advisor independently identified the same blocker.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head maintainer follow-up at e3568b9b10: ordinary CI is green, DCO and commit verification pass, and Nemotron found no blocker. The trusted GPT-5.5 advisor run 29110341655 found one valid correctness gap before live validation.

Both supervisor paths can create /tmp/nemoclaw-gateway-local before the new EXIT cleanup trap is armed. In the non-root path, mark_in_container_gateway is followed by capture_openclaw_pid_start_identity ... || exit 1, while the trap is installed later. In the root path, launch_openclaw_gateway marks and can exit on the same identity-capture failure before its caller installs the trap. On a docker-driver sandbox where the container survives this supervisor exit, that leaves exactly the stale marker and stale pidfile state this PR is intended to fix.

Please install the cleanup trap before any path can write the marker, while preserving any existing EXIT cleanup contract, and add focused regressions that simulate post-marker identity-capture failure in both the non-root and root launch shapes and assert the marker is removed.

After the fix, refresh exact-head CI and both advisors. E2E-advisor run 29110343190 requires issue-2478-crash-loop-recovery, sandbox-survival, gateway-health-honest, and target ubuntu-repo-cloud-openclaw.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cv

cv commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Exact-head follow-up at 650eb721cb: the substantive early-exit marker bug is fixed. Both root and non-root paths arm the EXIT trap before marking, the new regressions exercise the real launch shapes, and the focused suite passes 16/16. DCO/verification and merge-with-current-main checks are clean. I approved the nine fork workflow runs that were waiting in action_required.

One exact source cleanup remains: test/nemoclaw-start-gateway-marker.test.ts:308 still declares exitTrapRegistrations without using it; remove that stale variable and resolve the corresponding GHAS thread.

The live run currently in progress covers sandbox operations/survival, cloud onboarding, and Slack pairing, but it does not cover the advisor-required issue-2478-crash-loop-recovery and gateway-health-honest jobs. Run those after the cleanup and also provide exact-head ubuntu-repo-cloud-openclaw target evidence. Once CI and trusted advisors settle, the earlier human change requests can be cleared.

@cjagwani

Copy link
Copy Markdown
Collaborator

Maintainer disposition for the exact-head full-e2e timing result on cf4b042fa91254c0e18a58203fc0bf50da80bbba:

  • Two independent exact-head samples missed only the cold-onboard wall-clock budget: 183.293s and 183.696s versus 180s.
  • Both samples completed install and first turn with exit 0, returned the expected response, stayed below the 60s silence ceiling, and used BuildKit with no fallback. Image export took 54.8s and 55.6s.
  • An unchanged current-main comparator at 7c955d42614276bb6e062535438a0e3cec5cde03 also failed the same assertion at 181.550s in run 29125880976, with successful functional metrics and a 55.5s image export.
  • The earlier exact PR code passed at 179.860s when image export happened to take 45.9s.

This establishes a current-main hosted-runner performance-budget variance, not a functional regression in this marker-cleanup PR. I accept the two timing-only non-success results for #5569 and will not spend another runner retry on the unchanged head. The flaky budget is tracked as #6660; all functional live evidence remains required and is green.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 29126042003
Workflow ref: tmp/e2e/pr-5569-gateway-marker-cf4b042f
Requested targets: (default — all supported)
Requested jobs: cloud-onboard,sandbox-operations,issue-2478-crash-loop-recovery,sandbox-survival,gateway-health-honest,full-e2e
Summary: 5 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
full-e2e ❌ failure
gateway-health-honest ✅ success
issue-2478-crash-loop-recovery ✅ success
sandbox-operations ✅ success
sandbox-survival ✅ success

Failed jobs: full-e2e. Check run artifacts for logs.

@cjagwani

Copy link
Copy Markdown
Collaborator

@cv, please re-review current exact head cf4b042fa91254c0e18a58203fc0bf50da80bbba. It moves cleanup ahead of every marker write in both supervisor paths and adds the requested early-failure/signal regressions.

Current evidence is settled: ordinary CI is fully green; target ubuntu-repo-cloud-openclaw, sandbox-survival, sandbox-operations, gateway-health-honest, cloud-onboard, and issue-2478-crash-loop-recovery all pass across the exact-head runs. Two trusted manual GPT/Nemotron artifacts bind cf4b and both recommend merge_as_is with zero required findings. The only non-success is the separately accepted cold-start timing variance documented above and tracked in #6660; unchanged current main fails the same 180s threshold.

The repository's current manual-advisor workflow cannot publish its bot sticky for fork PRs, so the strict gate still needs the prepared workflow/tooling repair before final approval. Your stale change request is the remaining source-level human review to clear.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29127303354
Workflow ref: tmp/e2e/pr-5569-gateway-marker-96ca21d0
Requested targets: ubuntu-repo-cloud-openclaw
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
live ✅ success

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29127769177
Workflow ref: tmp/e2e/pr-5569-gateway-marker-ff043cfe
Requested targets: ubuntu-repo-cloud-openclaw
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
live ✅ success

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 29127308388
Workflow ref: tmp/e2e/pr-5569-gateway-marker-96ca21d0
Requested targets: (default — all supported)
Requested jobs: cloud-onboard,sandbox-operations,issue-2478-crash-loop-recovery,sandbox-survival,gateway-health-honest,full-e2e
Summary: 4 passed, 1 failed, 1 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
full-e2e ❌ failure
gateway-health-honest ✅ success
issue-2478-crash-loop-recovery ⚠️ cancelled
sandbox-operations ✅ success
sandbox-survival ✅ success

Failed jobs: full-e2e. Check run artifacts for logs.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Run cancelled — no signal

Run: 29128003675
Workflow ref: tmp/e2e/pr-5569-gateway-marker-96ca21d0
Requested targets: (default — all supported)
Requested jobs: full-e2e
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
full-e2e ⚠️ cancelled

@cjagwani cjagwani closed this Jul 10, 2026
@cjagwani cjagwani reopened this Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 29127768099
Workflow ref: tmp/e2e/pr-5569-gateway-marker-ff043cfe
Requested targets: (default — all supported)
Requested jobs: cloud-onboard,sandbox-survival,sandbox-operations,gateway-health-honest,issue-2478-crash-loop-recovery,full-e2e
Summary: 5 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
full-e2e ❌ failure
gateway-health-honest ✅ success
issue-2478-crash-loop-recovery ✅ success
sandbox-operations ✅ success
sandbox-survival ✅ success

Failed jobs: full-e2e. Check run artifacts for logs.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Run cancelled — no signal

Run: 29128125104
Workflow ref: tmp/e2e/pr-5569-gateway-marker-ff043cfe
Requested targets: ubuntu-repo-cloud-openclaw
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
live ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Run cancelled — no signal

Run: 29128129582
Workflow ref: tmp/e2e/pr-5569-gateway-marker-ff043cfe
Requested targets: (default — all supported)
Requested jobs: cloud-onboard,sandbox-operations,issue-2478-crash-loop-recovery,sandbox-survival,gateway-health-honest,full-e2e
Summary: 0 passed, 0 failed, 6 cancelled, 0 skipped

Job Result
cloud-onboard ⚠️ cancelled
full-e2e ⚠️ cancelled
gateway-health-honest ⚠️ cancelled
issue-2478-crash-loop-recovery ⚠️ cancelled
sandbox-operations ⚠️ cancelled
sandbox-survival ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29128490199
Workflow ref: tmp/e2e/pr-5569-gateway-marker-f4cd7ea9
Requested targets: ubuntu-repo-cloud-openclaw
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
live ✅ success

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All requested jobs passed

Run: 29128496025
Workflow ref: tmp/e2e/pr-5569-gateway-marker-f4cd7ea9
Requested targets: (default — all supported)
Requested jobs: cloud-onboard,sandbox-operations,issue-2478-crash-loop-recovery,sandbox-survival,gateway-health-honest,full-e2e
Summary: 6 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
full-e2e ✅ success
gateway-health-honest ✅ success
issue-2478-crash-loop-recovery ✅ success
sandbox-operations ✅ success
sandbox-survival ✅ success

@prekshivyas
prekshivyas requested review from cjagwani and cv July 10, 2026 22:59

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@cv
cv enabled auto-merge (squash) July 10, 2026 23:15
@cv
cv merged commit 77db6fb into NVIDIA:main Jul 10, 2026
32 checks passed
cv pushed a commit that referenced this pull request Jul 11, 2026
## Summary

Release-prep documentation for **v0.0.80**. Adds the `## v0.0.80`
section to `docs/about/release-notes.mdx` summarizing user-facing
changes since v0.0.79, each bullet linking to the relevant deeper page.

Produced via `nemoclaw-contributor-update-docs` (pre-tag path): scanned
`v0.0.79..HEAD`, applied the docs skip list (no violations), and
confirmed the 8 commits that already shipped in-PR docs are complete. No
new pages needed.

## Source summary

- #6507 -> `docs/about/release-notes.mdx`: Hermes v0.18 + Slack Block
Kit (rich rendering, digest-pinned base image).
- #6584 / #6616 -> `docs/about/release-notes.mdx`: host-local OpenRouter
runtime attribution adapter (port `11437`,
`NEMOCLAW_OPENROUTER_RUNTIME_ADAPTER_PORT`) and native Deep Agents
`openrouter` provider.
- #6210 / #6292 -> `docs/about/release-notes.mdx`: host corporate proxy
CA import into sandbox trust (`NEMOCLAW_CORPORATE_CA_BUNDLE`,
`NEMOCLAW_CORPORATE_CA_IMPORT`).
- #6624 / #6623 / #6656 -> `docs/about/release-notes.mdx`:
release-matched base-image selection, surfaced cluster-image build
diagnostics, preserved Nemotron profile registration.
- #6629 / #6637 -> `docs/about/release-notes.mdx`: bare `connect`
default-sandbox behavior and route-probe hardening.
- #6634 / #6626 / #6596 / #5569 / #6610 / #6655 ->
`docs/about/release-notes.mdx`: onboarding/recovery preservation,
stale-gateway-PID fix, installer backup message, vLLM label on managed
platforms.
- #6578 / #5670 -> `docs/about/release-notes.mdx`: automatic Hermes
light terminal skin and non-interactive `npx` MCP server startup.

## Verification

`npm run docs`: 0 errors, all internal links resolve (2 pre-existing
hidden-page warnings). `_build/` variants for OpenClaw, Hermes, and Deep
Agents all regenerate with the v0.0.80 section.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

* **Documentation**
  * Added release notes for v0.0.80.
  * Documented Hermes upgrades, including Slack Block Kit rendering.
  * Added details on OpenRouter traffic routing and attribution headers.
* Documented improved proxy certificate handling and sandbox
reliability.
* Highlighted enhanced connection defaults, route-probing safeguards,
onboarding recovery, and terminal/MCP startup behavior.
  * Added references to relevant user-guide documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zhiyanliu
zhiyanliu deleted the fix/healthcheck-stale-pidfile-marker-cleanup branch July 12, 2026 05:05
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…VIDIA#5569)

## Summary

Fixes NVIDIA#5568.

On OpenShell docker-driver sandboxes, `scripts/nemoclaw-start.sh` is not
PID 1 — OpenShell's `sleep infinity` keeps the container alive as a
sibling. The Docker HEALTHCHECK's pidfile fallback (NVIDIA#4952) trusts
`/tmp/nemoclaw-gateway.pid`, which is refreshed only by
`record_gateway_pid` inside this script's launch and respawn paths. When
the supervise loop exits, the container lives on but nothing refreshes
the pidfile. The in-container gateway marker stays in place, so the
healthcheck keeps trusting a now-stale PID forever and reports a working
sandbox as permanently `unhealthy`.

## Change

- Add `clear_in_container_gateway_marker`, symmetric to
`mark_in_container_gateway`.
- Arm it via `trap ... EXIT` right after the existing `SIGTERM`/`SIGINT`
trap, in both the non-root and root supervise paths.

The EXIT trap covers every way the supervisor leaves: a clean gateway
exit, a forwarded signal (`cleanup_on_signal` ends in `exit`), and
errexit. This keeps the fix inside `nemoclaw-start.sh` and out of the
shared `cleanup_on_signal` in `sandbox-init.sh`, which
`agents/hermes/start.sh` also sources. The marker is re-dropped at each
(re)launch by `mark_in_container_gateway`, so the respawn loop — which
never exits the script — keeps it in place; only a supervisor *exit*
clears it.

The marker semantics become: "a supervisor is actively managing the
gateway and keeping the pidfile fresh." Once the marker is gone, the
healthcheck takes the marker-absent → healthy branch (NVIDIA#4503) instead of
trusting a stale PID.

## Tests

Extends `test/nemoclaw-start-gateway-marker.test.ts`, reusing its
existing `extractShellFunctionFromSource` / `safeTmpHelpers` harness so
each case runs the real shell functions in isolation against a temp
marker path:

- `clear_in_container_gateway_marker` removes the marker and is a no-op
when it is absent.
- The marker is dropped when the supervisor reaches a clean exit (real
`trap ... EXIT` wiring, not a direct helper call).
- The marker is dropped when the supervisor is terminated by a signal,
exercising the `cleanup_on_signal` → `exit` → EXIT-trap path.
- The marker survives respawns while the supervisor keeps running, and
is cleared only once the script finally exits.

`shfmt`, `shellcheck`, Biome, and `typecheck:cli` pass; the new and
existing marker tests pass (14/14). Happy to revisit the choice of an
EXIT trap over explicit cleanup at each exit site if maintainers prefer
a different shape.


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

* **Bug Fixes**
* Improved gateway supervisor shutdown to reliably remove the
in-container gateway marker on normal exit, SIGTERM/SIGINT termination,
early launch failures, and `errexit`/`EXIT` flows (including non-PID 1
scenarios).
* Reduces risk of stale marker files misleading container health checks.
* **Tests**
* Added shell-based behavioral coverage for marker cleanup on both
launch paths, SIGTERM teardown, and marker persistence across respawn
iterations until final exit.
* **Documentation**
* Clarified the marker lifecycle in the deployment/architecture
reference.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

---------

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Co-authored-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-authored-by: Charan Jagwani <cjagwani@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary

Release-prep documentation for **v0.0.80**. Adds the `## v0.0.80`
section to `docs/about/release-notes.mdx` summarizing user-facing
changes since v0.0.79, each bullet linking to the relevant deeper page.

Produced via `nemoclaw-contributor-update-docs` (pre-tag path): scanned
`v0.0.79..HEAD`, applied the docs skip list (no violations), and
confirmed the 8 commits that already shipped in-PR docs are complete. No
new pages needed.

## Source summary

- NVIDIA#6507 -> `docs/about/release-notes.mdx`: Hermes v0.18 + Slack Block
Kit (rich rendering, digest-pinned base image).
- NVIDIA#6584 / NVIDIA#6616 -> `docs/about/release-notes.mdx`: host-local OpenRouter
runtime attribution adapter (port `11437`,
`NEMOCLAW_OPENROUTER_RUNTIME_ADAPTER_PORT`) and native Deep Agents
`openrouter` provider.
- NVIDIA#6210 / NVIDIA#6292 -> `docs/about/release-notes.mdx`: host corporate proxy
CA import into sandbox trust (`NEMOCLAW_CORPORATE_CA_BUNDLE`,
`NEMOCLAW_CORPORATE_CA_IMPORT`).
- NVIDIA#6624 / NVIDIA#6623 / NVIDIA#6656 -> `docs/about/release-notes.mdx`:
release-matched base-image selection, surfaced cluster-image build
diagnostics, preserved Nemotron profile registration.
- NVIDIA#6629 / NVIDIA#6637 -> `docs/about/release-notes.mdx`: bare `connect`
default-sandbox behavior and route-probe hardening.
- NVIDIA#6634 / NVIDIA#6626 / NVIDIA#6596 / NVIDIA#5569 / NVIDIA#6610 / NVIDIA#6655 ->
`docs/about/release-notes.mdx`: onboarding/recovery preservation,
stale-gateway-PID fix, installer backup message, vLLM label on managed
platforms.
- NVIDIA#6578 / NVIDIA#5670 -> `docs/about/release-notes.mdx`: automatic Hermes
light terminal skin and non-interactive `npx` MCP server startup.

## Verification

`npm run docs`: 0 errors, all internal links resolve (2 pre-existing
hidden-page warnings). `_build/` variants for OpenClaw, Hermes, and Deep
Agents all regenerate with the v0.0.80 section.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

* **Documentation**
  * Added release notes for v0.0.80.
  * Documented Hermes upgrades, including Slack Block Kit rendering.
  * Added details on OpenRouter traffic routing and attribution headers.
* Documented improved proxy certificate handling and sandbox
reliability.
* Highlighted enhanced connection defaults, route-probing safeguards,
onboarding recovery, and terminal/MCP startup behavior.
  * Added references to relevant user-guide documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression v0.0.80 Release target

Projects

None yet

6 participants