A desktop coding agent with free access to frontier models.
TypeScript
feat: drop the WSL nudge while the server counts native Windows
Ramshouriesh R0ed2f20b326d
diff --git a/apps/app/src/app/lib/good-session.ts b/apps/app/src/app/lib/good-session.tsindex 147a0ba1..7781b31e 100644--- a/apps/app/src/app/lib/good-session.ts+++ b/apps/app/src/app/lib/good-session.ts@@ -18,7 +18,10 @@// 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+// 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`)//// Sub-agents and many turns are not required.//@@ -751,6 +754,15 @@ export function localDay(now: Date | number = Date.now()): string {return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}`;}-export function showWslBanner(input: { nativeWindows: boolean; dismissedDay: string | null; now?: Date }): boolean {- return input.nativeWindows && input.dismissedDay !== localDay(input.now);+/**+ * 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 d4114668..40fb9ffd 100644--- a/apps/app/src/react-app/domains/quality/good-session.tsx+++ b/apps/app/src/react-app/domains/quality/good-session.tsx@@ -39,6 +39,7 @@ import {localDay,shouldNudge,showWslBanner,+ windowsNotCounted,type GoodSessionCheck,} from "../../../app/lib/good-session";import { readPref, useAccountQuality, writePref } from "../../../app/lib/quality";@@ -51,15 +52,17 @@ export function isNativeWindowsHost(): boolean {return isWindowsPlatform();}-/** The four steps, plus the WSL tip. */-export function GoodSessionGuide({ className }: { className?: string }) {+/** The four steps, plus the WSL tip unless the server counts native Windows (`windowsCounts`). */+export function GoodSessionGuide({ className, windowsCounts = false }: { className?: string; windowsCounts?: boolean }) {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>- <p className="mt-1 leading-5 text-muted-foreground" data-testid="good-session-wsl-tip">{GOOD_SESSION_WSL_TIP}</p>+ {windowsCounts ? null : (+ <p className="mt-1 leading-5 text-muted-foreground" data-testid="good-session-wsl-tip">{GOOD_SESSION_WSL_TIP}</p>+ )}</div>);}@@ -152,6 +155,7 @@ 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({@@ -159,8 +163,8 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {workspaceRoot: props.workspaceRoot,isRemoteWorkspace: props.isRemoteWorkspace,turnRunning: props.turnRunning,- nativeWindows,- }), [facts, nativeWindows, props.isRemoteWorkspace, props.turnRunning, props.workspaceRoot]);+ nativeWindows: windowsNotCounted({ nativeWindows, windowsCounts }),+ }), [facts, nativeWindows, props.isRemoteWorkspace, props.turnRunning, props.workspaceRoot, windowsCounts]);const serverGood = useServerGood(props.sessionId, local.onTrack);const checklist = useMemo(() => (serverGood && local.onTrack ? { ...local, verdict: "good" as const, text: checklistText(local.checks, "good") } : local),@@ -219,7 +223,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 />+ <GoodSessionGuide windowsCounts={windowsCounts} /></PopoverContent></Popover></div>@@ -227,8 +231,12 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {);}-/** "Sessions from native Windows don't count as Good sessions. Switch to WSL": dismissible, back the next day. */+/**+ * "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.@@ -237,7 +245,7 @@ export function WslBanner({ className }: { className?: string }) {const timer = window.setInterval(() => setNow(new Date()), 60 * 60_000);return () => window.clearInterval(timer);}, []);- if (!showWslBanner({ nativeWindows, dismissedDay, now })) return null;+ if (!showWslBanner({ nativeWindows, windowsCounts, dismissedDay, now })) return null;const dismiss = () => {const day = localDay();writePref(WSL_BANNER_DISMISSED_KEY, day);diff --git a/apps/app/src/react-app/domains/quality/quality-notice.tsx b/apps/app/src/react-app/domains/quality/quality-notice.tsxindex 4a64a440..7d9a785f 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 className="rounded-lg border border-border px-3 py-2" />+ <GoodSessionGuide windowsCounts={quality.windowsCounts} className="rounded-lg border border-border px-3 py-2" />{coaching ? (<div>diff --git a/apps/app/tests/good-session.test.tsx b/apps/app/tests/good-session.test.tsxindex 08895c37..f1168a91 100644--- a/apps/app/tests/good-session.test.tsx+++ b/apps/app/tests/good-session.test.tsx@@ -26,6 +26,7 @@ import {shouldNudge,showWslBanner,startsServer,+ windowsNotCounted,writtenLines,} from "../src/app/lib/good-session";import { GoodSessionGuide } from "../src/react-app/domains/quality/good-session";@@ -52,13 +53,14 @@ function transcript(...assistantParts: unknown[][]): UIMessage[] {return messages;}-function states(messages: UIMessage[], options: { turnRunning?: boolean; nativeWindows?: boolean; root?: string; serverGood?: boolean; remote?: boolean } = {}) {+function states(messages: UIMessage[], options: { turnRunning?: boolean; nativeWindows?: boolean; windowsCounts?: boolean; root?: string; serverGood?: boolean; remote?: boolean } = {}) {const result = goodSessionChecklist({...messageFacts(messages),workspaceRoot: options.root ?? ROOT,isRemoteWorkspace: options.remote ?? false,turnRunning: options.turnRunning ?? false,- nativeWindows: options.nativeWindows ?? 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])) };@@ -286,6 +288,17 @@ describe("the live checklist", () => {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 });+ 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 ✓`);+ expect(counted.result.text).not.toContain("native Windows");});test("sub-agents and many turns are not required", () => {@@ -402,6 +415,10 @@ describe("wording, the guide and the WSL banner", () => {expect(html).toContain("How to make a Good session");expect(html).toContain("On Windows? Use WSL.");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", () => {@@ -411,6 +428,9 @@ describe("wording, the guide and the WSL banner", () => {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 1b0e563c..601b8ee8 100644--- a/apps/app/tests/quality.test.tsx+++ b/apps/app/tests/quality.test.tsx@@ -52,6 +52,7 @@ const quality: AccountQuality = {nextSpinHint: { progress: 0.6, text: "Add tests to earn a spin.", sessionId: "ses_1" },biggestWinToday: { tokens: 10_000_000, at: "2026-10-04T09:00:00Z" },nudge: null,+ windowsCounts: false,};const spin: QualitySpin = {@@ -141,11 +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.");// 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("no Spin button without spins; a resting wheel says so", () => {const none = renderToStaticMarkup(<QualityNoticeCard quality={{ ...quality, spinsAvailable: 0, reproSpinsAvailable: 0 }} notice={quality.notice} onSpin={() => undefined} onDismiss={() => undefined} />,diff --git a/apps/desktop/electron/quality.mjs b/apps/desktop/electron/quality.mjsindex b397417e..2d7c42c9 100644--- a/apps/desktop/electron/quality.mjs+++ b/apps/desktop/electron/quality.mjs@@ -33,6 +33,7 @@ export const SPIN_REFUSALS = /** @type {const} */ (["no_spins", "wheel_resting",* nextSpinHint: { progress: number, text: string, sessionId: string | null } | null,* biggestWinToday: { tokens: number, at: string | null } | null,* nudge: { id: string, text: string } | null,+ * windowsCounts: boolean,* }} AccountQuality* @typedef {{ tokens: number, weight: number }} WheelSegment* @typedef {{@@ -144,6 +145,8 @@ export function parseAccountQuality(value) {nextSpinHint: parseNextSpinHint(value.next_spin_hint),biggestWinToday: parseBiggestWin(value.biggest_win_today),nudge: parseNudge(value.nudge),+ // The server counts native-Windows sessions for a Good session ★ (absent: it does not).+ windowsCounts: value.windows_counts === true,};}diff --git a/apps/desktop/electron/quality.test.mjs b/apps/desktop/electron/quality.test.mjsindex ea2db386..1c0b00b9 100644--- a/apps/desktop/electron/quality.test.mjs+++ b/apps/desktop/electron/quality.test.mjs@@ -96,12 +96,17 @@ test("quality block parses every field, including revision 2", () => {nextSpinHint: { progress: 0.6, text: "Add tests to earn a spin.", sessionId: "ses_1" },biggestWinToday: { tokens: 10000000, at: "2026-10-04T09:00:00Z" },nudge: null,+ windowsCounts: false,});// A server without `notices` still has its one `notice`.const legacy = parseAccountQuality({ tier: "limited", tokens_multiplier: 0.3, notice: { id: "n", title: "Hi" } });assert.equal(legacy.notices[0].id, "n");assert.equal(legacy.tokensMultiplier, 0.3);assert.equal(legacy.preview, false);+ // Native Windows counts for a Good session ★ only when the server says so.+ assert.equal(legacy.windowsCounts, false);+ assert.equal(parseAccountQuality({ ...QUALITY, windows_counts: true }).windowsCounts, true);+ assert.equal(parseAccountQuality({ ...QUALITY, windows_counts: "true" }).windowsCounts, false);});test("a spin answer must name a segment the wheel can land on", () => {diff --git a/packages/types/src/desktop-ipc.ts b/packages/types/src/desktop-ipc.tsindex 087f698b..60eb634d 100644--- a/packages/types/src/desktop-ipc.ts+++ b/packages/types/src/desktop-ipc.ts@@ -241,6 +241,8 @@ export type OmniRushAccountQuality = {biggestWinToday: { tokens: number; at: string | null } | null;/** Shown once per `id`, only when the server sends one. */nudge: { id: string; text: string } | null;+ /** `windows_counts`: the server counts native-Windows sessions for a Good session ★. */+ windowsCounts: boolean;};export type OmniRushQualityNotice = { id: string; kind: string | null; title: string; body: string };