github / github/copilot-cli

wta.exe launch fails with 0x80070002 — misplaced quote in path breaks at "Program Files" (Windows, codex agent)

未关闭
#4,540 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:agents area:platform-windows
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Environment

  • OS: Windows 11 (build 26100)
  • Copilot CLI: 1.0.80 (npm @github/copilot@1.0.80, platform package copilot-win32-x64)
  • 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

跟踪构建 Windows wta.exe 启动命令的 codex 委派路径,从委派 agent 的命令构建入口点开始。使用 Windows 上的 codex agent 复现,并验证可执行文件路径被作为一个路径加上引号,且 spawn 成功且不会出现 0x80070002。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, shell
领域
cli, operating-systems
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。