修复 Codex MCP type 配置并更新发布包

This commit is contained in:
shiyue
2026-10-08 14:55:58 +08:00
parent caf8947cd9
commit 747771a048
17 changed files with 181 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
# Codex MCP 配置输出
- cc-web 内部允许读取旧 MCP `type` 并保留传输类型元数据,用于工具目录和工作流判断。
- 发送给 Codex 的 MCP 服务器配置不输出顶层 `type`。Codex 通过 `command` 或 `url` 识别传输方式。
- 使用 `lib/codex-mcp-config.js` 生成出站副本,不直接删除内部对象上的字段;嵌套 `env.type` 等同名字段保留。
- CLI 的内置和项目 MCP 参数均省略 `type`;App Server 在公共线程配置出口统一处理,覆盖 start/resume/fork 和 Gitea 注入。
- Gitea 内部 `mcpServer` 元数据和对外 `config` 分开,线程配置使用出站副本。
- 回归直接检查实际参数或协议对象没有顶层 `type`,同时检查连接、环境、认证及超时字段保持完整。仅从 `command`/`url` 推导传输方式无法证明字段已经省略。

View File

@@ -19,6 +19,7 @@ This directory contains guidelines for backend development. Fill in each file wi
| [Error Handling](./error-handling.md) | Error types, handling strategies | To fill |
| [Quality Guidelines](./quality-guidelines.md) | Code standards, forbidden patterns | To fill |
| [Logging Guidelines](./logging-guidelines.md) | Structured logging, log levels | To fill |
| [Codex MCP 配置输出](./codex-mcp-config.md) | 旧类型配置兼容及 Codex 配置出口 | 已记录 |
---

View File

@@ -0,0 +1,2 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
{"file": ".trellis/spec/backend/index.md", "reason": "质量检查规范入口"}

View File

@@ -0,0 +1,2 @@
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
{"file": ".trellis/spec/backend/index.md", "reason": "后端实现规范入口"}

View File

@@ -0,0 +1,25 @@
# Codex MCP 配置出口省略 type
## 用户已确认的需求
- cc-web 发送给 Codex 的 MCP 配置不再包含服务器顶层 `type`。
- 保留旧配置读取兼容及内部类型元数据,仅在出站配置省略该字段。
- 用户更正为 `/home/hdzx/.codex/config.toml`;已确认 3 个 MCP 服务均没有 `type`,无需改写。
## 范围与限制
- CLI:`lib/agent-runtime.js` 的内置 ccweb 与项目 MCP 参数。
- App Server:`server.js` 的 start/resume/fork 共用线程配置出口,包括 Gitea 分支。
- Gitea:保留 `buildGiteaMcpServerConfig()` 内部元数据,线程配置出口不含 `type`。
- 原有 command/url/env/env_vars/认证/超时字段保持不变,不删除嵌套 env 内名为 type 的变量。
- 不删除 disable_response_storage 或其他未知字段,不重启/重载/停止服务,不提交/推送。
## 验证
- 在实际参数/协议载荷中断言服务器顶层没有 `type`,不能只推导传输类型。
- 旧含 type 的 TOML fixture 正常读取,连接和环境上下文字段保持完整。
- `timeout 60s npm run regression`。
- `timeout 60s node scripts/gitea-workflow-codex-unit.js`。
- 所有修改的 JS 文件运行 `node --check`,`git diff --check` 通过。
- 按需使用已有 focused target 对相关路径检查,不重复已通过且无新变化的测试。
## 参考
- `.planning/2026-10-08-codex-mcp-without-type/task_plan.md`
- `.planning/2026-10-08-codex-mcp-without-type/findings.md`

View File

@@ -0,0 +1,26 @@
{
"id": "codex-mcp-without-type",
"name": "codex-mcp-without-type",
"title": "Codex MCP type 配置出口兼容修复",
"description": "",
"status": "completed",
"dev_type": null,
"scope": null,
"package": null,
"priority": "P2",
"creator": "shiyue",
"assignee": "shiyue",
"createdAt": "2026-10-08",
"completedAt": "2026-10-08",
"branch": null,
"base_branch": "main",
"worktree_path": null,
"commit": null,
"pr_url": null,
"subtasks": [],
"children": [],
"parent": null,
"relatedFiles": [],
"notes": "",
"meta": {}
}