Skip to content

AI: Agent panel doesn't automatically capture file context when pasting code #42972

@ddoemonn

Description

@ddoemonn

Summary

Screen.Recording.2025-11-18.at.16.25.43.mov

Description

Steps to trigger the problem:

  1. Copy code from a file in the editor (e.g., a JSX/TSX component)
  2. Paste it into the AI assistant panel
  3. Observe that the AI doesn't automatically receive the file path and line number context

Expected Behavior:
When pasting code into the assistant panel, it should automatically detect and display the source file and line numbers (e.g., "x main-layout.tsx 10-18"), similar to how Cursor's AI assistant works.

Actual Behavior:
The code is pasted as plain text without any file context. The AI doesn't know which file the code came from, requiring manual explanation or file referencing using @ mentions.

Model Provider Details

  • Provider: Github copilot chat
  • Model Name: Claude Sonnet 4.5
  • Mode: Agent Panel
  • Other Details: This affects the quality of responses as the AI lacks context about where the code exists in the project structure.

Zed Version and System Specs

Zed: v0.212.6 (Zed)
OS: macOS 26.1
Memory: 16 GiB
Architecture: aarch64

If applicable, attach your Zed.log file to this issue.

No response

Metadata

Metadata

Assignees

Labels

area:aiImprovement related to Agent Panel, Edit Prediction, Copilot, or other AI featurescommunity champion

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions