Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8d028b8
feat(state): segregate host state root per gateway port
laitingsheng Jul 12, 2026
15bbe12
fix(state): keep gateway-port state root correct under real CLI runs
laitingsheng Jul 12, 2026
d560c34
Merge remote-tracking branch 'origin/main' into feat/3053-instance-st…
laitingsheng Jul 12, 2026
435c689
test(cli): prove port segregation in the gateway-conflict status test
laitingsheng Jul 12, 2026
e16b885
Merge remote-tracking branch 'origin/main' into feat/3053-instance-st…
laitingsheng Jul 13, 2026
4f56d39
refactor(state): pass GATEWAY_PORT explicitly to nemoclawStateRoot
laitingsheng Jul 13, 2026
5ed2008
fix(state): harden gateway-scoped lifecycle
prekshivyas Jul 13, 2026
618294b
test(state): use declarative symlink platform gate
prekshivyas Jul 13, 2026
9bac22d
fix(state): secure remaining port-scoped writers
prekshivyas Jul 13, 2026
a2fa5ba
test(state): close port-scoped consumer gaps
prekshivyas Jul 13, 2026
5f0a409
fix(state): report selected backup root
prekshivyas Jul 13, 2026
1abadcc
Merge remote-tracking branch 'origin/main' into codex/pr-6711-fixes
prekshivyas Jul 13, 2026
479c033
fix(state): reject symlinked model router roots
prekshivyas Jul 13, 2026
5fecf93
Merge remote-tracking branch 'origin/main' into codex/pr-6711-fixes
prekshivyas Jul 13, 2026
70c8d2d
test(e2e): assert port-scoped gateway registries
prekshivyas Jul 13, 2026
d2d7483
fix(state): close multi-gateway lifecycle gaps
prekshivyas Jul 13, 2026
3c5fb29
Merge branch 'main' of github.com:NVIDIA/NemoClaw into codex/pr-6711-…
prekshivyas Jul 13, 2026
4b11dd0
test(uninstall): model preservable state precisely
prekshivyas Jul 13, 2026
31a3b56
fix(uninstall): preserve legacy sibling gateways
prekshivyas Jul 13, 2026
741e816
fix(state): harden gateway migration and installer
prekshivyas Jul 13, 2026
00dba27
test(installer): keep symlink cases linear
prekshivyas Jul 13, 2026
1fda112
test(state): avoid external CLI in migration proof
prekshivyas Jul 13, 2026
17f9343
fix(state): close gateway migration safety gaps
prekshivyas Jul 13, 2026
91a5b01
fix(installer): fail closed on registry inspection
prekshivyas Jul 13, 2026
a4fe26f
test(state): harden cleanup regressions
prekshivyas Jul 13, 2026
b92e8ac
test(uninstall): use valid preserved registry fixture
prekshivyas Jul 13, 2026
d9532be
fix(uninstall): remove current gateway registration
prekshivyas Jul 13, 2026
895557d
Merge branch 'main' into feat/3053-instance-state-root
prekshivyas Jul 13, 2026
e66655c
test(uninstall): isolate gateway compatibility cases
prekshivyas Jul 13, 2026
7d00f98
docs(uninstall): clarify gateway selection
prekshivyas Jul 13, 2026
3c263c9
Merge remote-tracking branch 'origin/main' into codex/pr-6711-fixes
prekshivyas Jul 13, 2026
8a672bd
Merge remote-tracking branch 'origin/main' into codex/pr-6711-fixes
prekshivyas Jul 14, 2026
ada776f
fix(state): harden migration recovery paths
prekshivyas Jul 14, 2026
c1c4bf3
Merge remote-tracking branch 'origin/main' into codex/pr-6711-fixes
prekshivyas Jul 14, 2026
09682cc
fix(uninstall): migrate legacy state before planning
prekshivyas Jul 14, 2026
290da9b
Merge branch 'main' into feat/3053-instance-state-root
prekshivyas Jul 14, 2026
144ffa5
Merge remote-tracking branch 'origin/main' into feat/3053-instance-st…
laitingsheng Jul 14, 2026
1a6990e
docs: fix uninstall cleanup scope and split multi-sentence lines
laitingsheng Jul 14, 2026
bb4d2d0
Merge branch 'main' into feat/3053-instance-state-root
cv Jul 14, 2026
44d70ee
Merge remote-tracking branch 'origin/main' into feat/3053-instance-st…
laitingsheng Jul 15, 2026
354feda
docs: stop overstating final-gateway uninstall cleanup scope
laitingsheng Jul 15, 2026
0cba390
Merge remote-tracking branch 'origin/main' into feat/3053-instance-st…
laitingsheng Jul 15, 2026
71dab25
Merge branch 'main' into feat/3053-instance-state-root
cv Jul 15, 2026
eeeb935
Merge branch 'main' into feat/3053-instance-state-root
cv Jul 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/manage-sandboxes/run-sandboxes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ When the default API port is already held by another sandbox, `$$nemoclaw onboar
<AgentOnly variant="openclaw,hermes">
If you intentionally run separate OpenShell gateways on the same host, set a different `NEMOCLAW_GATEWAY_PORT` before each onboarding run.
NemoClaw isolates the gateway name and local state by port so one port-specific gateway does not replace another.
A non-default `NEMOCLAW_GATEWAY_PORT` also gets its own host state root at `~/.nemoclaw/gateways/<port>/`, with a separate sandbox registry, snapshots, and legacy credential-migration files, so gateway-scoped state stays segregated while shared host-level files remain under `~/.nemoclaw/`.
On first use after upgrading, NemoClaw moves legacy rows and related state only when their recorded gateway identity matches the selected port; ambiguous state is left untouched with remediation.
Provider credentials remain in the OpenShell gateway store.
The default port keeps the shared `~/.nemoclaw/` location.
When other ports remain, `$$nemoclaw uninstall` removes only the selected gateway and keeps the shared CLI, services, images, providers, configuration, models, and swap.

Gateway and dashboard cleanup is scoped by sandbox name and port.
A later onboarding run that uses a different `NEMOCLAW_GATEWAY_PORT` or `--control-ui-port` does not tear down the first sandbox's gateway or dashboard forward.
Expand All @@ -66,6 +71,11 @@ A later onboarding run that uses a different `NEMOCLAW_GATEWAY_PORT` or `--contr
<AgentOnly variant="deepagents">
If you intentionally run separate OpenShell gateways on the same host, set a different `NEMOCLAW_GATEWAY_PORT` before each onboarding run.
NemoClaw isolates the gateway name and local state by port so one port-specific gateway does not replace another.
A non-default `NEMOCLAW_GATEWAY_PORT` also gets its own host state root at `~/.nemoclaw/gateways/<port>/`, with a separate sandbox registry, snapshots, and legacy credential-migration files, so gateway-scoped state stays segregated while shared host-level files remain under `~/.nemoclaw/`.
On first use after upgrading, NemoClaw moves legacy rows and related state only when their recorded gateway identity matches the selected port; ambiguous state is left untouched with remediation.
Provider credentials remain in the OpenShell gateway store.
The default port keeps the shared `~/.nemoclaw/` location.
When other ports remain, `nemo-deepagents uninstall` removes only the selected gateway and keeps the shared CLI, services, images, providers, configuration, models, and swap.
Gateway cleanup is scoped by sandbox name and port.
</AgentOnly>

Expand Down
13 changes: 10 additions & 3 deletions docs/manage-sandboxes/uninstall-nemoclaw.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ $$nemoclaw uninstall
| `--keep-openshell` | Leave OpenShell binaries installed. |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models. |
| `--destroy-user-data` | Also remove preserved user data in `rebuild-backups/`, `backups/`, and `sandboxes.json`. |
| `--gateway <name>` | Override the gateway name to remove. The default is `nemoclaw`. |
| `--gateway <name>` | Optional consistency check; must match the name derived from `NEMOCLAW_GATEWAY_PORT`. |

`NEMOCLAW_GATEWAY_PORT` selects the gateway instance to uninstall (`nemoclaw` for port `8080`, or `nemoclaw-<port>` for a non-default port).
For example, `NEMOCLAW_GATEWAY_PORT=9123 $$nemoclaw uninstall` selects `nemoclaw-9123` and its port-scoped state.
Do not use `--gateway` to select another instance; when supplied for compatibility, its value must match the derived name or uninstall stops before cleanup.

<Note>
The uninstall command preserves `~/.nemoclaw/rebuild-backups/`, `~/.nemoclaw/backups/`, and `~/.nemoclaw/sandboxes.json` by default.
Uninstall removes every other entry under `~/.nemoclaw/`.
For the default gateway, the uninstall command preserves `~/.nemoclaw/rebuild-backups/`, `~/.nemoclaw/backups/`, and `~/.nemoclaw/sandboxes.json` by default.
A non-default gateway uses the corresponding entries under `~/.nemoclaw/gateways/<port>/`.
When no sibling gateways remain, uninstall also removes the shared CLI, services, images, providers, configuration, models, and swap.
When sibling gateways remain, it removes only the selected gateway's resources and port-scoped state and preserves those shared host resources.
Either way, the preserved entries above stay unless you pass `--destroy-user-data`.

Interactive runs prompt before they remove the preserved entries, and the default answer keeps them.
For non-interactive runs using `--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or a non-TTY shell, pass `--destroy-user-data` or set `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1` to acknowledge data loss and remove the preserved entries.
Expand Down
5 changes: 3 additions & 2 deletions docs/reference/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ NemoClaw keeps non-secret operator-facing state on the host rather than inside t

| Path | Purpose |
|---|---|
| `~/.nemoclaw/sandboxes.json` | Registered sandbox metadata, including the default sandbox selection. |
| `~/.nemoclaw/sandboxes.json` | Registered sandbox metadata for the default gateway port, including the default sandbox selection. |
| `~/.nemoclaw/gateways/<port>/` | Segregated host state root (its own registry, snapshots, and legacy credential-migration files) for a non-default `NEMOCLAW_GATEWAY_PORT`. On upgrade, rows and related state move out of the legacy shared root only when their recorded gateway identity matches the selected port. Provider credentials remain in the OpenShell gateway store. The default gateway port uses the top-level `~/.nemoclaw/` location, so existing single-gateway hosts are unchanged. |
<AgentOnly variant="openclaw">
| `~/.openclaw/openclaw.json` | Host OpenClaw configuration that NemoClaw snapshots or restores during migration flows. |
</AgentOnly>
Expand All @@ -316,6 +317,7 @@ The following environment variables configure optional services and local access

| Variable | Purpose |
|---|---|
| `NEMOCLAW_GATEWAY_PORT` | Optional host-side gateway port override for an independent OpenShell gateway and port-scoped NemoClaw state root. Supported for OpenClaw, Hermes, and Deep Agents. |
<AgentOnly variant="openclaw">
| `TELEGRAM_BOT_TOKEN` | Telegram bot token you provide before `$$nemoclaw onboard`. OpenShell stores it in a provider; the sandbox receives placeholders, not the raw secret. |
| `TELEGRAM_ALLOWED_IDS` | Comma-separated Telegram user or chat IDs for allowlists when onboarding applies channel restrictions. |
Expand All @@ -338,7 +340,6 @@ The following environment variables configure optional services and local access
<AgentOnly variant="deepagents">
| `NEMOCLAW_POLICY_TIER` | Optional non-interactive policy tier selection during onboarding. |
| `TAVILY_API_KEY` | Host-side input for the optional managed Tavily provider. Register it with `$$nemoclaw credentials add tavily-search --type tavily --credential TAVILY_API_KEY` before attaching the provider to Deep Agents. |
| `NEMOCLAW_GATEWAY_PORT` | Optional host-side gateway port override when running multiple independent OpenShell gateways. |
</AgentOnly>

For normal setup and reconfiguration, prefer `$$nemoclaw onboard` over editing these files by hand.
Expand Down
17 changes: 12 additions & 5 deletions docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3057,23 +3057,30 @@ On Linux, uninstall removes `~/.local/state/nemoclaw`, which contains Docker-dri
| `--keep-openshell` | Leave OpenShell binaries installed |
| `--delete-models` | Also remove NemoClaw-pulled Ollama models |
| `--destroy-user-data` | Also remove preserved user data (`rebuild-backups/`, `backups/`, `sandboxes.json`) |
| `--gateway <name>` | Override the gateway name to remove (default: `$$nemoclaw`) |
| `--gateway <name>` | Optional consistency check; must match the name derived from `NEMOCLAW_GATEWAY_PORT` |

```bash
$$nemoclaw uninstall [--yes] [--keep-openshell] [--delete-models] [--destroy-user-data] [--gateway <name>]
```

`NEMOCLAW_GATEWAY_PORT` selects the gateway instance and state root to uninstall.
Port `8080` selects `nemoclaw` and the shared `~/.nemoclaw/` root; a non-default port selects `nemoclaw-<port>` and `~/.nemoclaw/gateways/<port>/`.
For example, `NEMOCLAW_GATEWAY_PORT=9123 $$nemoclaw uninstall` selects `nemoclaw-9123`.
The compatibility `--gateway` flag cannot select another instance: when present, it must match the name derived from `NEMOCLAW_GATEWAY_PORT`, or uninstall exits before cleanup.

##### User-data preservation under `~/.nemoclaw/`

To avoid uninstall destroying host-side user data, uninstall preserves the following entries under `~/.nemoclaw/` by default:
To avoid uninstall destroying host-side user data, uninstall preserves the following entries in the selected gateway's state root by default.
The default gateway uses `~/.nemoclaw/`; a non-default gateway uses `~/.nemoclaw/gateways/<port>/`.

| Entry | What it holds |
|---|---|
| `rebuild-backups/` | Host-side snapshots that `$$nemoclaw <name> snapshot create` and `$$nemoclaw backup-all` write. `$$nemoclaw <name> snapshot restore` reads them back after you reinstall. |
| `backups/` | Host-side workspace backups that `scripts/backup-workspace.sh` writes. Refer to [Transfer State Manually](../manage-sandboxes/state-and-backups/transfer-state-manually). |
| `sandboxes.json` | Host-side sandbox registry. NemoClaw uses it to map sandbox names back to their persistence directories when you reinstall. |

Uninstall removes every other entry under `~/.nemoclaw/` (gateway source, runtime state, the Ollama auth proxy PID file, etc.).
When no sibling gateways remain, uninstall also removes shared host resources such as the gateway source clone, runtime state, and the Ollama auth proxy PID file.
When sibling gateways remain, it removes only the selected gateway's resources and port-scoped state while preserving those shared host resources.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
`--yes` deliberately remains non-destructive for user data.
It only acknowledges the global `Proceed?` confirmation prompt and still preserves the listed entries.
Expand All @@ -3085,9 +3092,9 @@ Decision matrix:
| Context | Behaviour |
|---|---|
| Interactive TTY, preserved entries present, no env override | Prompts `Also remove them? [y/N]`. Default `N` keeps the entries. |
| Interactive TTY, user answers `y` | Removes everything under `~/.nemoclaw/` (the previous full-removal behaviour). |
| Interactive TTY, user answers `y` | Removes the preserved entries in the selected gateway's state root; a single-gateway uninstall also removes the remaining shared state. |
| Non-interactive (`--yes`, `NEMOCLAW_NON_INTERACTIVE=1`, or non-TTY shell) | Preserves the entries and prints a one-line notice. |
| `--destroy-user-data` | Skips the secondary user-data prompt and removes the preserved entries under `~/.nemoclaw/`. The global `Proceed?` confirmation still applies unless `--yes` is also passed. |
| `--destroy-user-data` | Skips the secondary user-data prompt and removes the preserved entries in the selected gateway's state root. The global `Proceed?` confirmation still applies unless `--yes` is also passed. |
| `NEMOCLAW_UNINSTALL_DESTROY_USER_DATA=1` | Skips the secondary user-data prompt and removes the preserved entries. The global `Proceed?` confirmation still applies unless `--yes` is also passed. |

The preserved entries survive uninstall as inert files on disk.
Expand Down
Loading
Loading