diff --git a/.opencode/plans/1773656570427-mighty-tiger.md b/.opencode/plans/1773656570427-mighty-tiger.md index 8d601b2..6e29aeb 100644 --- a/.opencode/plans/1773656570427-mighty-tiger.md +++ b/.opencode/plans/1773656570427-mighty-tiger.md @@ -173,10 +173,14 @@ export function sanitizeName(name: string): string { // Session name sanitization } +export function getSessionPath(sessionName: string): string { + const homedir = process.env.HOME || process.env.USERPROFILE || "/tmp"; + return `${homedir}/.local/share/opencode/multi-model/${sessionName}`; +} + export function getWorktreePath(sessionName: string, windowName: string): string { // Worktree path generation - const homedir = process.env.HOME || process.env.USERPROFILE || "/tmp"; - return `${homedir}/.local/share/opencode/multi-model/${sessionName}/${windowName}`; + return `${getSessionPath(sessionName)}/${windowName}`; } export interface WorktreeInfo { @@ -189,8 +193,7 @@ export async function getWorktreesForSession(sessionName: string): Promise = {}; @@ -236,7 +239,7 @@ import type { MultiModelOptions, MultiModelResult } from "../types"; import { runCommand, shellQuote, normalizeModels, findDuplicates, createWindowPlans, suggestModels, formatInvalidModelError, - sanitizeName, getWorktreePath, undoWorktree, getBinaryName + sanitizeName, getWorktreePath, getSessionPath, undoWorktree, getBinaryName } from "./utils"; export async function launchMultiModel(options: MultiModelOptions): Promise { @@ -263,7 +266,7 @@ To close the session and cleanup: Or manually: tmux kill-session -t ${options.sessionName} - rm -rf ~/.local/share/opencode/multi-model/${safeSessionName} && git worktree prune + rm -rf ${getSessionPath(safeSessionName)} && git worktree prune git branch -D $(git branch --format='%(refname:short)' --list 'opencode/${safeSessionName}/*') ` }; @@ -275,7 +278,7 @@ Or manually: ```typescript // src/core/close.ts import type { CloseSessionOptions, CloseSessionResult } from "../types"; -import { runCommand, getWorktreePath, getWorktreesForSession, sanitizeName } from "./utils"; +import { runCommand, getSessionPath, getWorktreesForSession, sanitizeName } from "./utils"; import * as readline from "readline"; async function promptUser(question: string): Promise { @@ -341,7 +344,7 @@ export async function closeMultiModel(options: CloseSessionOptions): Promise