fix(cli): codex MCP install throws on Windows

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli

调研方向

Start with the named install-config use case and MCP launch transform, then inspect the existing Windows launch tests and add the Codex case described in the issue. Reproduce with a Codex profile, Windows platform, and an MCP source containing an npx server. Done means installation does not throw and the written TOML contains the Windows launch using cmd with /c and npx.

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

描述

Description

Installing MCP servers for Codex on Windows throws. The Windows launch rewrite parses its input as JSON, but Codex's MCP content has already been converted to TOML by the tool transform.

Affected file(s)
  • next: cli/src/contexts/framework/application/install/install-config-use-case.ts (applyTransforms: capability.transform(rawContent) then win32Transform(toolContent)), cli/src/contexts/tools/domain/mcp-launch-command.ts (transformMcpForWin32 runs JSON.parse(content)), cli/src/contexts/tools/domain/capabilities/mcp-capability.ts (transform returns mcpJsonToToml for format: "toml"), cli/src/contexts/tools/domain/profiles/codex/profile.ts. Reached from cli/src/contexts/framework/application/restore/generate-tool-distribution-use-case.ts.
  • refactor/cli-target: cli/src/contexts/installation/application/install/install-config.ts (applyTransforms), cli/src/contexts/tools/domain/sections/mcp-section.ts (transformMcpForWin32, launchTransformFor), cli/src/contexts/installation/application/restore/generate-tool-distribution.ts.
Expected behaviour

On Windows, a Codex install with MCP servers succeeds and npx, uvx and uv launches are rewritten for Windows (or knowingly left alone for TOML).

Observed behaviour

JSON.parse throws on the TOML text: Unexpected token 'm', "[mcp_server"... is not valid JSON. The existing Windows cases only cover JSON-format tools, no Codex case exists.

AI tool

Codex

aidd-cli version

unreleased, next

OS

Windows

Additional context

Red-first test: install-config with the Codex profile, a win32Platform and an MCP source containing an npx server. It must not throw, and the written TOML must carry the Windows launch (cmd with /c, npx) for the server. Fix direction: apply the launch rewrite before the format conversion, or have it handle TOML. Decide which, then pin it with the case.

主要语言
TypeScript
星标
481
派生
45
平均合并
1 天 13 小时
30 天内合并 PR
91

环境准备

从这里开始

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

ai-driven-dev/framework 的其他 Issue

查看 ai-driven-dev/framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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