BlogsCursorShadow Workspaces for AI Code Iteration

Shadow Workspaces for AI Code Iteration

Shadow Workspaces for AI Code Iteration

3
posts
2023–2024

Introduced shadow workspaces to enable AI code iteration within a development environment without affecting the user's primary coding experience. This involves creating isolated, hidden instances of the development environment to allow AI agents to receive language server protocol (LSP) feedback and execute code independently. The initial implementation uses a hidden Electron window, with future plans for a kernel-level folder proxy. This post outlines future research directions for AI programming, including better context retrieval using a custom reranker model, developing a 'copilot for edits' for small code changes, creating constrained, in-flow agents for engineering tasks, passive and active bug-finding capabilities, enabling larger edits to files and directories, and scaling indexing infrastructure to handle billions of vectors and hundreds of thousands of codebases. Future ideas include 'time warp' for predicting code changes, deep codebase understanding, a 'reader mode' for effortless code comprehension, a 'pseudo-code mode' for editing outlines, and automatic stack trace debugging.

2024

Iterating with shadow workspaces · Cursor

9/2/2024

Designed and implemented the 'shadow workspace' concept to allow AI agents to iterate on code within a development environment. This involves creating an independent, hidden instance of the editor to process AI edits and gather LSP feedback (lints, go-to-definition) without impacting the user's active editing session. Explored and discarded simpler approaches like TextModel copying due to independence issues. The current implementation uses a hidden Electron window and inter-process communication (IPC) between renderer and extension host processes, with plans to leverage gRPC and buf for communication. Also discussed the future goal of a kernel-level folder proxy for enhanced performance and isolation.

More problems · Cursor

5/26/2024

This post outlines future research directions for AI programming, including next action prediction, improving edit quality through scaled inference, optimizing context retrieval for codebases (including multi-hop context), and enhancing bug detection and debugging capabilities. It proposes research into action prediction models, advanced inference techniques for larger edits, novel retrieval methods for codebases, and improved debugging tools that track runtime information.

2023

Our problems · Cursor

10/13/2023

This post details several new problems and future directions for Cursor's AI-powered coding capabilities. It introduces the concept of a custom and fast reranker model to improve context retrieval for LLMs, aiming to filter down 500k tokens to the most relevant 8k. It also discusses the need for a 'copilot for edits' to handle small code changes, the development of constrained, in-flow agents for engineering tasks (starting with folder-level agents), and both passive and active bug-finding mechanisms. Furthermore, it addresses the challenge of enabling larger edits to files and directories, requiring smart model capabilities and real-time diff presentation. The post also highlights the significant scaling challenges in indexing, mentioning 1.4 billion vectors and 150 thousand codebases indexed, and the need for a custom indexing system. Future ideas include 'time warp', deep codebase understanding, 'reader mode', 'pseudo-code mode', and automated stack trace debugging.