diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts index 266a33b65fd..9bcabd6d3bb 100644 --- a/apps/desktop/src/app/session/hooks/use-session-actions/index.ts +++ b/apps/desktop/src/app/session/hooks/use-session-actions/index.ts @@ -504,7 +504,9 @@ export function useSessionActions({ upsertOptimisticSession(created, stored, null, null) } - const runtimeInfo = applyRuntimeInfo(created.info) + // A tile lives in its OWN worktree — it must not publish its cwd/branch + // into the composer atoms the main pane renders from. + const runtimeInfo = applyRuntimeInfo(created.info, { foreground: false }) updateSessionState(created.session_id, state => (runtimeInfo ? { ...state, ...runtimeInfo } : state), stored) openSessionTile(stored, dir) @@ -1182,7 +1184,9 @@ export function useSessionActions({ routedSessionId ) - const runtimeInfo = applyRuntimeInfo(branched.info) + // The branch opens as its own tile in the parent's worktree, not as the + // primary session — keep its runtime out of the main composer atoms. + const runtimeInfo = applyRuntimeInfo(branched.info, { foreground: false }) patchSessionWorkspace(routedSessionId, runtimeInfo?.cwd) if (runtimeInfo) {