You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't use Claude Opus 4.5 on opencode using Github Copilot #6281
All of these report the same JSON parsing error when using the write tool with Claude Opus models (4.1 and 4.5). The error appears to be incomplete JSON being generated with missing closing braces.
Feel free to ignore if none of these address your specific case.
I am also running into this issue specifically for Python code - no issues if I work with projects in other languages or specify that the agent shouldn't write any Python code.
Nope, tested on both macOS and Linux. Here is a prompt that causes the error on both systems:
I'm building a deep learning model to denoise audio. I have ~5000 hours of each type, noisy and denoised, and many recordings are of the same content but not synchronized.
In a previous session, we designed:
1. An audio pairing pipeline (fingerprinting → coarse alignment via cross-correlation → fine alignment via DTW → quality verification)
2. A Conformer-UNet generator with attention-gated skip connections operating on complex spectrograms
3. A multi-scale PatchGAN discriminator
4. A hybrid training strategy using paired data (supervised losses) and unpaired data (adversarial losses)
5. A phased training schedule
Please write a comprehensive markdown guide to `$HOME/audio_enhancement_guide.md` that includes:
- Complete preprocessing pipeline with technical details
- Audio pairing and alignment procedures
- Model architecture specifications
- Training configuration and loss functions
- Verification steps to validate preprocessing quality
- Verification steps to validate training efficacy
- Evaluation metrics and interpretation
- Troubleshooting guide
Make it detailed enough to serve as a complete implementation reference.
Updating the above prompt to specify that Python code should not be written results in a successful write:
In a previous session, we designed:
1. An audio pairing pipeline (fingerprinting → coarse alignment via cross-correlation → fine alignment via DTW → quality verification)
2. A Conformer-UNet generator with attention-gated skip connections operating on complex spectrograms
3. A multi-scale PatchGAN discriminator
4. A hybrid training strategy using paired data (supervised losses) and unpaired data (adversarial losses)
5. A phased training schedule
Please write a comprehensive markdown guide to `$HOME/audio_enhancement_guide.md` that includes:
- Complete preprocessing pipeline with technical details
- Audio pairing and alignment procedures
- Model architecture specifications
- Training configuration and loss functions
- Verification steps to validate preprocessing quality
- Verification steps to validate training efficacy
- Evaluation metrics and interpretation
- Troubleshooting guide
Make it detailed enough to serve as a complete implementation reference. Do not include any Python code in the file.
I am having the same issue with Claude Sonnet 4.5, Claude Haiku 4.5 using Github Copilot. However, I am not using Python. I am getting the error just trying to create a markdown file. I am on the latest opencode and have removed my Github Copilot auth and re-auth. Still same issue. I should point out I am on Mac.
Just an update, I came across this issue: #5890, which suggested the error occurs when the model is trying to generate too large of a file, which lines up with the file I was trying to generate. Otherwise, the models work just fine, so it seems when the file is too large (possibly overfilling the smaller context window that Github Copilot provides ) then this error is thrown.
Activity
github-actions commentedon Dec 28, 2025
This issue might be a duplicate of existing issues. Please check:
All of these report the same JSON parsing error when using the write tool with Claude Opus models (4.1 and 4.5). The error appears to be incomplete JSON being generated with missing closing braces.
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 28, 2025
can u run this and send me file?
opencode export > session.json
bhadraagada01 commentedon Dec 29, 2025
this is only happening when i try with python related project, it works fine with my ts project but ill still give you the session.json
session-ses_49c3.json
session-ses_49c3.md
aaronkyriesenbach commentedon Jan 16, 2026
I am also running into this issue specifically for Python code - no issues if I work with projects in other languages or specify that the agent shouldn't write any Python code.
rekram1-node commentedon Jan 16, 2026
@aaronkyriesenbach are u on windows too? Any chance u can send me a session export^^^
aaronkyriesenbach commentedon Jan 16, 2026
Nope, tested on both macOS and Linux. Here is a prompt that causes the error on both systems:
And here are the session logs from each system:
macos_session.json
linux_session.json
Updating the above prompt to specify that Python code should not be written results in a successful write:
Here's the successful session:
working_session.json
Hopefully this is helpful! Please let me know if there's any other info that I can provide to help troubleshoot. Thanks for your help with this!
nalejandroveron commentedon Jan 17, 2026
It seems that the error is always the same, the model forgets to close the JSON? I'm seeing the same now in MacOS python too
tyrailleverett commentedon Jan 17, 2026
I am having the same issue with Claude Sonnet 4.5, Claude Haiku 4.5 using Github Copilot. However, I am not using Python. I am getting the error just trying to create a markdown file. I am on the latest opencode and have removed my Github Copilot auth and re-auth. Still same issue. I should point out I am on Mac.
tyrailleverett commentedon Jan 17, 2026
Just an update, I came across this issue: #5890, which suggested the error occurs when the model is trying to generate too large of a file, which lines up with the file I was trying to generate. Otherwise, the models work just fine, so it seems when the file is too large (possibly overfilling the smaller context window that Github Copilot provides ) then this error is thrown.
EchoCyan commentedon Jan 27, 2026
same issue, using
github-copilot/claude-opus-4.5will get endless stuck at preparing writehyperbolic-c commentedon Jan 30, 2026
same issue, but gpt-5.1-codex work.
github-actions commentedon Mar 31, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.