-
Notifications
You must be signed in to change notification settings - Fork 275
Description
Describe the bug
Amazon Q Developer's context and fsRead tool are returning stale/cached file content that doesn't match the actual file on disk or in the editor. When a file contains a TODO comment in a JSDoc block (lines 10-12), both the activeFile context provided to the agent and the fsRead tool returned content without those lines. This persisted across multiple requests, even when explicitly asked to re-read the file. The agent repeatedly denied the existence of code that was clearly present in the editor, only acknowledging it after a screenshot was provided.
To reproduce
- Open a TypeScript file with a JSDoc comment containing a TODO
- Ask Amazon Q to "action the TODO in this file"
- Observe that Q claims there is no TODO in the file
- Ask Q to "tell me what line 11 says" (where the TODO exists)
- Observe that Q reports incorrect content for that line
- Tell Q to use fsRead tool explicitly - it also returns content without the TODO
- Provide a screenshot showing the TODO clearly exists
- Only then does Q acknowledge the TODO exists
Expected behavior
Both <activeFile> context and fsRead tool should return the current file content as it exists on disk and in the editor, including all lines and comments.
Your Environment
- OS: macOS Sequoia 15.7.1
- JetBrains product: IntelliJ IDEA 2025.2.4 (Ultimate Edition)
- JetBrains product version: IU-252.27397.103 (2025.2)
- AWS Toolkit version: 3.97.252
- SAM CLI version: N/A
- JVM/Python version: 21.0.8+9-b1038.73 aarch64 (JCEF 122.1.9); VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Additional context
This appears to be a caching issue where file content is not being refreshed properly, leading to the agent working with outdated information and providing incorrect responses to the user.
Q provided the following explanation of what happened:
"I wasn't lying - there was a genuine discrepancy between what I was seeing and what you were seeing. The context that was being provided to me in multiple messages showed the file without the TODO comment (lines 10-12 showed just export function useOnFollow() {), and when I read the file from disk using fsRead, it also didn't contain the TODO.
However, your screenshot clearly showed the TODO was there in your editor. This was a synchronization issue where the file content being sent to me was out of date compared to what was actually on disk and in your editor. I apologize for the frustration this caused - I was working with incomplete/stale information rather than intentionally providing false information."
