aws / aws/aws-toolkit-vscode

Subject: Amazon Q in VS Code Truncates Active File Content in Chat Interface

Open
#7,416 1 comment 3 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

Description (generated by Q):
I'm experiencing an issue with Amazon Q in VS Code where the active file content is consistently being truncated when displayed in the chat interface. While I can see the complete file in my VS Code editor, Amazon Q only receives and displays a portion of the file (approximately 255 lines), cutting off mid-line. This prevents Amazon Q from properly analyzing and working with the complete file content.

Steps to Reproduce:
1. Open VS Code with Amazon Q extension installed
2. Open a shell script file larger than 255 lines (in my case, a file with ~450 lines)
3. Engage with Amazon Q about the file
4. Observe that Amazon Q only sees a truncated version of the file (in my case, truncated at line 255 with "MONTH=$(date +%m)" and "D")

Expected Behavior:
Amazon Q should receive and be able to work with the complete file content, regardless of file size.

Actual Behavior:
Amazon Q only receives a truncated version of the file, cutting off at approximately line 255. The truncation appears to happen consistently at the same point in the file.

Environment Details:
- macOS version: [Sequoia 15.5]
- VS Code version: [1.100.2 universal]
- Amazon Q extension version: [1.70.0]

Impact:
This issue significantly impacts productivity as it:
1. Prevents Amazon Q from analyzing the complete file
2. Causes confusion when Amazon Q makes recommendations based on incomplete information
3. Requires workarounds like using fsRead tool to access the complete file content

Additional Information:
- The issue persists across multiple sessions and file reopens
- The truncation point appears to be consistent for the same file
- Using the fsRead tool with Amazon Q shows the complete file content, confirming the file itself is intact
- The issue appears to be with how the file content is transmitted to Amazon Q, not with VS Code's display of the file

Contributor guide

Open the contributing guide

Research direction

Reproduce this with the Amazon Q VS Code extension on macOS using a shell script longer than 255 lines, then compare the active-file chat context with the complete content returned by the fsRead tool. Trace how the active file is transmitted to Amazon Q and verify that the full file, including content after line 255, is available in chat.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, typescript, vscode
Domain
ai, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.