Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5bf10d6
fix(e2e): retry transient OpenClaw provider turns
cjagwani Sep 4, 2026
2c6c687
test(e2e): register provider retry parity
cjagwani Sep 4, 2026
65677ba
fix(e2e): structure provider retry signals
cjagwani Sep 4, 2026
5c8b008
merge: update provider retry repair from main
prekshivyas Sep 5, 2026
8c240fb
fix(forward): settle service startup safely
prekshivyas Sep 5, 2026
e916534
Merge remote-tracking branch 'origin/main' into pr-11077
prekshivyas Sep 5, 2026
b180da4
fix(e2e): make forward retries process-safe
prekshivyas Sep 5, 2026
5571a9b
fix(forward): verify process identity before cleanup
prekshivyas Sep 5, 2026
3668662
fix(forward): verify supported-host listener ownership
prekshivyas Sep 5, 2026
fdcd474
Merge remote-tracking branch 'origin/main' into pr-11077
prekshivyas Sep 5, 2026
f9fa066
fix(e2e): close forward retry validation gaps
prekshivyas Sep 5, 2026
57f938e
fix(forward): avoid activating readiness probes
prekshivyas Sep 5, 2026
741c539
fix(forward): restore readiness handoff retries
prekshivyas Sep 5, 2026
7de1f17
fix(forward): normalize wrapped readiness errors
prekshivyas Sep 5, 2026
3cdb354
fix(forward): normalize diagnostic layout
prekshivyas Sep 5, 2026
45c5a18
fix(e2e): require provider outage evidence
prekshivyas Sep 5, 2026
2d0df5e
fix(e2e): preserve retry cleanup budget
prekshivyas Sep 5, 2026
7ebb655
test(e2e): model empty provider turns
prekshivyas Sep 5, 2026
312b2ee
fix(forward): report scoped recovery state
prekshivyas Sep 5, 2026
03be604
fix(forward): preserve OpenShell config authority
prekshivyas Sep 5, 2026
0d1cfc7
fix(e2e): keep provider retries fail closed
prekshivyas Sep 5, 2026
26933c7
fix(forward): verify recovered listener identity
prekshivyas Sep 5, 2026
e1fc111
test(forward): use platform test gate
prekshivyas Sep 5, 2026
d4b602c
fix(forward): bound listener stability
prekshivyas Sep 5, 2026
4f9126d
fix(forward): verify launch listener authority
prekshivyas Sep 5, 2026
cebe90d
fix(e2e): block retry after cleanup failure
prekshivyas Sep 5, 2026
4302882
fix(e2e): narrow provider outage retry
prekshivyas Sep 8, 2026
d0bd3f4
fix(e2e): fail closed before provider retry
prekshivyas Sep 8, 2026
5154b00
chore: merge latest main into provider retry
prekshivyas Sep 8, 2026
7eb235e
test(e2e): close provider retry evidence gaps
prekshivyas Sep 8, 2026
4f3705a
chore: merge latest main into provider retry
prekshivyas Sep 8, 2026
f5817d1
fix(e2e): delimit provider retry marker
prekshivyas Sep 8, 2026
a357622
chore: merge latest main into provider retry
prekshivyas Sep 8, 2026
639a46e
chore: merge latest main into provider retry
prekshivyas Sep 8, 2026
86a13cc
fix(e2e): trust structured provider failures
prekshivyas Sep 8, 2026
254a16a
chore: merge main into provider availability fix
prekshivyas Sep 8, 2026
8892c34
fix(ci): preserve macOS E2E timeout headroom
prekshivyas Sep 8, 2026
2813f54
chore: merge latest main into provider availability fix
prekshivyas Sep 8, 2026
d730fe4
refactor(e2e): centralize full E2E timeout budget
prekshivyas Sep 8, 2026
ced63a2
test(e2e): stage timeout contract in advisor fixture
prekshivyas Sep 9, 2026
1d293d9
chore: merge latest main into provider availability fix
prekshivyas Sep 9, 2026
ea428b6
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 2026
ea2d353
fix(deps): require patched js-yaml
prekshivyas Sep 9, 2026
428db9a
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 2026
4c7c717
test(e2e): prove exhausted provider handoff
prekshivyas Sep 9, 2026
005a9a0
test(e2e): keep provider proof within guardrails
prekshivyas Sep 9, 2026
f6a376a
test(e2e): accept bounded provider diagnostics
prekshivyas Sep 9, 2026
fe8072e
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 2026
b7414a1
ci(e2e): bind portable timeout ownership
prekshivyas Sep 9, 2026
512f326
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 2026
a7dce15
fix(e2e): constrain provider retries and budgets
prekshivyas Sep 9, 2026
651937c
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 2026
80cb7c1
test(e2e): use typed standard timeout contract
prekshivyas Sep 9, 2026
b5a0c8c
Merge remote-tracking branch 'origin/main' into pr-11077-narrow
prekshivyas Sep 9, 2026
66cd7e0
fix(e2e): route timeout contract evidence
prekshivyas Sep 9, 2026
18befcf
test(e2e): cover accepted provider variants
prekshivyas Sep 9, 2026
8e8fdc9
chore(deps): drop unrelated lockfile drift
prekshivyas Sep 9, 2026
b6eaf1c
Merge remote-tracking branch 'origin/main' into pr-11077-narrow
prekshivyas Sep 9, 2026
4fe9f99
fix(e2e): complete timeout evidence routing
prekshivyas Sep 9, 2026
8e0f75b
fix(e2e): validate provider retry evidence
prekshivyas Sep 9, 2026
49e8658
fix(e2e): preserve fail-closed provider retries
prekshivyas Sep 9, 2026
399bef7
Merge origin/main into codex/fix-10978-provider-availability-20260904
prekshivyas Sep 9, 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
2 changes: 1 addition & 1 deletion .github/workflows/portable-profile-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
portable-launch:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-26.04
timeout-minutes: 75
timeout-minutes: 90
env:
E2E_JOB: "1"
E2E_TARGET_ID: portable-launch
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog/2026-09-04.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It also hardens sandbox recovery, onboarding, inference validation, MCP lifecycl
Related changes: [PR #10722](https://github.com/NVIDIA/NemoClaw/pull/10722) and [PR #10996](https://github.com/NVIDIA/NemoClaw/pull/10996).
For more information, refer to [Recover and Rebuild Sandboxes](/user-guide/openclaw/manage-sandboxes/operate-sandboxes/recover-and-rebuild-sandboxes) and [Security Best Practices](/user-guide/openclaw/security/best-practices).
- NemoClaw now uses detached `openshell forward service` processes for managed dashboard, messaging, and MCP host forwards instead of owning SSH forwarding processes and receipt state.
The forward lifecycle follows sandbox and gateway availability, refuses an occupied host port, verifies reachability before success, and relaunches through normal recovery.
These service-managed forwards follow sandbox and gateway availability, refuse an occupied host port, verify reachability for an existing forward, verify ownership and startup stability for a newly launched forward, and relaunch through normal recovery.
MCP lifecycle work and typed policy reads also retain the sandbox's recorded gateway, workspace, TLS, and mTLS authority instead of inheriting ambient selectors.
Related changes: [PR #10695](https://github.com/NVIDIA/NemoClaw/pull/10695), [PR #10814](https://github.com/NVIDIA/NemoClaw/pull/10814), [PR #10815](https://github.com/NVIDIA/NemoClaw/pull/10815), and [PR #10810](https://github.com/NVIDIA/NemoClaw/pull/10810).
For more information, refer to [Understand Gateway Lifecycle Control](/user-guide/openclaw/manage-sandboxes/configure-sandboxes/understand-gateway-lifecycle-control) and [About Managed MCP Servers](/user-guide/openclaw/manage-sandboxes/mcp-servers/about-managed-mcp-servers).
Expand Down
10 changes: 8 additions & 2 deletions docs/get-started/quickstart-hermes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,14 @@ Use these details when your first-run path needs more control.
The onboard flow starts both port forwards automatically.
For a new sandbox, NemoClaw reserves the selected dashboard loopback port through sandbox preparation and creation.
If another listener claims the port before NemoClaw binds the reservation, NemoClaw selects another port before changing sandbox resources.
If OpenShell returns the `sandbox is not ready` response, NemoClaw waits 5 seconds and retries the affected forward up to 12 times.
The readiness-specific delays total at most 1 minute and preserve the existing sandbox and selected host port.
NemoClaw waits up to 90 seconds for each forward to bind under its spawned OpenShell process.
It then verifies listener ownership through OpenShell's first post-bind sandbox check.
If OpenShell reports that the sandbox is still completing its readiness handoff, NemoClaw waits 5 seconds and retries up to 12 times.
An exact forward process that exits for another reason receives one retry.
If the process remains unbound at the deadline, NemoClaw stops that exact process and confirms its exit before retrying.
The ordinary two-attempt sequence can take about 3 minutes and 15 seconds for each forward, including listener stability, cleanup, and retry delays; readiness-handoff retries use a separate one-minute delay budget.
NemoClaw accepts each forward only when its spawned process owns the listener.
It does not adopt an unrelated listener or start another forward while it cannot confirm that the prior process stopped.
NemoClaw releases the reservation immediately before OpenShell starts the dashboard forward.
If forwarding then fails, onboarding removes the new sandbox and tells you to resolve the reported error before retrying.
The Hermes dashboard URL does not include an OpenClaw `#token=` fragment.
Expand Down
10 changes: 8 additions & 2 deletions docs/get-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,14 @@ Use these details when your first-run path needs more control.
When that port is occupied, NemoClaw uses the next free dashboard port, such as `18790`, and includes the port in the URL.
For a new sandbox, NemoClaw reserves the selected loopback port through sandbox preparation and creation.
If another listener claims the port before NemoClaw binds the reservation, NemoClaw selects another port before changing sandbox resources.
If OpenShell returns the `sandbox is not ready` response, NemoClaw waits 5 seconds and retries the dashboard forward up to 12 times.
The readiness-specific delays total at most 1 minute and preserve the existing sandbox and selected port.
NemoClaw waits up to 90 seconds for the dashboard forward to bind under the spawned OpenShell process.
It then verifies listener ownership through OpenShell's first post-bind sandbox check.
If OpenShell reports that the sandbox is still completing its readiness handoff, NemoClaw waits 5 seconds and retries up to 12 times.
An exact forward process that exits for another reason receives one retry.
If the process remains unbound at the deadline, NemoClaw stops that exact process and confirms its exit before retrying.
The ordinary two-attempt sequence can take about 3 minutes and 15 seconds, including listener stability, cleanup, and retry delays; readiness-handoff retries use a separate one-minute delay budget.
NemoClaw accepts the forward only when the spawned process owns the listener.
It does not adopt an unrelated listener or start another forward while it cannot confirm that the prior process stopped.
NemoClaw releases the reservation immediately before OpenShell starts the dashboard forward.
If forwarding then fails, onboarding removes the new sandbox and tells you to resolve the reported error before retrying.
The installation transcript does not print the gateway token.
Expand Down
12 changes: 10 additions & 2 deletions docs/manage-sandboxes/recover-rebuild-sandboxes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ If `$$nemoclaw <name> status` reports the sandbox container or gateway is not ru
$$nemoclaw <sandbox-name> recover
```

The command repairs a stopped in-sandbox gateway and re-establishes the dashboard port-forward in one step. It is idempotent and safe to script. If the gateway is already healthy, `recover` exits after the probe and does not restart it. If the host forward is already active, recovery accepts it only after OpenShell ownership is reconciled and the local endpoint is reachable.
The command repairs a stopped in-sandbox gateway and re-establishes the dashboard port-forward in one step.
It is idempotent and safe to script.
If the gateway is already healthy, `recover` exits after the probe and does not restart it.
If the host forward is already active, recovery accepts it only after OpenShell ownership is reconciled and the local endpoint is reachable.
If recovery launches a new forward, it accepts the forward after the OpenShell process owns the listener through the startup stability window without opening a connection to the endpoint.

Use `gateway restart` when you intentionally need a supported OpenClaw gateway to reload runtime configuration or plugins.

Expand All @@ -87,7 +91,11 @@ If `$$nemoclaw <name> status` reports the sandbox container or Hermes gateway is
$$nemoclaw <sandbox-name> recover
```

The command repairs a stopped in-sandbox gateway and re-establishes the dashboard port-forward in one step. It is idempotent and safe to script. If the gateway is already healthy, `recover` does not restart it. If the host forward is already active, recovery accepts it only after OpenShell ownership is reconciled and the local endpoint is reachable.
The command repairs a stopped in-sandbox gateway and re-establishes the dashboard port-forward in one step.
It is idempotent and safe to script.
If the gateway is already healthy, `recover` does not restart it.
If the host forward is already active, recovery accepts it only after OpenShell ownership is reconciled and the local endpoint is reachable.
For a standard Hermes sandbox, if recovery launches a new forward, it accepts the forward after the OpenShell process owns the listener through the startup stability window without opening a connection to the endpoint.

Before it repairs the gateway, `recover` checks for a NemoClaw cron restore gate or release recovery record left by an interrupted rebuild. The gate continues to block new Hermes turns and cron dispatch across gateway and container restarts in the same sandbox. If release rollback could not restore the gate, `recover` uses the root-owned recovery record to reacquire it before gateway repair can start dispatch. After gateway repair, `recover` waits for active agent work to finish and validates the restored cron jobs and scripts. It clears NemoClaw-owned gate and release recovery state only after validation succeeds. If no independent operator drain exists, successful recovery prints `Hermes cron dispatch resumed after restored jobs and scripts were validated.` If an operator drain exists, recovery prints `Hermes cron restore gate cleared; the independent operator drain remains active.` The command does not own or clear the Hermes operator drain, so new Hermes turns and cron dispatch remain blocked while that drain is active. If gate reacquisition or cron validation fails, `recover` exits nonzero and retains the recovery state for another attempt.

Expand Down
36 changes: 35 additions & 1 deletion src/lib/actions/sandbox/forward-recovery-declared-ports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe("ensureDeclaredAgentForwardPortsHealthy", { timeout: 30_000 }, () => {
expect(ensureDeclaredAgentForwardPortsHealthy("beta", 18790)).toBe(true);
expect(mocks.launchForwardService).toHaveBeenCalledWith(
expect.objectContaining({ localPort: 8643, targetPort: 8643 }),
{},
{ describeState: expect.any(Function) },
);
});

Expand Down Expand Up @@ -160,6 +160,7 @@ describe("ensureDeclaredAgentForwardPortsHealthy", { timeout: 30_000 }, () => {
workspace: runtimeSelection.workspace,
}),
{
describeState: expect.any(Function),
sourceEnvironment: expect.objectContaining({
OPENSHELL_GATEWAY: runtimeSelection.gatewayName,
OPENSHELL_WORKSPACE: runtimeSelection.workspace,
Expand All @@ -175,6 +176,39 @@ describe("ensureDeclaredAgentForwardPortsHealthy", { timeout: 30_000 }, () => {
expect(sourceEnvironment).not.toHaveProperty("OPENSHELL_TOKEN");
});

it("reports bounded selected-gateway state after a forward launch failure (#11084)", async () => {
mocks.isLocalForwardReachable.mockReturnValue(false);
mocks.getSandbox.mockReturnValue({ agent: "hermes", dashboardPort: 18790 });
mocks.captureOpenshell
.mockReturnValueOnce(forwardList([]))
.mockReturnValueOnce(
forwardList(["beta 127.0.0.1 18790 101 failed OPENSHELL_TOKEN=opaque-test-token"]),
);
mocks.launchForwardService.mockImplementation((_target, options) => {
expect(options?.describeState?.()).toBe("matching forward is malformed");
throw new Error("fixture forward launch failure");
});
Comment thread
prekshivyas marked this conversation as resolved.
Resolved
const runtimeSelection = {
gatewayName: "nemoclaw-19080",
workspace: "review-workspace",
localTlsDir: "/authority/tls",
};
const { ensureSandboxPortForward } = await import("./forward-recovery");

expect(ensureSandboxPortForward("beta", { runtimeSelection })).toBe(false);
expect(mocks.captureOpenshell).toHaveBeenLastCalledWith(
["forward", "list", "--gateway", runtimeSelection.gatewayName],
expect.objectContaining({
env: expect.objectContaining({
OPENSHELL_GATEWAY: runtimeSelection.gatewayName,
OPENSHELL_WORKSPACE: runtimeSelection.workspace,
OPENSHELL_LOCAL_TLS_DIR: runtimeSelection.localTlsDir,
}),
replaceEnv: true,
}),
);
});

it("keeps the default API port for a sandbox registered without one (#8543)", async () => {
mocks.getSandbox.mockReturnValue({ agent: "hermes", dashboardPort: 18789 });
mocks.captureOpenshell.mockReturnValue(forwardList([]));
Expand Down
49 changes: 45 additions & 4 deletions src/lib/actions/sandbox/forward-recovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,30 @@ function isValidPort(value: unknown): value is number {
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 65535;
}

function describeForwardListEntry(output: string, sandboxName: string, port: number): string {
const matchingLine = output
.replace(/\x1B\[[0-?]*[ -/]*[@-~]/gu, "")
.split("\n")
.map((line) => line.trim())
.find((line) => {
const columns = line.split(/\s+/u);
return columns[0] === sandboxName && columns[2] === String(port);
});
if (!matchingLine) return "no matching forward";
const [sandbox, bind, listedPort, pid, status, ...extra] = matchingLine.split(/\s+/u);
if (
extra.length > 0 ||
sandbox !== sandboxName ||
(bind !== "127.0.0.1" && bind !== "0.0.0.0") ||
listedPort !== String(port) ||
!/^\d+$/u.test(pid ?? "") ||
!/^[a-z][a-z-]{0,31}$/iu.test(status ?? "")
) {
return "matching forward is malformed";
}
return `${sandbox} ${bind} ${listedPort} ${pid} ${status}`;
}

export function resolveSandboxDashboardPort(
sandboxName: string,
deps: SandboxPortDeps = {},
Expand Down Expand Up @@ -301,7 +325,8 @@ export function teardownSandboxDashboardForward(
* Re-establish the dashboard port forward to the sandbox.
* Uses the recorded dashboard port when available, including custom ports for
* non-OpenClaw agents, then falls back to the active agent's declared port.
* Returns true when the detached OpenShell service makes the port reachable.
* Returns true when an existing forward is reachable or a newly launched
* OpenShell service owns the listener through its startup stability window.
*/
export function ensureSandboxPortForward(
sandboxName: string,
Expand Down Expand Up @@ -430,9 +455,25 @@ export function ensureSandboxPortForwardForPort(
expectedBind ?? (forwardTarget.startsWith("0.0.0.0:") ? "0.0.0.0" : "127.0.0.1"),
runtimeSelection?.workspace ?? "default",
),
runtimeSelection
? { sourceEnvironment: buildSelectedOpenShellSubprocessEnv(runtimeSelection) }
: {},
{
describeState: () => {
const listed = captureOpenshell(
["forward", "list", "--gateway", gatewayName],
withSelectedOpenShellCommandOptions(
{
ignoreError: true,
includeStreams: true,
timeout: OPENSHELL_PROBE_TIMEOUT_MS,
},
runtimeSelection,
),
);
return describeForwardListEntry(listed.output, sandboxName, port);
},
...(runtimeSelection
? { sourceEnvironment: buildSelectedOpenShellSubprocessEnv(runtimeSelection) }
: {}),
},
);
return acceptSuccessfulForward();
} catch (error) {
Expand Down
Loading
Loading