Can't use Claude Opus 4.5 on opencode using Github Copilot #3928

Open
opened 2026-02-16 17:41:58 -05:00 by yindo · 11 comments
Owner

Originally created by @bhadraagada01 on GitHub (Dec 28, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

This is the error i get when im trying to use claude opus 4.5 with github copilot

⚙ invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text: {"filePath": "C:\\Users\\LENOVO\\Desktop\\ntfsnap\\ntfsnap.py".
Error message: JSON Parse error: Expected '}']
Image

and it takes ages to a response out of it and also and it gets endless stuck at preparing write

OpenCode version

1.0.204

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Powershell

Originally created by @bhadraagada01 on GitHub (Dec 28, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description This is the error i get when im trying to use claude opus 4.5 with github copilot ``` ⚙ invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text: {"filePath": "C:\\Users\\LENOVO\\Desktop\\ntfsnap\\ntfsnap.py". Error message: JSON Parse error: Expected '}'] ``` <img width="1920" height="1032" alt="Image" src="https://github.com/user-attachments/assets/f544594f-bee5-424c-96ec-f9c99e5fde4e" /> and it takes ages to a response out of it and also and it gets endless stuck at preparing write ### OpenCode version 1.0.204 ### Steps to reproduce _No response_ ### Screenshot and/or share link <img width="1920" height="1032" alt="Image" src="https://github.com/user-attachments/assets/cd7d0e95-1ffb-4152-a9f1-85aab0ecef8a" /> ### Operating System Windows 11 ### Terminal Powershell
yindo added the windowsbug labels 2026-02-16 17:41:58 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 28, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1803: [aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text
  • #5890: Incomplete JSON when writing out files
  • #2188: JSON parsing failed: Text

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.

@github-actions[bot] commented on GitHub (Dec 28, 2025): This issue might be a duplicate of existing issues. Please check: - #1803: [aws bedrock: anthropic opus 4.1] The arguments provided to the tool are invalid: Invalid input for tool write: JSON parsing failed: Text - #5890: Incomplete JSON when writing out files - #2188: JSON parsing failed: Text 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.
Author
Owner

@rekram1-node commented on GitHub (Dec 28, 2025):

can u run this and send me file?

opencode export > session.json

@rekram1-node commented on GitHub (Dec 28, 2025): can u run this and send me file? opencode export > session.json
Author
Owner

@bhadraagada01 commented on GitHub (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

@bhadraagada01 commented on GitHub (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](https://github.com/user-attachments/files/24364915/session-ses_49c3.json) [session-ses_49c3.md](https://github.com/user-attachments/files/24364914/session-ses_49c3.md)
Author
Owner

@aaronkyriesenbach commented on GitHub (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.

@aaronkyriesenbach commented on GitHub (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.
Author
Owner

@rekram1-node commented on GitHub (Jan 16, 2026):

@aaronkyriesenbach are u on windows too? Any chance u can send me a session export^^^

@rekram1-node commented on GitHub (Jan 16, 2026): @aaronkyriesenbach are u on windows too? Any chance u can send me a session export^^^
Author
Owner

@aaronkyriesenbach commented on GitHub (Jan 16, 2026):

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.

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:

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.

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!

@aaronkyriesenbach commented on GitHub (Jan 16, 2026): 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. ``` And here are the session logs from each system: [macos_session.json](https://github.com/user-attachments/files/24679827/macos_session.json) [linux_session.json](https://github.com/user-attachments/files/24679848/linux_session.json) Updating the above prompt to specify that Python code should not be written results in a successful write: ```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. Do not include any Python code in the file. ``` Here's the successful session: [working_session.json](https://github.com/user-attachments/files/24679902/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!
Author
Owner

@nalejandroveron commented on GitHub (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

@nalejandroveron commented on GitHub (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
Author
Owner

@tyrailleverett commented on GitHub (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 commented on GitHub (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.
Author
Owner

@tyrailleverett commented on GitHub (Jan 17, 2026):

Just an update, I came across this issue: https://github.com/anomalyco/opencode/issues/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.

@tyrailleverett commented on GitHub (Jan 17, 2026): Just an update, I came across this issue: https://github.com/anomalyco/opencode/issues/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.
Author
Owner

@echocyan commented on GitHub (Jan 27, 2026):

same issue, using github-copilot/claude-opus-4.5 will get endless stuck at preparing write

@echocyan commented on GitHub (Jan 27, 2026): same issue, using `github-copilot/claude-opus-4.5` will get endless stuck at preparing write
Author
Owner

@hyperbolic-c commented on GitHub (Jan 29, 2026):

same issue, but gpt-5.1-codex work.

Image
@hyperbolic-c commented on GitHub (Jan 29, 2026): same issue, but gpt-5.1-codex work. <img width="686" height="262" alt="Image" src="https://github.com/user-attachments/assets/6df67915-79fc-4e67-b861-df2b93f1e36b" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3928