Where does the bug appear (feature/product)?
Grok Bot
Describe the Bug
After Grok Bot is closed, launching it again from the Start menu, a shortcut, or the executable can create background Electron processes but no visible application window. Restarting Windows temporarily recovers it.
The failure was isolated to %APPDATA%\Grok Bot\window-state.json. The file contained a window rectangle far outside the only connected display, with width and height both equal to zero. On the failing launch, the Electron main process remained responsive but had MainWindowHandle = 0.
Moving only window-state.json aside restored the visible window immediately. Bots, conversations, credentials, and Agent Computer data were not changed.
Steps to Reproduce
- Run Grok Bot 0.57.1 on Windows with display scaling set to 150%.
- Use the app normally with its window maximized.
- Close the Grok Bot window using the title-bar close control.
- Launch Grok Bot again from Start, a shortcut, or %LOCALAPPDATA%\Programs\Grok Bot\Grok Bot.exe.
- Observe that the Electron process tree starts, but no Grok Bot window becomes visible.
- Additional launch attempts may create Crashpad reports and/or leave the process tree alive without a main window.
This occurred repeatedly after closing the desktop app. A Windows restart allowed one normal opening, after which closing and reopening could trigger it again.
Expected Behavior
Grok Bot should validate persisted window geometry and either restore the last valid visible bounds or use default centered bounds. Closing and reopening the app should never require restarting Windows or manually resetting application state.
Operating System
Windows 10/11
Version Information
Grok Bot:
Version: 0.57.1
Release Track: stable
Architecture: Windows x64
Electron: 42.1.0
OS: Windows Enterprise 25H2, build 26200.9448, x64
Display: one primary display, 1280x800 (working area 1280x752)
Display scaling: 150% (AppliedDPI = 144)
Additional Information
Exact persisted state captured during the failure:
{
"version": 1,
"normalBounds": {
"x": -21326,
"y": -21333,
"width": 0,
"height": 0
},
"isMaximized": true
}
At 150% scaling, those logical coordinates are approximately -31989, -32000 physical pixels, resembling Windows’ special minimized/off-screen coordinate. The zero size is invalid regardless of the source.
Structured log evidence (2026-09-21, America/Argentina/Buenos_Aires, UTC-03:00):
- 10:08:50.897 — sand.desktop.startup, outcome=failed, phase=window, error_code=SAND-E0601, hw_accel=false
- 10:08:50.897 — sand.desktop.renderer_lifecycle, state=gone, reason=launch_failed, exit_code=21, error_code=SAND-E0605
- 10:08:50.898 — sand.desktop.unclean_exit, error_code=SAND-E0610
- The same sequence repeated at 10:08:54.218 and 10:09:58.123.
- Six Crashpad dumps were created between 10:08:46 and 10:12:14. Windows Application Event Log had no matching Application Error entry.
- desktop-status.json retained PID 20364 after that process no longer existed, though the stale PID alone did not prevent a new process tree from starting.
Direct verification:
- With the invalid file present, no processes existed before launch. Launching created the full Electron process tree, but the responsive main process had no title and MainWindowHandle = 0.
- After moving only window-state.json to a backup, the same executable created a visible window titled Grok Bot with a non-zero native handle.
- This isolates the visible-launch failure to persisted desktop window state, rather than shortcut, authentication, Bot state, or Agent Computer state.
Proposed fix:
- Keep lastKnownGoodNormalBounds and update it only while the window is normal and visible.
- Do not persist geometry while minimized, destroyed, fullscreen, hidden, or transitioning during shutdown.
- Reject non-finite coordinates, non-positive or below-minimum sizes, and rectangles without meaningful overlap with any current display work area.
- If bounds are invalid, ignore both the rectangle and isMaximized, then use normal default bounds.
- Clamp valid partially off-screen bounds to the selected display work area.
- Add regression tests for this exact state, high-DPI scaling, disconnected secondary displays, and close events while maximized/minimized.
The overlap check should require at least a small visible area (for example 100x40 pixels) on a current work area before restoring or persisting the rectangle.
Unofficial Grok Bot 0.18 reconstruction with a similar defensive strategy (not the official source):
Workaround: fully terminate Grok Bot.exe, rename %APPDATA%\Grok Bot\window-state.json, and relaunch. Resetting the entire user-data directory is unnecessary.
Possibly related but apparently separate process-cleanup report:
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor