fix(cli): preview inside a host app's agent run no longer outlives the run (#5852)

A background preview detaches, so one started by an agent inside a host app's
run kept running after the run and the app ended, and held the project's
history lock for its whole life. Inside a host app's run, preview now refuses
to start in the background and points to the host app's preview or
--foreground, which stays attached to the run.
This commit is contained in:
Miguel Ángel
2026-10-18 22:15:19 +00:00
committed by GitHub
parent 388011b214
commit bf24fda8da
3 changed files with 61 additions and 5 deletions
+5 -1
View File
@@ -221,6 +221,10 @@ export function desktopInstalled({
return DESKTOP_BUNDLE_IDS.some(spotlight);
}
export function insideHostApp(env: NodeJS.ProcessEnv = process.env): boolean {
return Boolean(env.HYPERFRAMES_DESKTOP_PROJECT);
}
/** The app line render and preview print; null inside the app, or with nothing here to open or download. */
export function desktopHint(
dir: string,
@@ -236,7 +240,7 @@ export function desktopHint(
platform?: NodeJS.Platform;
} = {},
): string | null {
if (env.HYPERFRAMES_DESKTOP_PROJECT) return null;
if (insideHostApp(env)) return null;
if (ready && (installed ?? desktopInstalled({ platform, env })))
return `Keep editing by chatting with Framey in the desktop app: ${openCommandFor(dir)}`;
const url = desktopDownloadUrl(platform);