-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
Description
Describe the bug
When using GPT-5 model, file edits frequently result in thousands of empty lines being added to the file. The changes show massive line additions (e.g., +99991 lines) where 99%+ of these lines are literally just empty lines with no content.
The behavior is:
- Request GPT-5 to edit a file
- The model makes the requested changes
- BUG: The file is padded with thousands of empty lines
- Git shows massive additions (e.g., +99991) that are almost entirely empty lines
- The actual code changes are correct, but buried in empty whitespace
Note: This issue does NOT occur with GPT-4 models (gpt-4o, gpt-4-turbo). It appears to be specific to GPT-5 model behavior.
Affected version
Version: 0.0.334
Commit: 26896a6
Steps to reproduce the behavior
- Start Copilot CLI with
copilot - Ensure you're using GPT-5 model
- Request any file edit, for example:
update README.md to add installation instructionsedit CONTRIBUTING.md to clarify the PR processmodify docs/api.md to document the new endpoint
- Observe the file changes in git
- Observe: The diff shows massive additions like
(+99991)where the vast majority are empty lines
Expected behavior
File edits should only include the actual code changes without padding the file with thousands of empty lines. The behavior should match GPT-4 models which correctly edit files without adding spurious whitespace.
Example:
- Expected:
README.mdwith 150 lines, adding 20 lines of documentation = 170 lines total - Actual with GPT-5:
README.mdwith 150 lines, adding 20 lines of documentation + 99,830 empty lines = 100,000+ lines total
Additional context
System Information
- OS: macOS (Darwin 24.6.0)
- Architecture: ARM64 (Apple Silicon)
- Terminal: Apple Terminal
- Shell: zsh
- Node version: v23.5.0
- Copilot CLI version: 0.0.334 (Commit: 26896a6)
Model Information
- Affected Model: GPT-5