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
wta.exe launch fails with 0x80070002 — misplaced quote in path breaks at "Program Files" (Windows, codex agent) #4540
Intelligent Terminal: Microsoft.IntelligentTerminal 0.2.2192.0 (installed via MS Store, package status Ok, wta.exe present and intact — 24,870 KB)
Bug
When spawning a delegated codex agent (--delegate-agent codex), the terminal launch fails with:
error 2147942402 (0x80070002) when launching `C:\Program "Files\WindowsApps\Microsoft.IntelligentTerminal_0.2.2192.0_x64__8wekyb3d8bbwe\wta.exe --connect-master \\.\pipe\wta-master-<GUID> --owner-tab-id {<GUID>} --owner-window-id 1 --agent npx" -y "@agentclientprotocol/codex-acp@1.1.4 --agent-id codex --agent-source host --follows-global-acp-model --allowed-agent-ids copilot,claude,codex,gemini,opencode --delegate-agent codex --language en-US --start-stashed"
The system cannot find the file specified.
Root cause
The command line is assembled with a misplaced quote: C:\Program "Files\WindowsApps\... — the quote opens after Program instead of before C:\. Windows then treats C:\Program as the executable path, which does not exist → 0x80070002 (ERROR_FILE_NOT_FOUND).
The closing quote appears after --agent npx, so the intended quoting was presumably: "C:\Program Files\WindowsApps\...\wta.exe" --connect-master ... --agent "npx" -y "..." ...
Reproducibility
Reproduces 100% on every codex agent spawn, including after a full reboot
Survives: forced reinstall of Microsoft.IntelligentTerminal from the Store, and npm update of @github/copilot (1.0.79 → 1.0.80)
wta.exe launches fine when run directly from PowerShell — the exe and package are healthy; only the command construction is broken
Workaround
Use non-codex agents (copilot/claude/gemini work), since the faulty quoting appears specific to the codex delegate path.
yeah that 0x80070002 is just file-not-found, and you already found it, the quote lands after Program so Windows tries to run C:\Program as the exe. your wta.exe is fine, it's the spawn line in the codex delegate path being assembled wrong. I'd lean on copilot/claude/gemini delegates till that gets patched upstream. oh, btw, in case it might help that, I built a portable Hermes OTG repo, check it, imo it may be able to help you diagnose and figure out the fix in no time. https://github.com/MilkyWay008/Hermes-OTG
Thanks for the detailed report! The launch command shown here (including the misplaced quote) is generated by the terminal application that starts the agent (wta.exe), not by Copilot CLI, so it can't be fixed in this repo. Please report it through that application's feedback channel. Closing as off-topic for this repository.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.
Activity
MilkyWay008 commentedon Aug 20, 2026
yeah that 0x80070002 is just file-not-found, and you already found it, the quote lands after
Programso Windows tries to runC:\Programas the exe. your wta.exe is fine, it's the spawn line in the codex delegate path being assembled wrong. I'd lean on copilot/claude/gemini delegates till that gets patched upstream. oh, btw, in case it might help that, I built a portable Hermes OTG repo, check it, imo it may be able to help you diagnose and figure out the fix in no time. https://github.com/MilkyWay008/Hermes-OTGpatniko commentedon Oct 26, 2026
Thanks for the detailed report! The launch command shown here (including the misplaced quote) is generated by the terminal application that starts the agent (
wta.exe), not by Copilot CLI, so it can't be fixed in this repo. Please report it through that application's feedback channel. Closing as off-topic for this repository.Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.