Repository navigation
[Windows Desktop] New Terminal always fails with PTY spawn failed (across multiple versions) #24463
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktopwindows
Description
Description
Summary
On Windows, OpenCode Desktop can launch normally, but creating a new terminal always fails.
Logs repeatedly show: service=server error=PTY spawn failed.
Environment
- OS: Windows 11 (
10.0.26200) - Desktop app channel: winget package
SST.OpenCodeDesktop - Versions tested:
1.14.251.14.201.14.19
- Project paths tested:
E:\opencodeH:\opencode
Expected behavior
Clicking New Terminal should open a functional terminal tab.
Actual behavior
No terminal opens. Desktop log repeatedly outputs:
service=server error=PTY spawn failed
Reproduction steps
- Start OpenCode Desktop on Windows.
- Open a workspace/project.
- Click New Terminal.
- Observe failure (no terminal tab created).
- Check logs under:
C:\Users\Administrator\AppData\Local\ai.opencode.desktop\logs\
Log evidence
Latest reproduced log:
C:\Users\Administrator\AppData\Local\ai.opencode.desktop\logs\opencode-desktop_2026-04-26_17-56-11.log
Key lines (example):Spawning sidecar on http://127.0.0.1:64872No CLI installation found, skipping syncERROR ... service=server error=PTY spawn failed failed(repeated many times)
Issue reproduces similarly in:..._17-19-14.log..._17-16-36.log..._17-14-42.log..._17-12-58.log..._17-09-24.log
Troubleshooting already performed
I have already done all of the following, with no effect:
- Config cleanup
- Removed unsupported/invalid config keys and bad plugin entries.
- Desktop state reset
- Reset
opencode.workspace*.dat - Reset
opencode.settings.datandopencode.global.dat(with backup)
- Reset
- Environment variable cleanup
- Removed custom
SHELL/terminal overrides.
- Removed custom
- Version rollback tests
1.14.25->1.14.20->1.14.19- Same
PTY spawn failedbehavior in all versions.
- System integrity repair
sfc /scannow(found and repaired corrupted files)DISM /Online /Cleanup-Image /RestoreHealth(successful)- Full reboot afterwards.
- Re-test after reboot
- Still fails identically.
Why this seems like a product bug
- Reproducible across multiple versions.
- Not tied to a single project config.
- Persists after desktop state reset and OS integrity repair.
- Failure happens specifically in Desktop terminal PTY creation path.
Related issues possibly relevant
- Session lookup fails with NotFoundError when PTY spawned from non-git directory context #8538 (PTY/session behavior)
- fix(pty): pty session handle leak #15599 (PTY resource handling fix)
- Windows spawn ENOENT error in OpenCode SDK #2812 (Windows spawn issues)
- fix: add missing args to windows tauri cli spawn #8084 (Windows tauri spawn args)
Could maintainers help identify what exact condition causes PTY spawn to fail on Windows Desktop in this case, and whether additional diagnostics can be enabled to expose underlying spawn error details (errno / command / args)?opencode-desktop_2026-04-26_17-14-42.log
opencode-desktop_2026-04-26_17-12-58.log
opencode-desktop_2026-04-26_17-09-24.log
opencode-desktop_2026-04-26_17-56-11.log
opencode-desktop_2026-04-26_17-19-14.log
opencode-desktop_2026-04-26_17-16-36.log
Plugins
oh my opencode
OpenCode version
1.14.25
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
windows11
Terminal
Windows Terminal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktopwindows
Activity
github-actions commentedon Apr 26, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these, please add details explaining the difference so maintainers can prioritize accordingly.
liu5269 commentedon Apr 26, 2026
prasadf18 commentedon Apr 27, 2026
@rekram1-node hi, please assign this to me
liu5269 commentedon Apr 29, 2026
Here is an English version:
On Windows, if the user environment registry contains bad entries, the assembled environment block can cause
CreateProcessWto fail with ERROR_INVALID_PARAMETER (87). Logging for this path should be more detailed so it is easier to see what went wrong—especially when the problem comes from system environment variables.The fix was to remove these four bad values under the user environment key:
After deleting those entries, the embedded terminal worked again.