sync: SHANGHAI-U9 2026-10-20

This commit is contained in:
bowei
2026-10-20 17:48:25 +08:00
parent 4566f1a694
commit cc0faed5cc
@@ -159,6 +159,9 @@ function Get-CodexMcpsFromCli {
$result[[string]$s.name] = New-CanonicalMcp ([string]$s.name) $transport ([string]$t.command) ` $result[[string]$s.name] = New-CanonicalMcp ([string]$s.name) $transport ([string]$t.command) `
@($t.args) (ConvertTo-StringMap $t.env) ([string]$t.url) ` @($t.args) (ConvertTo-StringMap $t.env) ([string]$t.url) `
(ConvertTo-StringMap $t.http_headers) ([string]$t.bearer_token_env_var) "Codex" (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)
} }
return $result return $result
} }
@@ -202,6 +205,9 @@ function Test-CodexManaged($Mcp) {
if ($Mcp.name -in @("node_repl", "cua_repl")) { return $true } if ($Mcp.name -in @("node_repl", "cua_repl")) { return $true }
$command = [string]$Mcp.command $command = [string]$Mcp.command
if ($command -match '(?i)[\\/]\.codex[\\/](runtimes|plugins[\\/]cache)[\\/]') { return $true } if ($command -match '(?i)[\\/]\.codex[\\/](runtimes|plugins[\\/]cache)[\\/]') { return $true }
# 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 Codex desktop app also bundles MCPs from its own install dir (MSIX # The Codex desktop app also bundles MCPs from its own install dir (MSIX
# WindowsApps, or AppData\Local\OpenAI\Codex). Host-owned, not portable. # WindowsApps, or AppData\Local\OpenAI\Codex). Host-owned, not portable.
return ($command -match '(?i)[\\/](WindowsApps[\\/]OpenAI\.Codex|OpenAI[\\/]Codex[\\/])') return ($command -match '(?i)[\\/](WindowsApps[\\/]OpenAI\.Codex|OpenAI[\\/]Codex[\\/])')