Agent Panel: currently open file not used by AI
Summary
Many times (always?) the agent will needlessly look up and read the code module that's currently open.
Description
Steps to trigger the problem:
- Open code module and agent panel
- See code module is automatically included in context
- Give instructions to do something about something that is clearly shown in the code module currently open
Actual Behavior:
The agent tries to look up a relevant file and read its content, despite it being already open in the current editor (thus included in context)
Expected Behavior:
Agent tries to check if this is about the currently open module and tries finding other code ONLY if current context is not sufficient.
Zed Version and System Specs
newest Zed at this time, Mac M4, latest OS
I'm not 100% sure but it could be that you might have to click the file in the agent to actually add it. If I click it there is a close 'x' shown next to it.
Are you attaching the file?
When you first open the Agent Panel you'll see the current buffer listed as a suggestion:
But it won't actually be included as context unless you accept the suggestion:
The agent should always include the current file into the context and make it opt in to remove it. Current behaviour adds too much friction
The agent should always include the current file into the context and make it opt in to remove it. Current behaviour adds too much friction
Exactly.
The agent should always include the current file into the context and make it opt in to remove it.
+1 from me, at least as an option, I've been working in a monorepo with a lot of identically named files recently, and it's annoying having to type @/long/part/of/path.txt to find that path.txt and not /other/dir/path.txt. In general I found the usability of the old context menu a bit higher, but just this option would be good enough for me.
Hi there! 👋 We're working to clean up our issue tracker by closing older bugs that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and it will be kept open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, it will close automatically in 14 days. Thanks for your help!
Or even a separate command which accepts arguments and can open agent with current buffer attached, then we could also open current chat with all open buffers attached!