Windows tray Quit kills the GUI instead of asking it to exit
- Dominant language
- Rust
- Stars
- 21k
- Forks
- 675
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 172
Description
On Windows, tray → Quit terminates the GUI process rather than telling it to quit. `crates/openlogi-agent/src/tray_windows.rs` `quit()` calls `sysinfo::Process::kill()` (`TerminateProcess`) for each GUI pid, so:
- a clean user-initiated quit leaves the GUI with exit code 1, which reads as a crash to anything watching the process
- GPUI teardown and the singleton-lock release never run — they are left to the OS
- the log line is `tray Quit — terminated the GUI`, indistinguishable from a kill
The comment above `quit()` says it "Mirrors the macOS Quit semantics", but it does not. macOS (`tray.rs` `quit_agent()`) sends the `openlogi://quit` deeplink through `open` and lets the GUI exit itself; the kill has no macOS counterpart.
The GUI side is already cross-platform: `crates/openlogi-desktop/src/app/deeplink.rs:17` handles `Cmd::Quit => cx.quit()` with no `cfg` gate. What is missing on Windows is a way for the agent to deliver that request — the GUI is a pure IPC client, so the existing agent socket runs the wrong direction.
The kill itself is deliberate and should not simply be dropped: the comment notes that the GUI's IPC retry loop would otherwise respawn the agent that is about to exit. So the ask is to try a graceful path first and keep the kill as a bounded fallback — deliver `openlogi://quit` the way macOS does, or post `WM_CLOSE` to the GUI's top-level window, then wait briefly and kill only if it has not exited.
No data-loss risk today: config writes are atomic, so a kill mid-save cannot truncate anything.
**Repro:** run the Windows GUI from a terminal, quit via the tray icon, observe exit code 1.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in crates/openlogi-agent/src/tray_windows.rs at quit(), then compare the Windows path with tray.rs quit_agent() and the Cmd::Quit handler in crates/openlogi-desktop/src/app/deeplink.rs. Reproduce the tray quit from a Windows terminal and verify that the GUI receives a graceful quit request, exits cleanly, and is killed only after the bounded fallback if it remains running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100