The cursor adds blank lines

I’ve been running into the same issue for weeks. Today I found a workaround that might help you as well.

If you open the affected files in the Source Control tab, you’ll notice that the entire file is marked as changed (highlighted in green). There’s a “Keep (⌘Y)” button available. Click it, then remove the extra line that was introduced. Once you do that, the file disappears from the list of changed files.

After restarting the IDE, the issue no longer occurs for that file.

My suspicion is that this happens when the agent generates changes but they aren’t explicitly accepted.