Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Industry Insights
8 min read

Grok Build's Agent Window Rewrite: Offloading Computation for 3x Faster Clicks

Grok Build (formerly Cursor) rewrote its Agents Window to isolate workspace events, offload heavy diffing to Web Workers, and enforce process boundaries via the Dune framework, reducing click latency from 74ms to 24ms but revealing that final content rendering still depends on data readiness and frame timing.

On November 30, Cursor's desktop app was renamed Grok Build . The rewritten Agents Window entered public beta the same day, with a gradual rollout planned over the following weeks. The announcement specifically noted that switching long conversations previously sometimes took several seconds — a symptom the rewrite aims to eliminate.

Two Tasks in One Window

Grok Build allows multiple agents to run concurrently: a local agent editing files in a Git worktree, and a cloud agent dispatched via /in-cloud running in its own virtual machine and branch. The user selects tasks from a single sidebar, opening the corresponding conversation and diff. Cursor 3 introduced a tiled layout in April 2024 so two tasks could be viewed side by side.

Cursor 3.1 scoped extension events — file changes, diagnostic updates — to the workspace rather than to individual tabs. A workspace can contain multiple sessions that still share the same set of files. Tab naming was also changed: the client now only considers tabs visible to the current agent, so two projects can both have an index.ts tab without name conflicts. File notifications follow the workspace; tab names follow the active task. This narrower scope reduces unnecessary work on the inactive side.

Further, 3.1 limited local diff fetching to cut CPU and network spikes. It also fixed UI flicker and freezes when long conversations streamed large code blocks and diffs, reducing dropped frames during streaming by approximately 87% .

Moving Computation Off the Main Thread

In Electron's renderer process, the chat UI's JavaScript competes with input, scrolling, and painting for the main thread. A synchronous chunk of work processing incoming output can block the Enter key callback. Cursor 3.1's changelog recorded this symptom: in long conversations, pressing Enter to ask a follow-up could stall the window for over a second.

The November announcement confirmed that heavy work was moved to dedicated worker threads. While the announcement did not list specific functions, the Electron documentation suggests using a Web Worker to compute diff lines and send results back via postMessage(). Ordinary objects are copied across this boundary, and the worker cannot touch the DOM directly. The size of the transferred data and the number of lines the UI must update still affect when the user sees the result.

There is a crucial difference between setTimeout (deferring work on the same thread) and a separate thread doing the work concurrently. The former only reorders execution; the computation still occupies the main thread when it runs. Lauren Tan's AI Engineer talk described how the old Cursor accumulated timers by mixing VS Code's command-based state updates with React's state-driven rendering. Agents would delay callbacks and leave comments explaining the wait, a pattern that propagated through the codebase. Frequent timer creation and destruction caused garbage-collection pauses users could feel.

The new window decouples from VS Code's internal implementation. The desktop and web versions now share the same foundation, allowing the team to evolve the agent window independently while preserving the ability to jump from a diff into the full IDE for hands-on coding.

Enforcing Boundaries After the Split

Tan also recounted another old Cursor mistake: renderer-process code imported a module originally written for the main process. Although the module lived in the main-process directory, a plain import only created a code dependency. When the renderer called a heavy function from that module, the work fell back onto the UI thread, causing visible jank.

This lesson shaped the design of the Dune client framework used for Grok Build. Dune places main-process code and renderer-process code in two separate top-level directories and uses dependency-graph analysis and lint rules to forbid cross-directory imports. Directory separation makes the boundary visible; lint checks enforce it in every subsequent change. This is a compile-time guarantee. At runtime, which worker thread picks up a given computation is a separate decision.

Paul began the new window prototype in late September using Dune. According to Paul and Tan's public retrospectives, the rest of the team joined, and most of the rewrite was completed in a single team project. From start to feature parity with the old window took about six weeks . With the lint layer in place, code reviews for the new window no longer needed manual vigilance for cross-boundary imports.

Benchmark: Click Latency vs. Content Visibility

Curtis Pyke (Kingy AI) tested on an M4 Pro MacBook Pro running Grok Build 3.32.2. He prepared two saved conversations, each with a 100-line reply ending in a unique marker, so switching required no new model generation.

Click event median (Chromium performance panel, 8 switches each): old window 74 ms, new window 24 ms.

Click to last line visible (median interval, 12 switches each): old window 75–97 ms, new window 120–157 ms.

Two measurement rounds were needed. In the first round, the new window's click event took only 21 ms, but Chromium's subsequent screenshot still showed the old conversation; the new marker first appeared at 215 ms. The gap between performance-panel screenshots was too large to know when the content actually painted. Pyke then fixed the window size, disabled the diff panel, and used an external screen recorder. For each switch he identified the adjacent frames where the last line was absent and then present, yielding the intervals above.

These results give a more useful reference than "3x responsiveness." On this hardware and these conversations, the new window processes the click faster, yet the old window shows the final line earlier. Freeing the rendering thread only explains why the click gets handled sooner. To understand the full picture, one would trace the click, the target session's data readiness, and the final paint on a single timeline. Even with fast frames, the screen may show only a loading indicator while the user waits for the actual error message.

Real-World Usage and Conclusion

In May, long-running Codex sessions highlighted the need to pick up unfinished work — retrieving the code and verification results from the previous session. In the Agents Window, re-engagement may be only seconds apart. Pyke tested resuming an old session: he had the agent write tests for an uncommitted function in the worktree, then reviewed the diff and ran two unit tests. This workflow is closer to "I'm back to that task" than merely watching the sidebar light up.

Returning to the opening cloud-test scenario: if the only problem was fetching too many diffs, fetching fewer helps (the April team did exactly that). But once the window must manage many independent tasks long-term, background computation blocking input, the UI waiting for editor state changes, and imports dragging heavy work back onto the main thread — these problems recur across features.

The rewrite's value lies in letting the team evolve the task-pickup and result-view window independently, while keeping the full IDE for the moment hands-on coding is needed.

References

[1] Grok Build, Cursor is now Grok Build (https://grok.com/news/cursor-is-now-grok-build)

[2] Michael Truell, Sualeh Asif, Meet the new Cursor (https://cursor.com/blog/cursor-3)

[3] 多略的功导, Cursor正式更名Grok Build,凭什么挑战Claude? (https://mp.weixin.qq.com/s/G-GMqGiHBbNll3wZXdAz2A)

[4] Grok Build, Agents Window (https://docs.grok.com/build/agents-window/agent/agents-window)

[5] Grok Build, Agents Window worktrees (https://docs.grok.com/build/agents-window/configuration/worktrees)

[6] Cursor 3.1, Tiled Layout and Upgraded Voice Input in the Agents Window (https://cursor.com/changelog/3-1)

[7] Electron, Performance, Blocking the renderer process (https://www.electronjs.org/docs/latest/tutorial/performance#4-blocking-the-renderer-process)

[8] MDN, Using Web Workers (https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)

[9] Lauren Tan, All Code Is Slop (Except Mine), AI Engineer talk, ~5:00-9:40 (https://ai.engineer/talks/O_zcc6Xl12g-all-code-is-slop-except-mine)

[10] Paul, retrospective on prototype start in late September (https://x.com/paulr_co/status/2127619306955616689)

[11] Lauren Tan, on reusing Dune and development cycle (https://x.com/poteto/status/2127474814063645003)

[12] Curtis Pyke, Cursor is now Grok Build. We tested its rewritten Agents Window (https://kingy.ai/blog/cursor-grok-build-agents-window-test/)

[13] Jeremy Wagner, Manually diagnose slow interactions in the lab (https://web.dev/articles/manually-diagnose-slow-interactions-in-the-lab)

[14] 架构师, 来自 Codex 官方团队的分享:如何把 Codex 用到更深一层 (https://mp.weixin.qq.com/s?__biz=MzAwNjQwNzU2NQ==∣=2650409406&idx=1&sn=2acb13da5ebe84602bc93fabc4812756)

Two tasks running, one reviewing changes
Two tasks running, one reviewing changes
Long computation meets a click
Long computation meets a click

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion