[WSL2][Hermes][Sandbox] `nemoclaw-start` supervisor never invoked on custom-gateway-port sandbox — `mcp add`/`recover`/`gateway restart` fail with `SUPERVISOR_UNAVAILABLE` despite a healthy, actively-serving gateway process
Investigation Summary
Root cause found via manual source inspection: assertHermesMcpMutationRuntimeCapability in src/lib/actions/sandbox/mcp-bridge-adapter-hermes.ts runs an in-sandbox probe (/usr/local/lib/nemoclaw/hermes-mcp-config-transaction.py probe) before any MCP mutation. That probe's _gateway_has_managed_parent(pid) check requires the direct parent of the running Hermes gateway process to be the exact trusted launcher, i.e. argv == [SERVICE_MANAGER_PATH] where SERVICE_MANAGER_PATH = b"/usr/local/bin/nemoclaw-start" (see hermes-mcp-config-transaction.py around line 54 / 744-770). If that check fails, the probe returns the literal string "Hermes gateway is not running under the managed service lifecycle", which the adapter (mcp-bridge-adapter-hermes.ts:150) surfaces as the CLI error.
docker inspect <container> confirms the container's actual entrypoint is /opt/openshell/bin/openshell-sandbox (the generic OpenShell sandbox supervisor), not nemoclaw-start. nemoclaw-start (/usr/local/bin/nemoclaw-start, ~3000 lines) is itself a long-lived supervisor — its supervise_hermes_gateway_current_user() function owns and respawns the gateway process indefinitely — so the intended chain is openshell-sandbox (pid 1) → nemoclaw-start → hermes.real gateway run. In this sandbox that middle link never forms: openshell-sandbox never launches nemoclaw-start, so the gateway process ends up parented directly to pid 1 instead.
Searching the entire docker logs <container> history for this sandbox (spanning several host/container restarts, from container creation through the present) turns up zero PROC:LAUNCH entries for nemoclaw-start — only periodic healthcheck sleep(N) launches. So this isn't a regression from a specific event; as far as the available history shows, the managed lifecycle for this sandbox incarnation may never have been established in the first place.
Because of this gap, the sandbox currently only stays up via an unofficial workaround (a systemd-triggered script that manually nohup-starts hermes gateway run, orphaning it to pid 1) — which happens to keep normal chat/Slack traffic working, but obviously can never satisfy _gateway_has_managed_parent.
Hypotheses ruled out:
- Not caused by pre-existing
generic-type OpenShell providers on the sandbox. Created a throwawaygenericprovider with a dummy credential, unrelated to any existing provider, and attemptedmcp addwith a brand-new server name — identical failure. - Not caused by resource contention from a second, chronically crash-looping sandbox sharing host Docker/WSL resources. That sandbox (registered on the other gateway,
nemoclaw/8080, itself fully dead with no listener) was removed entirely; the symptom was identical before and after. - Possibly related to the general "multiple gateway instances on one host" bug class (e.g. #5359 / NVBug 6225854, both since fixed) given this setup's
NEMOCLAW_GATEWAY_PORT=8990topology, but no existing issue matches this exact symptom (managed-lifecycle/nemoclaw-startparent check specifically), so filing as new.
Description
On this sandbox, nemoclaw <name> mcp add ... always fails with a "managed service lifecycle" error, and the suggested remedy (recover) does not help — recover, gateway restart, and connect --probe-only all fail the same way with SUPERVISOR_UNAVAILABLE.
However, the sandbox is not actually broken. The real hermes.real gateway run process has been running continuously for 8+ hours at time of investigation, and OCSF policy logs confirm it is actively and successfully making real Slack Web API calls (GET /api/users.conversations) on a steady ~5-minute cadence throughout that window. nemoclaw <name> doctor / doctor --fix both report Summary: healthy with no warnings — directly contradicting what status/recover/gateway restart report.
Secondary/minor issue worth noting: nemoclaw <name> status and nemoclaw <name> doctor disagree about the sandbox's health in a way that's confusing to debug: status says Hermes Agent: not running, while doctor's summary says healthy, for the exact same sandbox at the exact same time. Might be worth having doctor surface the managed-lifecycle/parent-process check too, since it currently misses the actual problem.
Expected: openshell-sandbox launches nemoclaw-start as part of bringing a Hermes sandbox to Ready, and nemoclaw-start supervises the gateway indefinitely, satisfying _gateway_has_managed_parent so mcp add/recover/gateway restart work normally.
Actual: nemoclaw-start is never launched for this sandbox. The gateway process only exists because of an external, unofficial keep-alive workaround, which can never satisfy the managed-lifecycle check.
Reproduction Steps
I don't have a clean minimal repro — this sandbox has an involved history (destroy+onboard on a non-default gateway port, followed by post-onboard provider switching via openshell provider update + nemoclaw inference set). I'm not sure which step(s) in that history are load-bearing for triggering the bug. Happy to help narrow it down if a maintainer has a hypothesis to test.
What's solidly reproducible on the affected sandbox right now:
nemoclaw <name> mcp add <any-new-name> --url https://mcp.slack.com/mcp --env <ANY_UNUSED_ENV_VAR>→ fails with the lifecycle error every time.docker exec <container> ps -eo pid,ppid,args | grep hermes.realalways showsPPid=1.nemoclaw-startnever appears indocker exec <container> psoutput at all.
Environment
- NemoClaw: v0.0.79 (latest maintained at time of filing: v0.0.83)
- OpenShell: 0.0.72 (docker driver)
- Host OS: Windows 11 Pro + WSL2 (Ubuntu 24.04)
- Docker: Engine 29.4.0
- Agent: Hermes Agent v0.17.0
- Gateway topology: two gateway instances registered on this host —
nemoclaw(default, port 8080) — was serving a second, unrelated sandboxnemoclaw-8990(custom port viaNEMOCLAW_GATEWAY_PORT=8990) — serves the affected sandbox- The second instance exists because a single gateway's inference route is shared by every sandbox registered to it, and this sandbox needs an independent inference route from the other one (documented behavior, not itself the bug).
- Affected sandbox history: created via
nemoclaw <name> destroy+NEMOCLAW_GATEWAY_PORT=8990 nemohermes onboard --fresh(onboarded with a local Ollama provider to satisfy the SSRF preflight on private-IP endpoints), later switched to a differentcompatible-endpointtarget viaopenshell provider update+nemoclaw inference set(documented supported pattern for LAN endpoints).
Debug Output
$ nemoclaw nemoclaw <name> recover and retry.
$ nemoclaw
$ nemoclaw
$ docker exec
$ docker exec
$ docker inspect
Logs
Full `docker logs <container>` history for this sandbox (from container creation through present, spanning several host/container restarts) searched for `nemoclaw-start` launch events: zero `PROC:LAUNCH` entries found for `nemoclaw-start` — only periodic healthcheck `sleep(N)` launches appear.
OCSF policy logs during the 8+ hour observation window: repeated `ALLOWED` entries for the actual gateway process (pid confirmed = the `hermes.real gateway run` process with PPid=1) making outbound `GET /api/users.conversations` calls to slack.com on a ~5-minute cadence, confirming the gateway itself is healthy and actively serving traffic throughout — consistent with `doctor`'s "healthy" verdict and inconsistent with `status`/`recover`/`gateway restart`'s failure reports.
Checklist
- [x] I confirmed this bug is reproducible
- [x] I searched existing issues and this is not a duplicate
✨ Thanks for the detailed root cause analysis. The probe's parent-process check assumes nemoclaw-start as the direct parent, but the container runs under the OpenShell sandbox supervisor. This breaks MCP add/recover/restart on custom-gateway-port sandboxes.
A clean current-main CI reproduction may narrow this beyond the custom-host-port topology, although the artifact does not contain the process tree needed to prove the same parent-chain root cause.
- Commit:
70d7d287f03f82355eafccfc8084de3741069281 - Job:
hermes-inference-switch/ Anthropic - Artifact: 8471643327
This was a fresh E2E sandbox on the ordinary OPENSHELL_GATEWAY=nemoclaw lane. Onboarding reported:
Waiting for OpenShell supervisor to reconnect to the recreated container (up to 900s)...
...
Hermes Agent gateway is healthy
...
Policy version 2 loaded (active version: 2)
SUPERVISOR_UNAVAILABLE
NEMOCLAW_CONTROL_STAGE=preflight
Secret-boundary check did not complete cleanly for Hermes gateway
The install then exited 1 before the inference-switch assertions could run. The sandbox and gateway were observably healthy immediately before the policy/secret-boundary preflight rejected the lifecycle.
This proves the user-visible failure on a clean current-main CI setup; it does not yet prove that nemoclaw-start was absent or that the gateway's PPID was 1. Capturing ps -eo pid,ppid,args, /tmp/nemoclaw-start.log, and the control probe result whenever this preflight fails would distinguish the exact #7142 parent-chain defect from a supervisor reconnect race instead of making maintainers divine process ancestry from one token.
Current-main follow-up, with the topology boundary kept explicit.
What this does not prove
The filed case is NemoClaw v0.0.79 on WSL2, NEMOCLAW_GATEWAY_PORT=8990, with a gateway orphaned under PID 1 by an external keep-alive and no clean minimal reproduction. I have not recreated that topology. Nothing below proves that exact custom-port / missing-nemoclaw-start root cause is fixed.
What current main now contains
At GitHub-verified 888c3d9c438d4b7a7da9e47be7d5430e9d29b9d8:
- #6677 provides guarded transactional recovery for a registered legacy Docker container in a stable
SUPERVISOR_NOT_RUNNINGstate. ac120c86egives an inconsistent Hermes/proc/<pinned-supervisor>/environread up to one second of retry grace, but only while the exact process identity remains unchanged. Persistent unreadability or identity change still fails closed. That addresses the clean default-laneSUPERVISOR_UNAVAILABLE/NEMOCLAW_CONTROL_STAGE=preflightrace reported above; it does not weaken the managed-parent proof.
Live current-main result
Run 29773264312 checked out exact SHA 888c3d9c....
- Attempt 1, job 88456590526, was infrastructure-inconclusive: GitHub reported that the hosted runner lost server communication during the live Vitest step; the Anthropic log blob and artifact were never produced.
- The failed-job rerun, job 88468598310, passed 1/1 in 423.54s. Artifact 8475223950 records
install-hermesexit 0, the same managed gateway PID (240) before and after the route switch, post-switch health exit 0, and both API andinference.localchat probes exit 0.
That proves the ordinary OPENSHELL_GATEWAY=nemoclaw clean lane can install Hermes, clear managed preflight, sync a compatible Anthropic route, retain the live gateway process, and serve health/chat. It does not exercise port 8990, mcp add, recover, or gateway restart, so the original topology remains open pending a faithful reproduction.
Doctor contradiction candidate
GitHub-verified aaa10aa8aaad50cfc01310a2703f7b9da1621217 is a direct child of 888c3d9c.... It does not claim to repair the topology. It makes doctor run only the bounded, read-only managed-controller probe for registered OpenClaw/Hermes sandboxes and report Managed lifecycle as:
okonly for status 0 plus exactly one validGATEWAY_PIDmarker and no failure marker;warnfor unavailable probe transport or exactSUPERVISOR_BUSYcontention;failfor lifecycle/security refusals, contradictions, malformed/ambiguous output, or a missing trusted completion marker.
Only one allowlisted marker and applicable probe stage can reach output; raw controller output, paths, appended exceptions, and environment material are discarded. Candidate verification: 34/34 focused tests, CLI build/type checks, docs build with 0 errors (two pre-existing warnings), and npm run check:diff passed.
A replacement publication candidate now includes upstream main at 65d78eeb.
- Branch:
fix/doctor-managed-lifecycle-7142-v2 - Commit:
c835bfd9 - GitHub verification:
verified=true, reasonvalid - Ancestry: one commit ahead, zero behind
The original candidate had one commit-body line longer than the current 100-character limit. This branch uses a fresh verified commit and does not rewrite published history. It also preserves the #7261 command documentation.
Exact-head evidence:
npm run build:cli: passed- focused Vitest: 2 files, 34 tests passed
test/changelog-docs.test.ts: 6 tests passednpm run docs: 0 errors, 2 warningsnpm run check:diff: passed, including commitlint, gitleaks, repository checks, and CLI TypeScript- changed-text review: no blocking ambiguity under the current Technical English pilot
The topology boundary remains unchanged. Run 29773264312 proves the ordinary managed Hermes route. It does not reproduce port 8990, the PID-1 orphan topology, mcp add, recover, or gateway restart.
Hi @mill101, thanks for the detailed supervisor and gateway diagnostics. We’re planning an updated architecture for NemoClaw, so we’re closing this earlier custom-port supervisor recovery report as not planned.
If this is still an issue that needs prioritization, please re-open and tag @wscurran.