I set an agent to do something (usually building a plan)
I start typing in the dialogue box of another agent
The first agent finishes
And that forcefully transforms the window into that finished agent, while I’m mid-typing
Most of the time this is annoying, but worst case scenario that could mean me sending a partial command to a wrong agent
Hey, thanks for the report. This is a known bug, it’s focus stealing when one of the parallel agents finishes. We’ve already fixed some cases bit by bit (plans, terminal, worktrees), but the specific case where one agent finishes and steals focus from another agent’s input is still happening. I can’t share an ETA for the fix.
If you run into other focus-related cases (for example, focus jumps during streaming), please post them in this thread or file a separate report. It helps us separate the different cases.
Still seeing this in the Agents Window (Glass). Looked through local logs + the workbench bundle to narrow it down.
Logs (renderer.log): finish is only logged as wakelock release — there’s no explicit “select agent / steal focus” log after that, so the UI switch isn’t instrumented. Around the same time we also see Glass tab / Diff tab activity.
If finishing agent ≠ active agent → hasUnreadMessages = true (badge only — intentional non-focus)
onComposerSettled → composer-done
System notifications only fire when !hostService.hasFocus, and composer.openComposerFromNotification only runs on click. There is still no cursor.agent.focusOnComplete setting.
So the remaining steal looks like a side effect of finish (canvas/Diff/plan surfacing, or setLastFocusedComposerId / selectedComposerIds reordering when views update) rather than an intentional “focus on complete” feature — same case Dean called out here: agent finishes and steals focus from another agent’s input.
Happy to attach a tighter repro + more log snippets if useful.
Hey, thanks for the detailed write-up. The timeline from renderer.log is especially helpful.
Yep, this is the same known case I mentioned above. The agent exits and steals focus from another agent’s input. We fixed a few related variants separately (plans, terminal, worktrees), but this one in the Agents Window and Glass is still open. I can’t share an ETA for a fix yet.
I’d be happy to take you up on the offer for a tighter repro and extra logs. The more compact and repeatable the steps are, the better. Also, please add two things:
the exact Cursor version from Help > About
your OS and OS version
I’ll attach this to the tracked issue as a fresh confirmation on the latest version. If you notice other focus-related cases, like focus jumping during streaming or when the browser or changes tab opens on finish, please start a separate thread for those so we can track each variant more easily.
That’s the same build I was on when I posted the timeline above (Jul 28). Still seeing the focus steal there.
Minimal repro
Open Agents Window (Glass).
Start Agent A on a short-but-not-instant task (enough time to switch away while it’s still running).
While A is running, open/switch to Agent B and put the caret in B’s input — start typing.
Let A finish (ComposerWakelockManager → generation-ended for A).
Expected: stay in B’s input; A gets unread/badge only. Actual: active agent / focus jumps to A mid-typing (can send a partial prompt to the wrong agent).
Optional amplifier: have A (or a subagent) produce UI on finish (Diff / Changes / canvas). In my log, DiffTabContent activity showed up between the two generation-ended lines — I don’t think Diff is required, but it may make the steal more obvious.
Log anchors (same session as my earlier post; UUIDs truncated; sanitized renderer.log excerpts attached)
No follow-up selectAgent / “steal focus” log — the switch isn’t instrumented
Separately: I haven’t filed streaming / browser-tab / Changes-tab focus jumps as their own threads yet — will do that if I hit a clean variant. cursor-focus-steal-logs.zip (3.3 KB)
Thanks, this is exactly what we needed. I’ve got the repro, version, OS, and logs, and cursor-focus-steal-logs.zip is also there.
I’ll attach this as a fresh confirmation on the latest version (3.13.25 / macOS 26.5.2, Agents Window Glass). Your note that the UI switch itself isn’t logged is helpful. We only see generation-ended from the wakelock, with no explicit selectAgent. That helps narrow down where the focus steal is coming from. It’s the same known issue I mentioned above: a finishing agent steals focus from the input field of another agent. I can’t give an ETA yet.
For the other cases (focus jump during streaming, opening the browser or the Changes tab on finish), yep, please file them as separate threads like we agreed. It’s easier to track each case on its own. I’ll post here if there’s an update on this one.