Grok Bot 0.57.1 on Windows saves a 0x0 off-screen window state and cannot reopen

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

  1. Run Grok Bot 0.57.1 on Windows with display scaling set to 150%.
  2. Use the app normally with its window maximized.
  3. Close the Grok Bot window using the title-bar close control.
  4. Launch Grok Bot again from Start, a shortcut, or %LOCALAPPDATA%\Programs\Grok Bot\Grok Bot.exe.
  5. Observe that the Electron process tree starts, but no Grok Bot window becomes visible.
  6. 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:

  1. Keep lastKnownGoodNormalBounds and update it only while the window is normal and visible.
  2. Do not persist geometry while minimized, destroyed, fullscreen, hidden, or transitioning during shutdown.
  3. Reject non-finite coordinates, non-positive or below-minimum sizes, and rectangles without meaningful overlap with any current display work area.
  4. If bounds are invalid, ignore both the rectangle and isMaximized, then use normal default bounds.
  5. Clamp valid partially off-screen bounds to the selected display work area.
  6. 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

Hey @francotgs, thanks for the detailed report.

Two separate things are going on here. The window-state.json you captured is real and I’ve flagged it to the team: the app is recording the position of a minimized window as if it were the normal one. On its own, though, that file is ignored on the next launch (the app falls back to its default window size), so it is not what stops the window from appearing.

The launches that produce no window are the ones in your log with exit_code=21. That code means Windows refused to let the app start its sandboxed window process. Based on your report it sounds like the window is opening normally again!

Have you reproduced the issue since it happened the first time?

Hey Colin, thanks for looking into this.

Yes, I reproduced it again and isolated a consistent launcher-context difference.

A normal mouse click on the original icon launches the correct signed executable from the regular desktop Explorer process, with no arguments. The main process starts Crashpad and several utility processes, but the window process dies almost immediately, no window is created, and all Grok Bot processes exit. A failed manual launch also created a new approximately 34.8 MB Crashpad dump.

This is not limited to reopening too quickly. Before the monitored test, Grok Bot had been closed for several minutes and process monitoring confirmed that no Grok Bot processes were running. The original icon still failed.

I created a workaround that starts the exact same executable through a hidden, non-elevated PowerShell process. It also checks that no previous Grok Bot processes remain, but during the A/B comparison that condition was already satisfied immediately, so its success cannot be attributed to additional waiting.

I manually tested repeated open/close cycles, including with the workaround pinned to the taskbar, and every launch succeeds. During the same Windows session, with no reboot or application-state change between tests, the original icon continues to fail.

The reproducible A/B result is therefore:

  • Explorer.exe -> Grok Bot.exe: fails

  • Explorer.exe -> powershell.exe -> Grok Bot.exe: succeeds

The window-state file was valid during these failures. This strongly suggests that the Windows launcher or inherited process/token context is relevant to the exit_code=21 sandbox failure. Could the team capture the underlying Win32 error for SBOX_ERROR_SET_THREAD_TOKEN, or compare the renderer launch token when the parent is Explorer versus PowerShell?

I can provide the Crashpad dumps privately if useful.

Hey @francotgs!

Have a look over here.

I think this issue is affecting more than just Cursor/Grok Bot, and ultimately has to do with some Windows security updates affecting Chromium. I need to dig a bit more.

Hey @Colin , thanks for looking into this!

I checked the Windows updates on my device: KB5124008 was installed on September 14 and KB5129241 on September 18. It’s running Windows 11 25H2, build 26200.9448; KB5129195 is not installed.

That seems consistent with the Windows update connection you mentioned. The original Grok Bot launch still fails on my device with KB5129241 installed, though the alternative launcher is working well for me in the meantime.

Thanks again for digging into it.