From 1eb1a33f3748b691933da1846672dd344bb3bebd Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 16 Feb 2026 12:31:46 +0100 Subject: [PATCH] chore: remove --open option (not useful for remote sessions) --- src/auto-reply/commands-registry.data.ts | 6 ----- .../reply/commands-export-session.ts | 25 +++---------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/auto-reply/commands-registry.data.ts b/src/auto-reply/commands-registry.data.ts index 462fa7dfade..08ee6e0ffa6 100644 --- a/src/auto-reply/commands-registry.data.ts +++ b/src/auto-reply/commands-registry.data.ts @@ -219,12 +219,6 @@ function buildChatCommands(): ChatCommandDefinition[] { type: "string", required: false, }, - { - name: "open", - description: "Open in browser after export", - type: "boolean", - required: false, - }, ], }), defineChatCommand({ diff --git a/src/auto-reply/reply/commands-export-session.ts b/src/auto-reply/reply/commands-export-session.ts index 86e66fbce30..2b5d3d01727 100644 --- a/src/auto-reply/reply/commands-export-session.ts +++ b/src/auto-reply/reply/commands-export-session.ts @@ -247,23 +247,15 @@ async function resolveFullSystemPrompt(params: HandleCommandsParams): Promise<{ return { systemPrompt, tools }; } -function parseExportArgs(commandBodyNormalized: string): { outputPath?: string; open?: boolean } { +function parseExportArgs(commandBodyNormalized: string): { outputPath?: string } { const normalized = commandBodyNormalized.trim(); if (normalized === "/export-session" || normalized === "/export") { return {}; } const args = normalized.replace(/^\/(export-session|export)\s*/, "").trim(); - const parts = args.split(/\s+/); - let outputPath: string | undefined; - let open = false; - for (const part of parts) { - if (part === "--open" || part === "-o") { - open = true; - } else if (!part.startsWith("-") && !outputPath) { - outputPath = part; - } - } - return { outputPath, open }; + // First non-flag argument is the output path + const outputPath = args.split(/\s+/).find((part) => !part.startsWith("-")); + return { outputPath }; } export async function buildExportSessionReply(params: HandleCommandsParams): Promise { @@ -339,13 +331,6 @@ export async function buildExportSessionReply(params: HandleCommandsParams): Pro // 7. Write file fs.writeFileSync(outputPath, html, "utf-8"); - // 8. Optionally open in browser - if (args.open) { - const { exec } = await import("node:child_process"); - const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open"; - exec(`${cmd} "${outputPath}"`); - } - const relativePath = path.relative(params.workspaceDir, outputPath); const displayPath = relativePath.startsWith("..") ? outputPath : relativePath; @@ -357,8 +342,6 @@ export async function buildExportSessionReply(params: HandleCommandsParams): Pro `📊 Entries: ${entries.length}`, `🧠 System prompt: ${systemPrompt.length.toLocaleString()} chars`, `🔧 Tools: ${tools.length}`, - "", - args.open ? "🌐 Opening in browser..." : `Tip: /export-session --open to auto-open`, ].join("\n"), }; }