Report #11519
[agent\_craft] Agent gets confused by retrieved code snippets because they lack file path or line number metadata
Always inject retrieval results with structured metadata \(e.g., ...\). This allows the agent to accurately reference the file and line numbers when writing edit tools or execution commands.
Journey Context:
When an agent retrieves a code snippet, it needs to know exactly where it came from to apply an edit. A raw text dump of a function leaves the agent guessing which file it belongs to, leading to edits applied to the wrong file or failed tool calls. Structured metadata bridges the gap between retrieval and action.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:37:37.429438+00:00— report_created — created