打开 Postman 会改 Codex?Windows 上 4 处都没有

0 阅读6分钟

Hacker News 上 1414 分的那帖把标题写成「Postman 静默自动安装 AI 插件,并试图分享全部 API 数据」。点进去是 postman-app-support#14370,issue 仍是 Open。作者在一台 Mac 上打开 Postman 12.33.4,自己的日志记下 autoInstall.plugin.existing-user,结果是 claude-code:installed、codex:installed;接着 ~/.codex/config.toml 多了 marketplace、插件和一份自己批过的 SessionStart 钩子。

issue 正文写明:这份报告证明的是集成和启动指令被改了,不构成数据外传。HN 标题后半句比原文多出来的那截,原文没有证据。

原文全是 Mac 路径,也没说「没装 Postman 时这几处本来长什么样」。我这台 Windows 10 装了 Claude Code 2.1.318 和 Codex 0.163.0,没有 Postman。按 issue 里的落盘字段做了 4 处只读自查:配置里没有 Postman 写进去的段,但 Codex 和 Claude Code 本来就有自己的 SessionStart 钩子。有钩子,不等于被 Postman 改过。

先说结论

检查本机结果说明
config.toml 的三段全文没有 postman没有 [marketplaces.postman]、[plugins."postman@postman"],也没有 postman@postman:hooks/codex-hooks.json:session_start:0:0
Claude Code 插件目录只有 claude-plugins-officialknown_marketplaces.json 里没有 postmanlabs/postman-plugin;installed_plugins.json 不存在
已有的 SessionStart两边都有,命令指向 ~/.orca/agent-hooks这是我自己的钩子。Postman 那份的键是 postman@postman:…:session_start:0:0,命令是 session-start.cmd
日志和 MCP日志目录不存在;MCP 名单里没有 postman%AppData%\Postman\logs 整段都不存在。codex mcp list 只有 node_repl

这台机器可以停在这里。装过 Postman、后来又卸掉的人不能停:issue 作者删掉本机安装之后,要求的是一条覆盖 agent 配置、钩子信任、marketplace、缓存、MCP 和 CLI 的回滚,而不是只卸桌面应用。

四项只读自查:Postman 会写的位置,和本机已有钩子

背景(一句话版)

据 issue #14370(2026-10-25 19:03 UTC 开,截至今天 14:50 UTC 仍 Open,无负责人、无标签):作者打开闲置已久的 Postman 桌面版,日志 ~/Library/Application Support/Postman/logs/main.log 第 11562–11563 行在 2026-10-24T09:34:14.418Z 记下

{"source":"auto-existing-upgrade","results":["claude-code:installed","codex:installed"],"installer":"script"}

下一行是 autoInstall.plugin.existing-user finished,outcome 为 installed,platform 为 darwin。随后 ~/.codex/config.toml 出现 [marketplaces.postman](源是 https://github.com/postmanlabs/postman-plugin.git)、[plugins."postman@postman"] 且 enabled = true,以及 hooks.state 里那条 postman@postman:hooks/codex-hooks.json:session_start:0:0 的 trusted_hash。Claude Code 一侧,~/.claude/settings.json 启用了 postman@claude-plugins-official,installed_plugins.json 记下版本 2.0.1、user scope,installedAt 与 lastUpdated 都是 2026-10-24T09:34:02.610Z。

启动指令来自插件仓库当时装上的修订 6c8e452。hooks/session-start-context.md 原文是:

Before responding to any non-trivial API engineering task — designing, implementing, mocking, testing, monitoring, documenting, or deploying an API or Postman Flow — load the postman:api-engineer skill and follow it.

hooks/codex-hooks.json 把它挂在 SessionStart 上,matcher 是 startup|clear|compact。Windows 走的是 commandWindows:cmd /d /c "${PLUGIN_ROOT}/hooks/session-start.cmd"。安装器 installer/src/hosts/codex.ts 在装完插件后调用 approvePostmanHook;codex-hooks.ts 用 hooks/list 取哈希,再 config/batchWrite 写进 hooks.state。源码注释写的是 "Approves only Postman's current hook after installation"。作者也写了:信任记录本身证明不了是谁写下的。

mcp.codex.json 把 MCP 指到 https://mcp.postman.com/mcp。作者的 Codex 日志是 MCP server startup failed server_name="postman",错误 Auth required, when send initialize request。连接被加上了,认证并没有通。

维护者到我读完这篇 issue 时还没有回复。

实测

环境:Windows 10(10.0.19045)。claude --version 是 2.1.318 (Claude Code),codex --version 是 codex-cli 0.163.0。PATH 里没有 postman。卸载注册表(HKCU、HKLM、WOW6432Node)没有 DisplayName 含 Postman 的项。全程只读:没有安装 Postman,也没有运行仓库里的卸载脚本。这几条检查是让 SpectrAI 里的 Agent 在本机逐条执行的,命令和输出都留在会话记录里。

1. Codex 的 config.toml:没有那三段

$ codex --version
codex-cli 0.163.0

config.toml  size=6144
contains 'postman' = False
contains 'mcp.postman.com' = False

段名是这些(路径里的用户名我留在原文里,没有改写):

[marketplaces.openai-bundled]
[marketplaces.openai-primary-runtime]
[plugins."codex-app-tools@openai-bundled"]
[plugins."browser@openai-bundled"]
[plugins."documents@openai-primary-runtime"]
[plugins."pdf@openai-primary-runtime"]
[plugins."spreadsheets@openai-primary-runtime"]
[plugins."presentations@openai-primary-runtime"]
[plugins."template-creator@openai-primary-runtime"]
[plugins."computer-use@openai-bundled"]
[mcp_servers.node_repl]
[hooks.state]

没有 [marketplaces.postman],也没有 [plugins."postman@postman"]。codex plugin marketplace list 印出来的三行是 openai-primary-runtime、openai-bundled、openai-curated。codex plugin list 的已安装项全是 openai-bundled 和 openai-primary-runtime 前缀,没有 postman@postman。

2. Claude Code:marketplace 只有官方那一个

$ claude --version
2.1.318 (Claude Code)

known_marketplaces.json  size=281  contains_postman=False
{
  "claude-plugins-official": {
    "source": { "source": "github", "repo": "anthropics/claude-plugins-official" },
    "lastUpdated": "2026-11-04T15:10:02.998Z"
  }
}

%USERPROFILE%\.claude\plugins\ 下面是 known_marketplaces.json、marketplaces/、plugin-directory-cache-v2.json、store/、synced/。issue 点名的 installed_plugins.json 不存在。marketplaces/ 里只有 claude-plugins-official。settings.json 和 .claude.json 全文都没有 postman,也没有 mcp.postman.com。.claude 和 .codex 两个目录下,文件名含 postman 的是 0 个。

插件安装器对 Claude Code 用的 id 是 postman@claude-plugins-official,不是 Codex 那边的 postman@postman。只搜后一个 id,会把 Claude Code 那份漏掉。本机两个字符串都不在。

3. 有 SessionStart,但不是 Postman 那份

Codex 的 hooks.json(2526 字节)全文没有 postman。9 条命令是同一行,事件包括 SessionStart:

C:\Windows\System32\cmd.exe --% /d /v:off /c @"%USERPROFILE%/.orca/agent-hooks/codex-hook.cmd"

config.toml 里对应的信任段是:

[hooks.state.'%USERPROFILE%\.codex\hooks.json:session_start:0:0']
enabled
trusted_hash

同一条还用正斜杠重写了一遍(C:/Users/…/.codex/hooks.json:session_start:0:0)。字段只有 enabled 和 trusted_hash,没有 issue 里那条同时出现的 trusted_content_hash。键的前缀是本机 hooks.json 的路径,不是 postman@postman:。

Claude Code 的 settings.json 挂了 13 个事件,SessionStart 是其中之一,每条都是同一段 Base64 的 PowerShell。解码之后是:

$scriptPath = Join-Path $env:USERPROFILE '.orca\agent-hooks\claude-hook.cmd'
if (Test-Path -LiteralPath $scriptPath -PathType Leaf) { & $scriptPath; exit $LASTEXITCODE }

~/.orca/agent-hooks 是我自己的钩子目录。Postman 在 Windows 上要落的是 ${PLUGIN_ROOT}/hooks/session-start.cmd,外加一条键名以 postman@postman:hooks/codex-hooks.json:session_start:0:0 开头的信任记录。看到 SessionStart 就当中招,会把自己的钩子报进去。

4. 日志目录不存在,MCP 名单里没有 postman

issue 的日志在 Mac 的 ~/Library/Application Support/Postman/logs/main.log。Postman 支持文档 How to open my logs directory 给的 Windows 路径是 %AppData%\Postman\logs。本机这个目录不存在,%LocalAppData%\Postman、%AppData%\Postman、C:\Program Files\Postman 也都不存在。没有日志,就没有 autoInstall.plugin.existing-user 那一行可以查。

MCP 只看了名字和地址,没有去连 https://mcp.postman.com/mcp:

$ codex mcp list
node_repl   …\cua_node\…\node.exe   …\cua-repl.mjs     enabled

名单里没有名为 postman 的项,地址里也没有 mcp.postman.com。.claude.json 里没有 mcpServers 项。

claude plugin list 和 claude mcp list 我没有跑成。本机用户设置里 CLAUDE_CODE_USE_POWERSHELL_TOOL=0,而这个 Git Bash 又不在 Claude Code 认的 Git for Windows 路径上,两条命令都以 exit 1 结束:

Claude Code on Windows requires a shell tool. Git Bash was not found
and the PowerShell tool is disabled (CLAUDE_CODE_USE_POWERSHELL_TOOL=0).

所以 Claude Code 的结论来自落盘文件,不是来自 claude plugin list 的输出。为了让子命令跑起来而去改这个开关,不在这次只读检查里。

深入:键名和命令才分得开,事件名分不开

issue 和 README 都把「装完就信任自己的钩子」写在 Codex 这条路上。installer/src/hosts/claude-code.ts 只做 marketplace 刷新和 claude plugin install postman@claude-plugins-official --scope user,没有调用 approvePostmanHook。Claude Code 那边被改的是启用记录和 installed_plugins.json,不是一份安装器写进去的 trusted_hash。

README 现在的安装段把这件事说在明面上:对 Codex,安装还会批准 Postman 的 session-start 钩子,没有单独的确认,也没有把钩子内容打印出来;已经信任的钩子保持不动。同一份 README 也给出手动命令 codex plugin marketplace add postmanlabs/postman-plugin --ref main。所以「config.toml 里有 postman」只说明插件注册过,不能单独证明是桌面版自动装的。要坐实自动安装,还得看到日志里的 auto-existing-upgrade。本机两样都没有。

另一个边界是版本。issue 钉死的是 Postman 桌面版 12.33.4、Codex 插件 1.1.0、Claude 插件 2.0.1、源码修订 6c8e452。我读到的仓库 main 已经在发 @postman/postman-plugin 0.6.0,目录里还有 Cursor、Copilot、Kimi、OpenCode 的路由。那些路由这次没装、也没测。0.6.0 会不会往别的配置文件写,不能从 1.1.0 的行为推。

commandWindows 是 6c8e452 里就有的字段。桌面版的自动安装日志只在 darwin 上被贴出来过。Windows 上打开同一个 12.33.4 会不会走同一条 auto-existing-upgrade,issue 没有第二份证据,我也没有 Postman 可以打开。

暂时做不了怎么办

  • 没装过 Postman:上面 4 处都空,就可以停。不要因为自己本来就有 SessionStart 去清 ~/.orca 或其他钩子。
  • 装过又卸了:先看 %AppData%\Postman\logs 里有没有 autoInstall.plugin.existing-user,再看 config.toml 的三段、known_marketplaces.json、installed_plugins.json,以及 MCP 里有没有 https://mcp.postman.com/mcp。日志目录随卸载一起没了的话,配置文件仍可能在。
  • 发现那段钩子还在:issue 评论里有人贴了 Postman 的卸载按钮,也有人说自己不跑它、另写了清理。我没有运行任何一份,也不把别人的清理脚本转写进来。要动配置,先备份 config.toml、hooks.json、settings.json。
  • 评论里的 Bruno、Kreya、Yaak 我一个都没装,不比较。

清单

  • codex --version、claude --version 记下版本;PATH 和卸载注册表确认有没有 Postman
  • config.toml 全文搜 postman:没有 [marketplaces.postman]、[plugins."postman@postman"]、postman@postman:hooks/codex-hooks.json:session_start:0:0
  • known_marketplaces.json 只有自己加过的源;没有 installed_plugins.json 里的 postman@claude-plugins-official
  • 已有 SessionStart 的命令指向自己的脚本,而不是 session-start.cmd
  • %AppData%\Postman\logs 不存在,或存在但没有 auto-existing-upgrade
  • codex mcp list 的名字和地址里没有 postman / mcp.postman.com;claude mcp list 跑不成就直接读 .claude.json

参考