Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0d9fa1e
refactor(openshell): remove version probe SSH
ericksoa Jul 13, 2026
c690f07
refactor(openshell): remove diagnostic SSH transport
ericksoa Jul 13, 2026
cbdeea7
test(upgrade): replace SSH version fixtures with exec
ericksoa Jul 13, 2026
f36fc05
chore(stack): carry rebuild probe updates
ericksoa Jul 13, 2026
521a977
chore(stack): carry diagnostic transport updates
ericksoa Jul 13, 2026
811f02f
chore(stack): carry automated review fixes
ericksoa Jul 14, 2026
f461898
chore(stack): carry automated review fixes
ericksoa Jul 14, 2026
01c643e
chore(stack): carry formatted review fixture
ericksoa Jul 14, 2026
931a44f
chore(stack): carry formatted review fixture
ericksoa Jul 14, 2026
cbf5071
chore(stack): carry current main
ericksoa Jul 14, 2026
5d444d9
chore(stack): carry current main
ericksoa Jul 14, 2026
88d54da
chore(stack): pair protocol with its first consumer
ericksoa Jul 14, 2026
084bf89
chore(stack): pair protocol with its first consumer
ericksoa Jul 14, 2026
6f135a2
chore(stack): carry IPv6 loopback coverage
ericksoa Jul 14, 2026
95dafdc
chore(stack): carry IPv6 loopback coverage
ericksoa Jul 14, 2026
db66f65
chore(stack): align with externally advanced base
ericksoa Jul 14, 2026
830c568
chore(stack): align with externally advanced base
ericksoa Jul 14, 2026
a689db3
chore(stack): follow consolidated gRPC foundation
ericksoa Jul 14, 2026
49f9a3d
chore(stack): follow consolidated gRPC foundation
ericksoa Jul 14, 2026
9e45995
chore(stack): follow current main
ericksoa Jul 14, 2026
1f26daf
chore(stack): follow current main
ericksoa Jul 14, 2026
7545c04
chore(stack): follow stdin regression coverage
ericksoa Jul 14, 2026
32f0d05
chore(stack): follow stdin regression coverage
ericksoa Jul 14, 2026
bba0200
chore(stack): follow documented fallback boundary
ericksoa Jul 14, 2026
3180110
chore(stack): follow documented fallback boundary
ericksoa Jul 14, 2026
ca5a311
chore(stack): follow reviewed read-only boundary
ericksoa Jul 14, 2026
99fc80e
chore(stack): follow reviewed read-only boundary
ericksoa Jul 14, 2026
069eec9
chore(stack): follow skill retry guardrail fix
ericksoa Jul 14, 2026
a804ac2
chore(stack): follow skill retry guardrail fix
ericksoa Jul 14, 2026
3c4055d
chore(stack): follow fail-closed skill probe
ericksoa Jul 14, 2026
280e43b
chore(stack): follow fail-closed skill probe
ericksoa Jul 14, 2026
e4f1bc0
docs(openshell): include debug fallback caller
ericksoa Jul 14, 2026
ca5b5ef
chore(stack): follow debug fallback contract
ericksoa Jul 14, 2026
d171233
test(debug): cover async command completion
ericksoa Jul 14, 2026
72d2053
chore(stack): follow async debug coverage
ericksoa Jul 14, 2026
18c9972
fix(openshell): retry failed read-only gRPC streams
ericksoa Jul 14, 2026
863efc6
fix(openshell): scope CLI fallback to gateway
ericksoa Jul 14, 2026
dd91805
test(openshell): scope version probe stubs to gateway
ericksoa Jul 14, 2026
9c1abfc
fix(debug): preserve sandbox transport failures
ericksoa Jul 14, 2026
3d6d055
chore(stack): follow guarded rebuild transport
ericksoa Jul 14, 2026
d071ed4
fix(debug): redact combined sandbox streams
ericksoa Jul 14, 2026
3c6239d
chore(stack): follow endpoint-safe rebuild transport
ericksoa Jul 14, 2026
a9297cb
test(checks): review debug gRPC fallback
ericksoa Jul 14, 2026
82ce753
chore(stack): follow hardened rebuild transport
ericksoa Jul 14, 2026
1a00cca
chore(stack): follow corrected debug transport
ericksoa Jul 14, 2026
078175b
test(sandbox): align empty version cache state
ericksoa Jul 14, 2026
e722d26
Merge commit '39ce3ec491f29c0eedf0844e4836c410b3eb548c' into refactor…
ericksoa Jul 14, 2026
d240189
Merge commit 'e722d26f36adef78bcdf1389d737c326eb233070' into refactor…
ericksoa Jul 14, 2026
57b096e
fix(cli): redact debug gateway resolution errors
ericksoa Jul 14, 2026
4712ec7
Merge commit '57b096ea3d560dd4e3c15fdbcfa4767b25ac38b0' into refactor…
ericksoa Jul 14, 2026
074ff36
test(rebuild): cover version probe cache exception
ericksoa Jul 14, 2026
f362df3
test(openshell): complete binary runtime mocks
ericksoa Jul 14, 2026
d346b90
fix(openshell): accept proto3 zero exit status
ericksoa Jul 14, 2026
7279d8d
feat(openshell): preserve binary exec output (#6800)
ericksoa Jul 20, 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: 4 additions & 6 deletions scripts/checks/legacy-sandbox-transports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,21 @@ const REVIEWED_SITE_TUPLES = [
["src/lib/adapters/docker/container.ts", "docker-exec-command", 1],
["src/lib/adapters/openshell/client.ts", "openshell-ssh-config", 1],
["src/lib/adapters/openshell/runtime.ts", "openshell-ssh-config", 1],
["src/lib/diagnostics/debug.ts", "openshell-ssh-config", 1],
["src/lib/diagnostics/debug.ts", "ssh-command", 4],
["src/lib/diagnostics/debug.ts", "grpc-cli-read-only-fallback", 1],
["src/lib/onboard.ts", "docker-exec-builder", 1],
["src/lib/resources-cmd.ts", "docker-exec-command", 1],
["src/lib/sandbox/config.ts", "privileged-sandbox-exec", 2],
["src/lib/sandbox/version.ts", "openshell-ssh-config", 1],
["src/lib/sandbox/version.ts", "ssh-command", 1],
["src/lib/sandbox/version.ts", "ssh-temp-config", 1],
["src/lib/sandbox/version.ts", "grpc-cli-read-only-fallback", 1],
["src/lib/share-command-deps.ts", "openshell-ssh-config", 1],
["src/lib/share-command.ts", "sshfs-command", 1],
["src/lib/shields/index.ts", "privileged-sandbox-exec", 4],
["src/lib/shields/mutable-config-repair.ts", "privileged-sandbox-exec", 2],
["src/lib/state/openclaw-config-restore-input.ts", "ssh-command", 1],
["src/lib/state/openclaw-plugin-restore.ts", "ssh-command", 2],
["src/lib/state/openclaw-plugin-restore.ts", "ssh-temp-config", 1],
["src/lib/state/sandbox.ts", "grpc-cli-read-only-fallback", 1],
["src/lib/state/sandbox.ts", "openshell-ssh-config", 1],
["src/lib/state/sandbox.ts", "ssh-command", 8],
["src/lib/state/sandbox.ts", "ssh-command", 7],
["src/lib/state/sandbox.ts", "ssh-temp-config", 2],
["src/lib/state/state-file-restore.ts", "ssh-command", 1],
["src/lib/state/user-managed-files-probe.ts", "grpc-cli-read-only-fallback", 1],
Expand Down
17 changes: 8 additions & 9 deletions src/commands/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// SPDX-License-Identifier: Apache-2.0

import { Flags } from "@oclif/core";
import { NemoClawCommand } from "../lib/cli/nemoclaw-oclif-command";

import type { CaptureOpenshellResult } from "../lib/adapters/openshell/client";
import { captureOpenshellCommand } from "../lib/adapters/openshell/client";
import { resolveOpenshell } from "../lib/adapters/openshell/resolve";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../lib/adapters/openshell/timeouts";
import { CLI_NAME } from "../lib/cli/branding";
import { runDebug } from "../lib/diagnostics/debug";
import { NemoClawCommand } from "../lib/cli/nemoclaw-oclif-command";
import type { DebugOptions } from "../lib/diagnostics/debug";
import { runDebug } from "../lib/diagnostics/debug";
import type { RunDebugCommandDeps } from "../lib/diagnostics/debug-command";
import { runDebugCommandWithOptions } from "../lib/diagnostics/debug-command";
import type { CaptureOpenshellResult } from "../lib/adapters/openshell/client";
import { captureOpenshellCommand } from "../lib/adapters/openshell/client";
import { OPENSHELL_PROBE_TIMEOUT_MS } from "../lib/adapters/openshell/timeouts";
import * as registry from "../lib/state/registry";
import { resolveOpenshell } from "../lib/adapters/openshell/resolve";
import { parseLiveSandboxNames } from "../lib/runtime-recovery";
import * as registry from "../lib/state/registry";

const useColor = !process.env.NO_COLOR && !!process.stderr.isTTY;
const B = useColor ? "\x1b[1m" : "";
Expand Down Expand Up @@ -99,6 +98,6 @@ export default class DebugCliCommand extends NemoClawCommand {
if (flags.quick) options.quick = true;
if (flags.output) options.output = flags.output;
if (flags.sandbox) options.sandboxName = flags.sandbox;
runDebugCommandWithOptions(options, buildDebugCommandDeps(this.config.root));
await runDebugCommandWithOptions(options, buildDebugCommandDeps(this.config.root));
}
}
9 changes: 8 additions & 1 deletion src/commands/simple-global-oclif-adapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mocks = vi.hoisted(() => {
captureOpenshellCommand: vi.fn(() => ({ status: 0, output: "alpha\n" })),
listSandboxes: vi.fn(() => ({ sandboxes: [] })),
resolveOpenshell: vi.fn(() => "/usr/bin/openshell"),
runDebugCommandWithOptions: vi.fn(),
runDebugCommandWithOptions: vi.fn().mockResolvedValue(undefined),
runDeployAction: vi.fn().mockResolvedValue(undefined),
runDashboardUrlCommand: vi.fn(() => undefined),
runGatewayTokenCommand: vi.fn(() => undefined),
Expand Down Expand Up @@ -145,6 +145,13 @@ describe("simple global oclif adapters", () => {
expect(configure).not.toHaveBeenCalledWith({ debug: false, quiet: true });
});

it("propagates a rejected debug action through the CLI boundary", async () => {
const failure = new Error("diagnostic collection failed");
mocks.runDebugCommandWithOptions.mockRejectedValueOnce(failure);

await expect(DebugCliCommand.run(["--quick"], rootDir)).rejects.toBe(failure);
});

it("builds debug defaults from the sandbox registry and OpenShell liveness", async () => {
mocks.listSandboxes.mockReturnValue({
defaultSandbox: "alpha",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/maintenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function backupAll(): Promise<void> {
try {
result = startedForBackup
? await backupStartedSandboxState(sb.name)
: sandboxState.backupSandboxState(sb.name);
: await sandboxState.backupSandboxState(sb.name);
} catch (err: unknown) {
// Source-of-truth review (#5734 / #5819):
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { SandboxEntry } from "../../state/registry";

vi.mock("../../adapters/openshell/runtime", () => ({
captureOpenshell: vi.fn(() => ({ status: 0, output: "" })),
captureOpenshellBinary: vi.fn(),
getOpenshellBinary: vi.fn(() => "openshell"),
runOpenshell: vi.fn(() => ({ status: 0 })),
}));
Expand Down
1 change: 1 addition & 0 deletions src/lib/actions/sandbox/connect-route-repair.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { SandboxEntry } from "../../state/registry";

vi.mock("../../adapters/openshell/runtime", () => ({
captureOpenshell: vi.fn(() => ({ status: 0, output: "" })),
captureOpenshellBinary: vi.fn(),
getOpenshellBinary: vi.fn(() => "openshell"),
runOpenshell: vi.fn(() => ({ status: 0 })),
}));
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/sandbox/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ export async function connectSandbox(

// Version staleness check — warn but don't block
try {
const versionCheck = sandboxVersion.checkAgentVersion(sandboxName);
const versionCheck = await sandboxVersion.checkAgentVersion(sandboxName);
if (versionCheck.isStale) {
for (const line of sandboxVersion.formatStalenessWarning(sandboxName, versionCheck)) {
console.error(line);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/sandbox/doctor-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function createDoctorHarness(): {
});
vi.spyOn(agentRuntime, "getSessionAgent").mockReturnValue({ name: "openclaw" });
vi.spyOn(agentRuntime, "getAgentDisplayName").mockReturnValue("OpenClaw");
vi.spyOn(sandboxVersion, "checkAgentVersion").mockReturnValue({
vi.spyOn(sandboxVersion, "checkAgentVersion").mockResolvedValue({
sandboxVersion: "0.1.0",
expectedVersion: "0.2.0",
isStale: true,
Expand Down
12 changes: 6 additions & 6 deletions src/lib/actions/sandbox/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ function resolveInferenceRoute(
};
}

function agentVersionDoctorCheck(sandboxName: string): DoctorCheck {
async function agentVersionDoctorCheck(sandboxName: string): Promise<DoctorCheck> {
try {
const version = sandboxVersion.checkAgentVersion(sandboxName);
const version = await sandboxVersion.checkAgentVersion(sandboxName);
const agentName = agentRuntime.getAgentDisplayName(agentRuntime.getSessionAgent(sandboxName));
if (version.isStale) {
return {
Expand Down Expand Up @@ -352,14 +352,14 @@ function shieldsDoctorCheck(sandboxName: string): DoctorCheck {
};
}

function collectRegisteredSandboxChecks(
async function collectRegisteredSandboxChecks(
sandboxName: string,
sb: SandboxEntry | null | undefined,
wantsFix: boolean,
sandboxReachable: boolean,
): DoctorCheck[] {
): Promise<DoctorCheck[]> {
if (!sb) return [];
const checks = [agentVersionDoctorCheck(sandboxName), shieldsDoctorCheck(sandboxName)];
const checks = [await agentVersionDoctorCheck(sandboxName), shieldsDoctorCheck(sandboxName)];
const permsCheck = buildConfigPermsCheck(sandboxName, wantsFix, {
inspect: shields.inspectMutableConfigPerms,
repair: shields.repairMutableConfigPerms,
Expand Down Expand Up @@ -402,7 +402,7 @@ async function collectDoctorChecks(
...gateway.checks,
...sandbox.checks,
...(await collectInferenceChecks(sandboxName, route, sandbox.reachable)),
...collectRegisteredSandboxChecks(sandboxName, sb, intent.wantsFix, sandbox.reachable),
...(await collectRegisteredSandboxChecks(sandboxName, sb, intent.wantsFix, sandbox.reachable)),
...collectToolScopeChecks(sandboxName, sb, sandbox.reachable, intent.wantsFix),
ollamaDoctorCheck(route.provider),
cloudflaredDoctorCheck(sandboxName),
Expand Down
1 change: 1 addition & 0 deletions src/lib/actions/sandbox/process-recovery-temp-ssh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vi.mock("node:child_process", async (importOriginal) => {

vi.mock("../../adapters/openshell/runtime", () => ({
captureOpenshell: vi.fn(),
captureOpenshellBinary: vi.fn(),
captureOpenshellForStatus: vi.fn(),
captureSandboxSshConfig,
getOpenshellBinary: vi.fn(() => "openshell"),
Expand Down
28 changes: 14 additions & 14 deletions src/lib/actions/sandbox/rebuild-backup-phase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ describe("rebuild web-search policy normalization", () => {
).toEqual(["npm"]);
});

it("keeps a finalized custom-only built-in selection empty instead of resetting it", () => {
const result = runRebuildBackupPhase({
it("keeps a finalized custom-only built-in selection empty instead of resetting it", async () => {
const result = await runRebuildBackupPhase({
sandboxName: "alpha",
sandboxEntry: {
name: "alpha",
Expand Down Expand Up @@ -94,18 +94,18 @@ describe("rebuild web-search policy normalization", () => {
expect(result?.backupWasForceSkipped).toBe(false);
});

it("records when --force skips a total backup failure", () => {
it("records when --force skips a total backup failure", async () => {
vi.spyOn(console, "warn").mockImplementation(() => undefined);
vi.spyOn(console, "log").mockImplementation(() => undefined);
vi.spyOn(sandboxState, "backupSandboxState").mockReturnValue({
vi.spyOn(sandboxState, "backupSandboxState").mockResolvedValue({
success: false,
backedUpDirs: [],
backedUpFiles: [],
failedDirs: [".openclaw"],
failedFiles: ["openclaw.json"],
});

const result = runRebuildBackupPhase({
const result = await runRebuildBackupPhase({
sandboxName: "alpha",
sandboxEntry: { name: "alpha", agent: "openclaw", policies: [] },
staleRecovery: false,
Expand Down Expand Up @@ -227,12 +227,12 @@ describe("custom OpenClaw plugin provenance rebuild guard (#6108)", () => {
} as RebuildBackupPhaseInput;
}

it("blocks a live custom image with missing registry provenance before backup", () => {
it("blocks a live custom image with missing registry provenance before backup", async () => {
const backupStateForRebuild = vi.fn();
const input = customOpenClawInput();
const errorLog = vi.spyOn(console, "error").mockImplementation(() => undefined);

expect(() => runRebuildBackupPhase(input, backupStateForRebuild)).toThrow(
await expect(runRebuildBackupPhase(input, backupStateForRebuild)).rejects.toThrow(
"Custom-image OpenClaw plugin provenance is unavailable.",
);

Expand All @@ -245,17 +245,17 @@ describe("custom OpenClaw plugin provenance rebuild guard (#6108)", () => {
errorLog.mockRestore();
});

it("uses a marked prepared manifest when registry provenance is missing", () => {
it("uses a marked prepared manifest when registry provenance is missing", async () => {
const backupStateForRebuild = vi.fn();
const input = customOpenClawInput({ preparedRecoveryManifest: completeMarkedManifest });

const result = runRebuildBackupPhase(input, backupStateForRebuild);
const result = await runRebuildBackupPhase(input, backupStateForRebuild);

expect(result?.backupManifest).toBe(completeMarkedManifest);
expect(backupStateForRebuild).not.toHaveBeenCalled();
});

it("blocks an unmarked legacy prepared manifest before deletion", () => {
it("blocks an unmarked legacy prepared manifest before deletion", async () => {
const backupStateForRebuild = vi.fn();
const input = customOpenClawInput({
preparedRecoveryManifest: {
Expand All @@ -266,15 +266,15 @@ describe("custom OpenClaw plugin provenance rebuild guard (#6108)", () => {
},
});

expect(() => runRebuildBackupPhase(input, backupStateForRebuild)).toThrow(
await expect(runRebuildBackupPhase(input, backupStateForRebuild)).rejects.toThrow(
"Custom-image OpenClaw plugin provenance is unavailable.",
);

expect(backupStateForRebuild).not.toHaveBeenCalled();
});

it("revalidates a newly generated backup manifest before deletion", () => {
const backupStateForRebuild = vi.fn(() => ({
it("revalidates a newly generated backup manifest before deletion", async () => {
const backupStateForRebuild = vi.fn(async () => ({
agentType: "openclaw",
dir: "/sandbox/.openclaw",
backupPath: "/tmp/incomplete-custom-openclaw-backup",
Expand All @@ -289,7 +289,7 @@ describe("custom OpenClaw plugin provenance rebuild guard (#6108)", () => {
},
});

expect(() => runRebuildBackupPhase(input, backupStateForRebuild as never)).toThrow(
await expect(runRebuildBackupPhase(input, backupStateForRebuild as never)).rejects.toThrow(
"Custom-image OpenClaw plugin provenance is unavailable.",
);

Expand Down
10 changes: 5 additions & 5 deletions src/lib/actions/sandbox/rebuild-backup-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { RebuildBail, RebuildLog } from "./rebuild-credential-preflight";
import { backupSandboxStateForRebuild, type RebuildSandboxEntry } from "./rebuild-flow-helpers";

export type RebuildBackupManifest = Exclude<
ReturnType<typeof backupSandboxStateForRebuild>,
Awaited<ReturnType<typeof backupSandboxStateForRebuild>>,
undefined
>;

Expand Down Expand Up @@ -144,10 +144,10 @@ export function normalizeRebuildTargetPolicyPresets(
);
}

export function runRebuildBackupPhase(
export async function runRebuildBackupPhase(
input: RebuildBackupPhaseInput,
backupStateForRebuild: typeof backupSandboxStateForRebuild = backupSandboxStateForRebuild,
): RebuildBackupPhaseResult | null {
): Promise<RebuildBackupPhaseResult | null> {
const customOpenClaw =
Boolean(input.sandboxEntry.fromDockerfile) &&
(!input.sandboxEntry.agent || input.sandboxEntry.agent === "openclaw");
Expand All @@ -174,15 +174,15 @@ export function runRebuildBackupPhase(
}
const backupManifest =
preparedRecoveryManifest ??
backupStateForRebuild(
(await backupStateForRebuild(
input.sandboxName,
input.sandboxEntry,
input.staleRecovery,
input.log,
input.relockShieldsIfNeeded,
input.bail,
{ force: input.force },
);
));
if (backupManifest === undefined) return null;
if (
backupManifest &&
Expand Down
Loading
Loading