Agent receives unrelated “focused file / recently viewed” context without chat isolation

Where does the bug appear (feature/product)?

Cloud Agent (GitHub, Slack, Web, Linear)

Describe the Bug

在对话 A(查 chat c31897…)时,编辑器焦点在另一案目录 279373…;Agent 收到系统注入的 Recently viewed / Currently focused,误当成用户意图并答错案。用户消息未提及该路径。希望:IDE 上下文与对话任务隔离,或焦点文件不作为默认强信号。
Agent treats “Currently focused file / Recently viewed” as user intent and answers about the wrong case (279373…). The user cannot see this injected context in the chat UI, so the mix-up looks unexplained.

Steps to Reproduce

Open Cursor with a monorepo that has two unrelated investigation folders, e.g.
tmp/c31897…/(本案)and tmp/279373…/(另一案).
Start Chat / Agent conversation A and work only on case c31897… (read logs, write issue report). Do not mention the second case ID in any user message.
In the editor, open a file from the other case (e.g. tmp/279373…/funcsea_deploy1.json) and leave it as the focused / active tab. Optionally leave both cases in Recent files.
In conversation A, ask a follow-up that is clearly about the current chat task only, e.g.
“客户遇到哪些问题?哪些已经有结论了?”
(no path, no second chat_id).
Observe the Agent reply: it introduces / mixes the focused file’s case (279373…) even though the user never referenced it.

Expected Behavior

Agent answers only based on conversation A’s task / attachments / prior turns for c31897…. Editor focus is at most optional context, not a reason to switch cases.

Operating System

MacOS

Version Information

Cursor Version: 3.12.30
Release Track: Stable
Commit: 63a2996a10d9
OS: macOS 15.6 (Build 24G84)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey there!

This is expected behavior rather than a bug. In the editor, Cursor gives the agent a short list of your open and recently-viewed file paths (just the paths, not the contents) so it has a sense of what you’re working on. The model is told this list may not be relevant, but as you saw, it can still over-weight the focused file and drift to the wrong case. We include it on purpose: without it, the agent often loses track of what you’re looking at and starts touching unrelated code, so it’s a trade-off rather than an oversight.

A few reliable ways to keep the other case from bleeding in:

  1. Use a separate window/workspace per investigation. This is the cleanest fix for your two-case monorepo setup, since this ambient context is scoped to the window. A chat about c31897… won’t pick up 279373… if that case is open in a different window.
  2. @-mention the exact files or folders that matter. Explicit context outranks the ambient open/recent list, so pointing the agent at the c31897… files keeps it anchored to the right task.
  3. Close unrelated tabs (or focus a relevant file) before sending a follow-up. The focused and open files are the strongest ambient signal.
  4. Add a User Rule (Cursor Settings → Rules) such as “Only consider my open or focused files if I explicitly reference them.” This is a soft nudge rather than a hard block, but it helps.