feat(desktop): keep Windows host in system tray - #7493
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This adds a new Windows tray/background workflow and changes close, quit, startup, and updater recovery semantics across several production services. The cross-cutting native lifecycle and backend restart behavior warrants human validation despite focused test coverage. You can add or adjust custom eligibility rules. Learn more. |
|
On it |
|
PR does touch a lot of files here in my testing on windows in Dev and other modes it is working fine but its upto you guys to decide if we want this feature or not |
There was a problem hiding this comment.
Effect service conventions review of the tray work. The new DesktopTray service itself follows the canonical shape (subpath namespace imports, inline Context.Service interface, make then layer, all dependencies acquired with yield* Foo.Foo, scoped acquireRelease for the native handle, runPromiseWith only at the Electron callback boundary, and test-only Layer.succeed seams).
Two findings, both about failure modeling: the new failure paths report causes as Cause.pretty(...) text in a log annotation instead of a structured tagged error, which the conventions call out explicitly ("Define service failures with Schema.TaggedErrorClass and structured attributes" / "Do not copy ... arbitrary defect text into ... a parallel log payload. Preserve the exact underlying value only as cause").
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
One finding on the new tray service: DesktopTrayConfigurationError carries a single-value stage literal that duplicates the information already in the error tag. Everything else (namespace imports, Context.Service + inline interface, make/layer ordering, dependency acquisition via yield*, and the native-callback runPromiseWith boundary mirroring DesktopApplicationMenu.ts) matches the conventions.
Posted via Macroscope — Effect Service Conventions
|
only failing one is the marketing thing and im getting e mails about that LMAO |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b16f4de. Configure here.

What Changed
The independent Windows startup performance work is tracked in #7492.
Why
Closing the final T3 Code window on Windows previously exited the desktop host, stopping its backend and disconnecting paired remote clients. A tray-backed background mode keeps the host reachable while retaining an explicit, reliable way to quit completely.
UI Changes
Related Issues
Checklist
Implemented with GPT-5.6-sol through the Codex harness in T3 Code.
Note
Medium Risk
Changes Windows quit/close semantics and couples lifecycle, tray, and update install recovery; mistakes could leave a hidden app running or fail to restore backends after a bad update install.
Overview
On Windows, closing the main window no longer exits the app when the system tray is active: a new
DesktopTrayservice registers Open/Quit actions, enablesDesktopWindowbackground mode only after tray setup succeeds, andDesktopLifecycleskipsapp.quitonwindow-all-closedwhile that mode is on.DesktopWindowintercepts close to hide the window (including the connecting splash), callsprepareForQuiton real shutdown paths, and uses a creation mutex so backend-ready and activation cannot open duplicate main windows.DesktopUpdatesrecords backends that were running before install, and on failed or interrupted quit-and-install runsrecoverInstallAction(restart those instances, wait for primary readiness, re-activate the window) whileresetQuitPreparationrestores close-to-background behavior. Updaterbefore-quitpermission is consumed once per event.User docs for remote access note tray behavior on Windows.
Reviewed by Cursor Bugbot for commit c585d17. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Windows system tray support with background mode and update install recovery
DesktopTrayContext service, which on Windows creates a native tray with Open and Quit menu entries and enablesDesktopWindowbackground mode while the tray exists; closing the window hides it instead of quitting, and tray click re-activates the windowDesktopWindowwithsetBackgroundModeEnabled,isBackgroundModeEnabled,prepareForQuit, andresetQuitPreparation; closes on Windows are intercepted to hide the window when background mode is on, and a semaphore serializes main window creation to prevent duplicates under concurrent activation/readiness signalsDesktopLifecyclesowindow-all-closeddoes not quit on non-mac platforms when background mode is enabled, andhandleBeforeQuitnow callsprepareForQuitsynchronously and treatsallowQuitas a one-time booleanrecoverInstallActioninDesktopUpdatesthat restarts previously running backends, waits up to 60s for primary readiness, and re-activates the window after a failed or interrupted quit-and-install;resetInstallActionnow clears quitting state and callsresetQuitPreparationhandleBeforeQuitsignature changed from a callbackallowQuit: () => booleanto a plainboolean, andDesktopWindowinterface gains four new methods that all stubs must implementMacroscope summarized c585d17.