A desktop coding agent with free access to frontier models.
TypeScript
fix: treat windows like other systems
ogsamrat09c66d4942a3
diff --git a/apps/app/src/app/lib/desktop.ts b/apps/app/src/app/lib/desktop.tsindex d7b0a68b..7af0c924 100644--- a/apps/app/src/app/lib/desktop.ts+++ b/apps/app/src/app/lib/desktop.ts@@ -342,8 +342,6 @@ declare global {platform?: "darwin" | "linux" | "windows";version?: string;evalFatalBootstrapFailure?: string | null;- /** Test hook (OMNIRUSH_E2E_FORCE_WIN32=1): act as native Windows. */- forceNativeWindows?: boolean;};};}diff --git a/apps/app/src/app/lib/good-session.ts b/apps/app/src/app/lib/good-session.tsindex b0b3f64e..636ebbde 100644--- a/apps/app/src/app/lib/good-session.ts+++ b/apps/app/src/app/lib/good-session.ts@@ -18,10 +18,8 @@// local_service) and no machine-specific program (V3// host_only_program)// finished the last turn finished (V3 unrecorded_turn, V2 `finished`)-// windows not native Windows (V3 windows_host); WSL is fine. Left out-// while the server counts native Windows: `windows_counts` in the-// account's quality block (/device/me, GET /me/quality); the-// desktop then passes `nativeWindows: false` (`windowsNotCounted`)+//+// Native Windows, macOS, Linux and WSL are treated the same.//// Sub-agents and many turns are not required.//@@ -44,13 +42,8 @@ export const GOOD_SESSION_GUIDE: readonly string[] = Object.freeze(["Run it or its tests.","Let the last turn finish.",]);-export const GOOD_SESSION_WSL_TIP = "On Windows? Use WSL.";export const GOOD_SESSION_GUIDE_LINK = "How to make a Good session";-/** The console's WSL guide (omnirush-console app/console/wsl, lib/wsl-guide). */-export const WSL_GUIDE_URL = "https://omnirush.ai/console/wsl";-export const WSL_BANNER_TEXT = "Sessions from native Windows don't count as Good sessions. Switch to WSL";-export const TURN_GUARD_TITLE = "A turn is still running.";export const TURN_GUARD_DETAIL = `Quit now and this session won't count as a ${GOOD_SESSION_LABEL}.`;export const TURN_GUARD_MESSAGE = `${TURN_GUARD_TITLE} ${TURN_GUARD_DETAIL}`;@@ -58,7 +51,7 @@ export const TURN_GUARD_MESSAGE = `${TURN_GUARD_TITLE} ${TURN_GUARD_DETAIL}`;export const TURN_GUARD_WAIT = "Finish it";export const TURN_GUARD_QUIT = "Quit anyway";-export const NUDGE_TITLE = `Not a ${GOOD_SESSION_LABEL} yet`;+export const NUDGE_TITLE = "Not a Good session yet";/** The finish guard (M4b): no turn runs, but the last one needs finishing. */export type FinishGuardKind = "awaiting" | "cut";@@ -515,8 +508,6 @@ export type GoodSessionInput = {* answer asks the user something; "cut": anything else.*/lastTurn?: LastTurn;- /** Native Windows (not WSL). */- nativeWindows?: boolean;/** Remote workspaces do not necessarily have a local project folder. */isRemoteWorkspace?: boolean;/** The server checked this session after upload and it is a Good session ★. */@@ -529,7 +520,7 @@ function plural(count: number, word: string): string {/** The checklist for a session, from its tool calls. */export function goodSessionChecklist({- calls = [], workspaceRoot = "", turnRunning = false, lastTurn = "cut", nativeWindows = false, isRemoteWorkspace = false, serverGood = false,+ calls = [], workspaceRoot = "", turnRunning = false, lastTurn = "cut", isRemoteWorkspace = false, serverGood = false,}: GoodSessionInput = {}): GoodSessionChecklist {const codeFiles = new Map<string, number>();let testRuns = 0;@@ -636,9 +627,6 @@ export function goodSessionChecklist({: "The last turn stopped before it finished: send a follow-up and let it finish.",},];- if (nativeWindows) {- checks.push({ id: "windows", state: "fail", label: "native Windows", hint: "Sessions from native Windows don't count: use WSL." });- }const missing = checks.filter((check) => check.state === "fail");const onTrack = checks.every((check) => check.state === "pass");const verdict: GoodSessionVerdict = onTrack ? (serverGood ? "good" : "on-track") : "incomplete";@@ -1049,27 +1037,3 @@ export function leavingRunningTurn(input: { action: "close" | "quit" | "switch"if (input.action === "switch") return false;return true;}--// --- Native Windows --------------------------------------------------------------export const WSL_BANNER_DISMISSED_KEY = "omnirush.goodSession.wslBannerDismissedDay.v1";--/** The local day ("2026-10-06"): a dismissed banner comes back the next day. */-export function localDay(now: Date | number = Date.now()): string {- const at = new Date(now);- const pad = (value: number) => String(value).padStart(2, "0");- return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}`;-}--/**- * Native Windows the server does not count (`windowsCounts`: its- * `windows_counts`, absent or false on older servers): the checklist's- * `windows` check and the WSL banner show only then.- */-export function windowsNotCounted(input: { nativeWindows: boolean; windowsCounts?: boolean }): boolean {- return input.nativeWindows && input.windowsCounts !== true;-}--export function showWslBanner(input: { nativeWindows: boolean; windowsCounts?: boolean; dismissedDay: string | null; now?: Date }): boolean {- return windowsNotCounted(input) && input.dismissedDay !== localDay(input.now);-}diff --git a/apps/app/src/react-app/domains/quality/good-session.tsx b/apps/app/src/react-app/domains/quality/good-session.tsxindex c92aa31f..59500c38 100644--- a/apps/app/src/react-app/domains/quality/good-session.tsx+++ b/apps/app/src/react-app/domains/quality/good-session.tsx@@ -2,7 +2,7 @@import { useEffect, useMemo, useRef, useState } from "react";import type { UIMessage } from "ai";import type { OmniRushSessionStatus } from "@omnirush/types/desktop-ipc";-import { AlertTriangle, CircleCheck, CircleX, Star, X } from "lucide-react";+import { AlertTriangle, CircleCheck, CircleX, Star } from "lucide-react";import {AlertDialog,@@ -15,7 +15,6 @@ import {AlertDialogMedia,AlertDialogTitle,} from "@/components/ui/alert-dialog";-import { Button } from "@/components/ui/button";import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import { toast } from "@/components/ui/sonner";import { cn } from "@/lib/utils";@@ -30,29 +29,22 @@ import {FINISH_GUARD_TITLE,GOOD_SESSION_GUIDE,GOOD_SESSION_GUIDE_LINK,- GOOD_SESSION_WSL_TIP,NUDGE_TITLE,TURN_GUARD_DETAIL,TURN_GUARD_QUIT,TURN_GUARD_TITLE,TURN_GUARD_WAIT,- WSL_BANNER_DISMISSED_KEY,- WSL_BANNER_TEXT,- WSL_GUIDE_URL,autoRetryMessage,checklistHeading,finishGuardKind,goodSessionChecklist,goodSessionNudge,messageFacts,- localDay,oneMoreTurnHint,serverStatusUsable,sessionStatusPollMs,shouldNudge,shownChecklist,- showWslBanner,- windowsNotCounted,type FinishGuardKind,type GoodSessionCheck,type GoodSessionTone,@@ -64,26 +56,17 @@ import {} from "../../../app/lib/good-session-integrity";import type { OmniRushGoodSession, OmniRushServerClient } from "../../../app/lib/omnirush-server";import { readPref, useAccountQuality, writePref } from "../../../app/lib/quality";-import { isDesktopRuntime, isWindowsPlatform } from "../../../app/utils";+import { isDesktopRuntime } from "../../../app/utils";import { hasLiveSessionActivity, useSessionActivityStore } from "../session/status/session-activity-store";-/** Native Windows (the app itself; there is no WSL desktop build). The e2e hook forces it on Linux. */-export function isNativeWindowsHost(): boolean {- if (typeof window !== "undefined" && window.__OMNIRUSH_ELECTRON__?.meta?.forceNativeWindows === true) return true;- return isWindowsPlatform();-}--/** The four steps, plus the WSL tip unless the server counts native Windows (`windowsCounts`). */-export function GoodSessionGuide({ className, windowsCounts = false }: { className?: string; windowsCounts?: boolean }) {+/** The four steps (native Windows, macOS and Linux alike). */+export function GoodSessionGuide({ className }: { className?: string }) {return (<div className={cn("text-xs", className)} data-testid="good-session-guide"><p className="font-medium text-foreground">{GOOD_SESSION_GUIDE_LINK}</p><ol className="mt-1 list-decimal space-y-0.5 ps-4 leading-5 text-muted-foreground marker:text-muted-foreground/60">{GOOD_SESSION_GUIDE.map((step) => <li key={step}>{step}</li>)}</ol>- {windowsCounts ? null : (- <p className="mt-1 leading-5 text-muted-foreground" data-testid="good-session-wsl-tip">{GOOD_SESSION_WSL_TIP}</p>- )}</div>);}@@ -340,16 +323,13 @@ function useServerGood(sessionId: string, ask: boolean): boolean {* missing.*/export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {- const windowsCounts = useAccountQuality()?.windowsCounts === true;- const nativeWindows = useMemo(() => isNativeWindowsHost(), []);const facts = useMemo(() => messageFacts(props.messages), [props.messages]);const local = useMemo(() => goodSessionChecklist({...facts,workspaceRoot: props.workspaceRoot,isRemoteWorkspace: props.isRemoteWorkspace,turnRunning: props.turnRunning,- nativeWindows: windowsNotCounted({ nativeWindows, windowsCounts }),- }), [facts, nativeWindows, props.isRemoteWorkspace, props.turnRunning, props.workspaceRoot, windowsCounts]);+ }), [facts, props.isRemoteWorkspace, props.turnRunning, props.workspaceRoot]);const hasPrompt = props.messages.some((message) => message.role === "user");const server = useServerSessionStatus(props.sessionId, hasPrompt, props.turnRunning);const goodSession = useGoodSession(props.client, props.sessionId, hasPrompt, props.turnRunning, facts.endedAt);@@ -512,7 +492,7 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {{GOOD_SESSION_GUIDE_LINK}</PopoverTrigger><PopoverContent side="top" align="end" className="w-72 gap-2 rounded-2xl p-3">- <GoodSessionGuide windowsCounts={windowsCounts} />+ <GoodSessionGuide /></PopoverContent></Popover></div>@@ -520,61 +500,6 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {);}-/**- * "Sessions from native Windows don't count as Good sessions. Switch to WSL":- * dismissible, back the next day; none while the server counts native Windows.- */-export function WslBanner({ className }: { className?: string }) {- const windowsCounts = useAccountQuality()?.windowsCounts === true;- const nativeWindows = useMemo(() => isNativeWindowsHost(), []);- const [dismissedDay, setDismissedDay] = useState(() => readPref(WSL_BANNER_DISMISSED_KEY));- // Comes back on the next day even when the app stays open.- const [now, setNow] = useState(() => new Date());- useEffect(() => {- const timer = window.setInterval(() => setNow(new Date()), 60 * 60_000);- return () => window.clearInterval(timer);- }, []);- if (!showWslBanner({ nativeWindows, windowsCounts, dismissedDay, now })) return null;- const dismiss = () => {- const day = localDay();- writePref(WSL_BANNER_DISMISSED_KEY, day);- setDismissedDay(day);- };- return (- <div className={cn("px-4 max-lg:px-3 lg:px-8", className)}>- <div- role="status"- data-testid="good-session-wsl-banner"- className="mx-auto mb-2 flex max-w-[800px] items-center gap-2 rounded-lg border border-amber-7/40 bg-amber-2/30 px-3 py-2 text-xs text-amber-11"- >- <AlertTriangle className="size-3.5 shrink-0" aria-hidden="true" />- <span className="min-w-0 flex-1">- {WSL_BANNER_TEXT}{" "}- <button- type="button"- data-testid="good-session-wsl-link"- className="font-medium underline underline-offset-2 hover:text-amber-12"- onClick={() => void openDesktopUrl(WSL_GUIDE_URL).catch(() => undefined)}- >- Open the WSL guide- </button>- </span>- <Button- type="button"- variant="ghost"- size="icon-xs"- aria-label="Dismiss"- data-testid="good-session-wsl-dismiss"- onClick={dismiss}- className="-me-1 text-amber-11 hover:text-amber-12"- >- <X />- </Button>- </div>- </div>- );-}-/** The finish guard in the app (deleting the session): "Finish it" (the default) or "Quit anyway". */export function FinishGuardDialog(props: { kind: FinishGuardKind | null; onFinish: () => void; onQuit: () => void }) {return (diff --git a/apps/app/src/react-app/domains/quality/quality-notice.tsx b/apps/app/src/react-app/domains/quality/quality-notice.tsxindex 7d9a785f..4a64a440 100644--- a/apps/app/src/react-app/domains/quality/quality-notice.tsx+++ b/apps/app/src/react-app/domains/quality/quality-notice.tsx@@ -177,7 +177,7 @@ export function QualityNoticeCard(props: QualityNoticeCardProps) {<p className="text-xs font-medium text-foreground">How to earn spins</p>) : null}- <GoodSessionGuide windowsCounts={quality.windowsCounts} className="rounded-lg border border-border px-3 py-2" />+ <GoodSessionGuide className="rounded-lg border border-border px-3 py-2" />{coaching ? (<div>diff --git a/apps/app/src/react-app/domains/session/surface/session-surface.tsx b/apps/app/src/react-app/domains/session/surface/session-surface.tsxindex d08f563b..5df18297 100644--- a/apps/app/src/react-app/domains/session/surface/session-surface.tsx+++ b/apps/app/src/react-app/domains/session/surface/session-surface.tsx@@ -98,7 +98,7 @@ import { getSessionActivityStatusLabel, useSessionActivityStore, type SessionActimport { PermissionApprovalPanel } from "@/react-app/domains/session/chat/permission-approval-modal";import { QuestionPanel } from "@/react-app/domains/session/modals/question-modal";import { QueuedMessagesPanel } from "@/react-app/domains/session/modals/queued-messages-panel";-import { GoodSessionChecklistBar, WslBanner, noteUserStop } from "@/react-app/domains/quality/good-session";+import { GoodSessionChecklistBar, noteUserStop } from "@/react-app/domains/quality/good-session";import { deriveOpenTargets, sameOpenTargets, selectAutoOpenTarget, type OpenTarget } from "@/react-app/domains/session/artifacts/open-target";import { usePanelTabStore } from "@/react-app/domains/session/panel/panel-tab-store";import {@@ -3330,7 +3330,6 @@ export function SessionSurface(props: SessionSurfaceProps) {{attachment.name}{sending ? " · Uploading…" : ""}</div>)))}- <WslBanner /><GoodSessionChecklistBarsessionId={props.sessionId}messages={renderedMessages}diff --git a/apps/app/tests/good-session.test.tsx b/apps/app/tests/good-session.test.tsxindex 477f2469..10404aea 100644--- a/apps/app/tests/good-session.test.tsx+++ b/apps/app/tests/good-session.test.tsx@@ -26,7 +26,6 @@ import {isCodePath,isHomeFolder,leavingRunningTurn,- localDay,messageFacts,oneMoreTurnHint,outsideProject,@@ -36,9 +35,7 @@ import {shellWrites,shouldNudge,shownChecklist,- showWslBanner,startsServer,- windowsNotCounted,writtenLines,} from "../src/app/lib/good-session";import { GoodSessionGuide } from "../src/react-app/domains/quality/good-session";@@ -66,14 +63,12 @@ function transcript(...assistantParts: unknown[][]): UIMessage[] {return messages;}-function states(messages: UIMessage[], options: { turnRunning?: boolean; nativeWindows?: boolean; windowsCounts?: boolean; root?: string; serverGood?: boolean; remote?: boolean } = {}) {+function states(messages: UIMessage[], options: { turnRunning?: boolean; root?: string; serverGood?: boolean; remote?: boolean } = {}) {const result = goodSessionChecklist({...messageFacts(messages),workspaceRoot: options.root ?? ROOT,isRemoteWorkspace: options.remote ?? false,turnRunning: options.turnRunning ?? false,- // As the checklist bar passes it.- nativeWindows: windowsNotCounted({ nativeWindows: options.nativeWindows ?? false, windowsCounts: options.windowsCounts }),serverGood: options.serverGood ?? false,});return { result, by: Object.fromEntries(result.checks.map((check) => [check.id, check.state])) };@@ -294,20 +289,9 @@ describe("the live checklist", () => {expect(states(unanswered).result.checks.find((check) => check.id === "finished")?.label).toBe("last turn cut off");});- test("native Windows adds a failing check; WSL (Linux) does not", () => {+ test("native Windows counts like macOS and Linux: no Windows check, on track", () => {const messages = transcript([...realWork(), tool("bash", { command: "npm test" })]);- const windows = states(messages, { nativeWindows: true });- expect(windows.by.windows).toBe("fail");- expect(windows.result.verdict).toBe("incomplete");- expect(windows.result.text).toContain("native Windows ✗");- expect(states(messages).by.windows).toBeUndefined();- // An older server sends no `windows_counts`; false is the same.- expect(states(messages, { nativeWindows: true, windowsCounts: false }).by.windows).toBe("fail");- });-- test("while the server counts native Windows (windows_counts), there is no Windows check: on track", () => {- const messages = transcript([...realWork(), tool("bash", { command: "npm test" })]);- const counted = states(messages, { nativeWindows: true, windowsCounts: true });+ const counted = states(messages);expect(counted.by.windows).toBeUndefined();expect(counted.result.verdict).toBe("on-track");expect(counted.result.text).toBe(`${GOOD_SESSION_ON_TRACK}: code changed ✓ · ran/tested ✓ · in project ✓ · turn finished ✓`);@@ -372,7 +356,7 @@ describe("the nudge", () => {test("says what is missing, gently", () => {const nudge = goodSessionNudge(missing);- expect(nudge?.title).toBe("Not a Good session ★ yet");+ expect(nudge?.title).toBe("Not a Good session yet");expect(nudge?.body).toContain("run its tests");});});@@ -409,7 +393,7 @@ describe("the don't-leave-mid-turn guard", () => {});});-describe("wording, the guide and the WSL banner", () => {+describe("wording and the guide", () => {test("server texts read Good session ★", () => {expect(goodSessionWording("Only replay-ready ★ sessions earn spins: a complete project")).toBe("Only Good sessions ★ earn spins: a complete project");expect(goodSessionWording("+1 spin per replay-ready ★ session")).toBe("+1 spin per Good session ★");@@ -418,7 +402,7 @@ describe("wording, the guide and the WSL banner", () => {expect(goodSessionWording(null)).toBeNull();});- test("the guide has the four steps and the WSL tip", () => {+ test("the guide has the four steps and no WSL tip", () => {expect([...GOOD_SESSION_GUIDE]).toEqual(["Work inside your project folder.","Build or change real code.",@@ -427,24 +411,8 @@ describe("wording, the guide and the WSL banner", () => {]);const html = renderToStaticMarkup(<GoodSessionGuide />);expect(html).toContain("How to make a Good session");- expect(html).toContain("On Windows? Use WSL.");+ expect(html).not.toMatch(/WSL|native Windows/);expect(html.match(/<li>/g)?.length).toBe(4);- // While the server counts native Windows: the four steps, no WSL tip.- const counted = renderToStaticMarkup(<GoodSessionGuide windowsCounts />);- expect(counted).not.toContain("On Windows? Use WSL.");- expect(counted.match(/<li>/g)?.length).toBe(4);- });-- test("the WSL banner: native Windows only, dismissed for the day, back the next day", () => {- const now = new Date(2026, 9, 6, 15, 0);- expect(localDay(now)).toBe("2026-10-06");- expect(showWslBanner({ nativeWindows: true, dismissedDay: null, now })).toBe(true);- expect(showWslBanner({ nativeWindows: true, dismissedDay: "2026-10-06", now })).toBe(false);- expect(showWslBanner({ nativeWindows: true, dismissedDay: "2026-10-06", now: new Date(2026, 9, 7, 9, 0) })).toBe(true);- expect(showWslBanner({ nativeWindows: false, dismissedDay: null, now })).toBe(false);- // None while the server counts native Windows; back when it stops.- expect(showWslBanner({ nativeWindows: true, windowsCounts: true, dismissedDay: null, now })).toBe(false);- expect(showWslBanner({ nativeWindows: true, windowsCounts: false, dismissedDay: null, now })).toBe(true);});test("checklistText marks pending checks without a tick", () => {diff --git a/apps/app/tests/quality.test.tsx b/apps/app/tests/quality.test.tsxindex 601b8ee8..531a8614 100644--- a/apps/app/tests/quality.test.tsx+++ b/apps/app/tests/quality.test.tsx@@ -142,18 +142,20 @@ describe("notice: once per id", () => {expect(html).toContain("Spin (2)");expect(html).toContain("4-day streak");expect(html).toContain("Next spin · 60%");- expect(html).toContain("On Windows? Use WSL.");+ expect(html).not.toContain("WSL");// The app's toast style: theme surfaces, sentence case, no coloured bar or eyebrow.expect(html).toContain("bg-popover");expect(html).not.toMatch(/uppercase|tracking-\[|#a3e635|#0b1120|shadow-\[0_0/);});- test("the popup's guide has no WSL tip while the server counts native Windows (windows_counts)", () => {- const html = renderToStaticMarkup(- <QualityNoticeCard quality={{ ...quality, windowsCounts: true }} notice={quality.notice} onSpin={() => undefined} onDismiss={() => undefined} />,- );- expect(html).toContain("How to make a Good session");- expect(html).not.toContain("On Windows? Use WSL.");+ test("the popup's guide has no WSL tip, whatever windows_counts says", () => {+ for (const windowsCounts of [true, false]) {+ const html = renderToStaticMarkup(+ <QualityNoticeCard quality={{ ...quality, windowsCounts }} notice={quality.notice} onSpin={() => undefined} onDismiss={() => undefined} />,+ );+ expect(html).toContain("How to make a Good session");+ expect(html).not.toContain("WSL");+ }});test("no Spin button without spins; a resting wheel says so", () => {diff --git a/apps/desktop/electron/preload.mjs b/apps/desktop/electron/preload.mjsindex 9cd8e045..e2aa256e 100644--- a/apps/desktop/electron/preload.mjs+++ b/apps/desktop/electron/preload.mjs@@ -294,8 +294,6 @@ contextBridge.exposeInMainWorld("__OMNIRUSH_ELECTRON__", {platform: normalizePlatform(process.platform),version: process.versions.electron,evalFatalBootstrapFailure: process.env.OMNIRUSH_EVAL_FATAL_DESKTOP_BOOTSTRAP_FAILURE ?? null,- // Test hook: e2e runs on Linux show the native-Windows notice.- forceNativeWindows: process.env.OMNIRUSH_E2E_FORCE_WIN32 === "1",},});