Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/commands/sandbox/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,14 @@ describe("SandboxAgentCommand oclif parse path", () => {
await SandboxAgentCommand.run(["--help"], rootDir);
expect(runAgentPassthroughMock).not.toHaveBeenCalled();
});

it("prints wrapper help and does not dispatch on a bare no-args invocation (#5658)", async () => {
// `nemoclaw <name> agent` with no further args cannot succeed in-sandbox
// (openclaw agent requires -m), so short-circuit to wrapper help locally
// instead of paying sandbox-exec latency to surface an upstream error.
await SandboxAgentCommand.run(["alpha"], rootDir);
expect(runAgentPassthroughMock).not.toHaveBeenCalled();
const help = logSpy.mock.calls.map((c: unknown[]) => String(c[0])).join("\n");
expect(help).toMatch(/openclaw agent/);
});
});
6 changes: 5 additions & 1 deletion src/commands/sandbox/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default class SandboxAgentCommand extends NemoClawCommand {
printAgentPassthroughHelp();
return;
}
if (hasAgentPassthroughHelpToken(extraArgs)) {
// A bare `<name> agent` with no further args cannot succeed in-sandbox
// (`openclaw agent` requires `-m`), so treat it like a help request and
// print the wrapper summary locally instead of paying sandbox-exec latency
// only to surface an upstream "Missing required option -m" error (#5658).
if (extraArgs.length === 0 || hasAgentPassthroughHelpToken(extraArgs)) {
printAgentPassthroughHelp();
return;
}
Expand Down