diff --git a/src/cli.ts b/src/cli.ts index 35da605..7607ac9 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -78,6 +78,7 @@ program cleanupWorktrees: !options.keepWorktrees, force: options.force, createArchiveTags: options.tags, + mode: "cli", }); if (result.success) { @@ -107,6 +108,7 @@ program const result = await cleanupMultiModel({ force: options.force, remote: options.remote === true ? undefined : options.remote, + mode: "cli", }); if (result.success) { diff --git a/src/core/cleanup.ts b/src/core/cleanup.ts index 52b35bb..3099c90 100644 --- a/src/core/cleanup.ts +++ b/src/core/cleanup.ts @@ -73,9 +73,9 @@ async function deleteRemoteTag( * @returns Result with counts and details of deleted tags. */ export async function cleanupMultiModel( - options: CleanupOptions = {}, + options: CleanupOptions, ): Promise { - const { force = false, remote } = options; + const { force = false, remote, mode } = options; // Get available remotes and archive tags first const availableRemotes = await getAvailableRemotes(); diff --git a/src/core/close.ts b/src/core/close.ts index c8b84ec..b38f88e 100644 --- a/src/core/close.ts +++ b/src/core/close.ts @@ -56,6 +56,7 @@ export async function closeMultiModel( const instructionsArr: string[] = []; const branchesDeleted: string[] = []; const tagsCreated: string[] = []; + const mode = options.mode; const safeSessionName = sanitizeName(options.sessionName); try { diff --git a/src/core/open.ts b/src/core/open.ts index 5d7e1bf..74baf2a 100644 --- a/src/core/open.ts +++ b/src/core/open.ts @@ -41,7 +41,7 @@ export async function openMultiModel( const safeSessionName = sanitizeName(sessionName); const models = normalizeModels(options.models); const binaryName = options.binaryName || "opencode"; - const mode = options.mode || "cli"; + const mode = options.mode; if (!sessionName) { return { diff --git a/src/tools/cleanup.ts b/src/tools/cleanup.ts index a853c5c..aa8a52b 100644 --- a/src/tools/cleanup.ts +++ b/src/tools/cleanup.ts @@ -31,6 +31,7 @@ Arguments: const result = await cleanupMultiModel({ force: true, remote: args.noRemote ? false : args.remote, + mode: "tool", }); if (!result.success) { diff --git a/src/tools/close.ts b/src/tools/close.ts index 439fad9..4e88720 100644 --- a/src/tools/close.ts +++ b/src/tools/close.ts @@ -39,6 +39,7 @@ Arguments: cleanupWorktrees: args.cleanupWorktrees, createArchiveTags: args.createArchiveTags, force: true, + mode: "tool", }); if (!result.success) { diff --git a/src/types.ts b/src/types.ts index 55a60f1..8fb9e5d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,7 +9,7 @@ export interface MultiModelOptions { /** Binary name to use ('opencode' or 'kilo'). Defaults to 'opencode'. */ binaryName?: string; /** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */ - mode?: "cli" | "tool"; + mode: "cli" | "tool"; } /** @@ -40,6 +40,8 @@ export interface CloseSessionOptions { cleanupWorktrees?: boolean; /** Skip confirmation prompts. */ force?: boolean; + /** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */ + mode: "cli" | "tool"; } /** @@ -87,6 +89,8 @@ export interface CleanupOptions { * - If false: only local cleanup (--no-remote flag) */ remote?: string | false; + /** Caller context: 'cli' shows shell commands, 'tool' shows tool instructions. */ + mode: "cli" | "tool"; } /**