[Critical Bug] Copilot Web (Claude Family) injects invalid whitespace into code syntax (PowerShell & Python) #183048
Replies: 2 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
This has been a bug for at least two months. I do not understand why github hasn't addressed this glaring bug. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Copilot Feature Area
Copilot in GitHub
Body
[Critical Bug] Copilot Web (Claude Family) injects invalid whitespace into code syntax (PowerShell & Python)
Severity: Critical (Generated code is syntactically invalid and fails execution immediately)
Platform: https://github.com/copilot (Web Interface)
Affected Models: Claude Sonnet (4 & 4.5), Claude Opus (4.5), Claude Haiku (4.5).
1. Executive Summary
I have confirmed through extensive A/B testing that ALL Claude-based models currently available on the Copilot Web UI are consistently generating invalid code. The models inject random whitespace characters (U+0020) immediately after the dot operator (
.) in property accessors, method calls, and file extensions.This behavior is systemic across languages (confirmed in both PowerShell and Python) and renders the generated code unusable without manual regex cleanup. Models from the GPT, Gemini, and Grok families do not exhibit this issue using identical prompts.
2. Technical Analysis & Error Patterns
The tokenization or decoding process for Claude models seems to be hallucinating spaces around punctuation marks.
🔴 PowerShell Failures
$obj. propertyinstead of$obj.property$list. Add($item)instead of$list.Add($item)filename. jsoninstead offilename.json-Compress: $false(Syntactically risky/invalid)🔴 Python Failures
self. pid,metric. to_dict()instead ofself.pid,metric.to_dict()os. path. existsinstead ofos.path.existstimestamp: datetime(Double spaces introduced)f"... {self. pid}..."(Spaces injected inside f-strings)3. Evidence (Reproduction Proofs)
I have compiled "Shared Chat" links where I requested both PowerShell and Python scripts in the same session. The bug is present in every response from Claude models.
4. Control Group (Unaffected Models)
The following models generated syntactically correct code for the exact same prompts (no ghost spaces):
(Examples of successful generations available upon request, e.g., Gemini 2.5 Pro: https://github.com/copilot/share/8a195008-4140-8cf2-b003-2443646629c8)
5. Steps to Reproduce
self. attributeandjson. dump.6. Impact & Workaround
Haiku4.5.py
Opus4.5.py
Sonnet4.5.py
Sonnet4.py
Beta Was this translation helpful? Give feedback.
All reactions