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
4 changes: 2 additions & 2 deletions lib/mcp/tools/sandbox/registerRunSandboxCommandTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const runSandboxCommandSchema = z.object({
.string()
.optional()
.describe(
'A prompt to pass to OpenCode. Runs `opencode run "<prompt>"` in the sandbox. Cannot be used with command.',
'A prompt to pass to OpenClaw. Runs `openclaw agent --agent main --message "<prompt>"` in the sandbox. Cannot be used with command.',
),
account_id: z
.string()
Expand All @@ -40,7 +40,7 @@ export function registerRunSandboxCommandTool(server: McpServer): void {
"run_sandbox_command",
{
description:
'Create a sandbox and run a command or OpenCode prompt in it. Use prompt to run `opencode run "<prompt>"`. Returns the sandbox ID and a run ID to track progress.',
'Create a sandbox and run a command or OpenClaw prompt in it. Use prompt to run `openclaw agent --agent main --message "<prompt>"`. Returns the sandbox ID and a run ID to track progress.',
inputSchema: runSandboxCommandSchema,
},
async (args, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => {
Expand Down
6 changes: 3 additions & 3 deletions lib/sandbox/__tests__/processCreateSandbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("processCreateSandbox", () => {
});
});

it("converts prompt to opencode run command", async () => {
it("converts prompt to openclaw agent command", async () => {
vi.mocked(selectAccountSnapshots).mockResolvedValue([]);
vi.mocked(createSandbox).mockResolvedValue({
sandboxId: "sbx_123",
Expand Down Expand Up @@ -215,8 +215,8 @@ describe("processCreateSandbox", () => {
runId: "run_prompt123",
});
expect(triggerRunSandboxCommand).toHaveBeenCalledWith({
command: "opencode",
args: ["run", "create a hello world index.html"],
command: "openclaw",
args: ["agent", "--agent", "main", "--message", "create a hello world index.html"],
cwd: undefined,
sandboxId: "sbx_123",
accountId: "acc_123",
Expand Down
6 changes: 3 additions & 3 deletions lib/sandbox/processCreateSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export async function processCreateSandbox(
): Promise<ProcessCreateSandboxResult> {
const { accountId, prompt, cwd } = input;

// Convert prompt shortcut to opencode command
const command = prompt ? "opencode" : input.command;
const args = prompt ? ["run", prompt] : input.args;
// Convert prompt shortcut to openclaw agent command
const command = prompt ? "openclaw" : input.command;
const args = prompt ? ["agent", "--agent", "main", "--message", prompt] : input.args;

// Get account's most recent snapshot if available
const accountSnapshots = await selectAccountSnapshots(accountId);
Expand Down