Compare commits

...
2 Commits
Author SHA1 Message Date
Myfro9andClaude Opus 5.5 1e56aa9378 sync: HJ_PC 2026-10-20 tools-sync 记录 Codex MCP 回退根因(桌面版进程常驻回写)并补 kicad/dsa815 模板项
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 23:29:49 +08:00
Myfro9andClaude Opus 5.5 e85690adbc tools-sync: MCP 审计自动排除 Codex 插件 MCP(按 cwd 识别),并修 -ExcludeName 逗号传参
HJ_PC 上 code-review / codex_app 以 cmd.exe 启动、cwd 在 plugins\cache\openai-bundled,
旧逻辑只看 command 识别不出,-Apply 把它们复制进了 Claude;
powershell -File 传 -ExcludeName a,b 时绑定成单个字符串 a,b,排除也失效。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 23:15:06 +08:00
3 changed files with 16 additions and 3 deletions
+7
View File
@@ -312,6 +312,13 @@ commit + push 一次(junction 模型下 codex 侧自动同步,无需额外
报告里写明"Codex 侧改动未能持久,该机 Codex 实际仍在用 <旧配置>",不要写成已修复。
真正的修复要从账号侧那份快照入手(目前无已知入口)。
**2026-10-20 HJ_PC 定位到根因(codex-cli 0.142.4 + Codex 桌面版 26.1013)**:回退来自**正在运行的
Codex 桌面版**(`WindowsApps\OpenAI.Codex_*\app\ChatGPT.exe` 及其拉起的 `codex.exe` / `node_repl`)。
只关窗口不够——进程常驻托盘照样回写,`-Apply` 后 30 s 内 vivado-mcp 被退回旧配置。把这些进程全部停掉
(`Get-Process | ? { $_.Path -match 'OpenAI\.Codex_|\\OpenAI\\Codex\\' } | Stop-Process`)后再 `-Apply`,
4 个 MCP 在 T+30 s / T+60 s 全部保持 Matched。所以**做 Codex 侧 MCP 改动前先让用户退出 Codex 桌面版并确认进程已无**,
这才是"改了能留住"的前提;之后桌面版再启动会不会再覆盖,下次同步时复验。
由此还有一个已知缺口:`codex mcp add` 没有 `--tool-timeout-sec` / `env_vars` 之类的参数,
config.toml 又不生效,所以这两个键**目前无任何设置入口**。需要它们的 MCP 记在
`references/codex_mcp_wanted_keys.json`,脚本注册完会单独报"registered, but incomplete",
+2 -1
View File
@@ -115,7 +115,8 @@ Codex 内置运行时 MCP(node_repl / cua_repl)不进入这个并集。
| vivado-mcp | {CONDA_LANGGRAPH_PYTHON} | E:\MCP_design\vivado-mcp-main\run_server.py(Codex)/ -m vivado_mcp(Claude) | VIVADO_PATH={VIVADO_PATH} |
| mcp_n9320b | {CONDA_LANGGRAPH_PYTHON} | E:\MCP_design\mcp_n9320b\n9320b_mcp.py | N9320B_HOST={N9320B_HOST} |
| cubemx | E:\MCP_design\MCP_cubemx\cubemx-mcp\.venv\Scripts\python.exe | E:\MCP_design\MCP_cubemx\cubemx-mcp\server\main.py | PYTHONPATH=E:\MCP_design\MCP_cubemx\cubemx-mcp\server |
| kicad | node | E:\MCP_design\KiCAD-MCP-Server\dist\index.js | NODE_ENV=production; PYTHONPATH={KICAD_PYTHONPATH}; KICAD_AUTO_LAUNCH=false |
| kicad | node | E:\MCP_design\KiCAD-MCP-Server\dist\index.js | NODE_ENV=production; PYTHONPATH={KICAD_PYTHONPATH}; KICAD_AUTO_LAUNCH=false; KICAD_PYTHON={KICAD_PYTHON}(KiCad 不在 Program Files 时必填;并对该 python 跑 `pip install -r requirements.txt`,否则缺 sexpdata 起不来) |
| mcp_dsa815 | node | E:\MCP_design\mcp_dsa815\dist\index.js | DSA815_HOST=<ip>; DSA815_PORT=5555; DSA815_EXPECTED_SERIAL=<序列号> |
| simetrix | <conda env>\Scripts\mcp-simetrix.exe | | SIMETRIX_PROJECT_ROOT=E:\ |
| matlab | {MATLAB_MCP_EXE} | --matlab-session-mode=existing --extension-file=...\simulink\tools\tools.json | |
@@ -36,6 +36,8 @@ param(
)
$ErrorActionPreference = "Stop"
# `powershell -File x.ps1 -ExcludeName a,b` binds the single string "a,b"; split it ourselves.
$ExcludeName = @($ExcludeName | ForEach-Object { $_ -split ',' } | ForEach-Object { $_.Trim() } | Where-Object { $_ })
$script:CodexBackupMade = $false
$script:Failures = @()
$script:Unsupported = @()
@@ -156,12 +158,13 @@ function Get-CodexMcpsFromCli {
$t = $s.transport
$transport = if ($t.type) { [string]$t.type } elseif ($t.url) { "http" } else { "stdio" }
if ($transport -eq "streamable_http") { $transport = "http" }
$result[[string]$s.name] = New-CanonicalMcp ([string]$s.name) $transport ([string]$t.command) `
$mcp = New-CanonicalMcp ([string]$s.name) $transport ([string]$t.command) `
@($t.args) (ConvertTo-StringMap $t.env) ([string]$t.url) `
(ConvertTo-StringMap $t.http_headers) ([string]$t.bearer_token_env_var) "Codex"
# Not part of the drift comparison; Test-CodexManaged needs it because bundled
# plugin MCPs launch as plain `cmd.exe` and only their cwd names the plugin cache.
$result[[string]$s.name] | Add-Member -NotePropertyName cwd -NotePropertyValue ([string]$t.cwd)
$mcp | Add-Member -NotePropertyName cwd -NotePropertyValue ([string]$t.cwd)
$result[[string]$s.name] = $mcp
}
return $result
}
@@ -208,6 +211,8 @@ function Test-CodexManaged($Mcp) {
# codex-cli 0.162: code-review / codex_app are `cmd.exe /c scripts\launch_*.cmd` with
# cwd under .codex\plugins\cache\openai-bundled -- the command alone looks portable.
if ([string]$Mcp.cwd -match '(?i)[\\/]\.codex[\\/](runtimes|plugins[\\/]cache)[\\/]') { return $true }
# The plugin cache may also live outside ~\.codex (e.g. orca's codex-runtime-home). 2026-10-08 HJ_PC.
if ([string]$Mcp.cwd -match '(?i)[\\/]plugins[\\/]cache[\\/]') { return $true }
# The Codex desktop app also bundles MCPs from its own install dir (MSIX
# WindowsApps, or AppData\Local\OpenAI\Codex). Host-owned, not portable.
return ($command -match '(?i)[\\/](WindowsApps[\\/]OpenAI\.Codex|OpenAI[\\/]Codex[\\/])')