IDE Context Leak: Active Document Desyncs from Assigned Workspace Across Multiple Open Projects

There is a critical context synchronization issue when a user has multiple projects open simultaneously. The AI assistant receives mismatched context metadata, where the assigned workspace (user_information) remains locked to one project, but the Active Document context leaks from another concurrently open project.
Steps to Reproduce:

  1. Open Project A in the IDE and interact with the AI assistant (this locks the user_information workspace to Project A).

  2. Open Project B in a separate IDE window.

  3. Switch focus to Project B, open a file, and make it the Active Document.

  4. Send a prompt to the AI assistant from Project B.

Expected Behavior: Both the assigned workspace and the Active Document passed to the AI assistant should correspond to the currently focused project (Project B).

Actual Behavior: The AI assistant receives conflicting context metadata:

  • The system’s assigned workspace (user_information) is still stuck on Project A.

  • The Active Document metadata is captured from Project B.

Impact: This context mismatch causes extreme confusion for the AI assistant. If the AI relies on the Active Document to determine the working directory, it may incorrectly apply code modifications intended for Project A into Project B’s files (or vice versa), leading to severe cross-project code corruption and unintended file modifications outside the designated workspace.