Windows: Codex Desktop never invokes trace-codex hooks — 0 traces delivered, "hook exited with code 1" for every lifecycle event
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, shell
调研方向
Examine the plugin's hooks.json file and the bin/codex-hook.sh script to understand the hook execution flow. Investigate how Codex Desktop on Windows loads and runs hooks, possibly by checking the MSIX package structure and logs in %LOCALAPPDATA%\Packages\OpenAI.Codex_\LocalCache\Local\Codex\Logs. Determine if the issue is in path resolution, sandboxing, or a missing hook dispatch mechanism. The goal is to get a hook to execute successfully and deliver a trace.
由索引模型根据 Issue 内容生成。
描述
Summary
On Windows, trace-codex installs and shows as active in Codex Desktop (Settings > Plugins),
but every single hook (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, etc.) fails
with "hook exited with code 1" in the Codex Desktop hooks panel, and zero traces are
ever delivered to Braintrust — confirmed via the dashboard (0 spans over a 1-hour window
with multiple test sessions).
Environment: bt CLI v0.19.3 (also reproduced after bt update), Windows 11, Codex Desktop
(OpenAI.Codex package), trace-codex plugin v2.0.0.
What we ruled out
The plugin's hooks.json runs commandWindows: bash "${PLUGIN_ROOT}\bin\codex-hook.sh",
trusting that bash on PATH is Git Bash. On our machine PATH resolves bash to the WSL
launcher stub (AppData\Local\Microsoft\WindowsApps\bash.exe) instead of Git Bash, which
corrupts any backslash-containing path/argument passed to it (confirmed: echo $HOME
through that stub returns C:Users<name>, every backslash stripped).
We patched hooks.json to call Git Bash by its absolute path instead of relying on PATH,
restarted Codex Desktop, and the hooks panel still showed hook exited with code 1 for
every entry — no change.
We then searched Codex Desktop's own logs
(%LOCALAPPDATA%\Packages\OpenAI.Codex_<id>\LocalCache\Local\Codex\Logs\...) for any
reference to codex-hook.sh, PLUGIN_ROOT, or the hook's statusMessage ("Braintrust
tracing") across every session logged that day — zero matches, before or after the
patch. This strongly suggests Codex Desktop never actually reads/executes the hooks.json
under ~/.codex/plugins/cache/braintrust-codex-plugins/trace-codex/2.0.0/hooks/hooks.json
at all for lifecycle hook dispatch on Windows.
We also checked whether Codex Desktop keeps its own isolated copy of the plugin config
(it runs as an MSIX-packaged app, Packages\OpenAI.Codex_<id>\...): LocalState and
RoamingState under that package are genuinely empty (no permission error, just empty),
there is no non-virtualized %LOCALAPPDATA%\Codex path outside the sandbox, and the only
Windows-specific executables present (codex-command-runner.exe,
codex-windows-sandbox-setup.exe) are compiled binaries we can't inspect. Codex Desktop's
logs do show it actively enumerating installed WSL distros
([wsl] eligible distro list ... Ubuntu Running), and Braintrust starts as an MCP server
in the same logs (server=braintrust status=ready) — a different mechanism from the
lifecycle-hook path the CLI uses.
Impact
Codex Desktop tracing is completely non-functional on Windows — not degraded, not
intermittent, zero spans delivered, with no error surfaced to the user beyond a generic
"hook exited with code 1" in a panel most users won't open.
Ask
Could someone confirm where Codex Desktop (as opposed to Codex CLI) actually reads its
hook/plugin configuration on Windows? If hooks.json's commandWindows field isn't the
real codepath for Desktop, what is, and is there a supported way to fix/patch it today —
or is this simply not implemented yet for Codex Desktop on Windows?
Related: braintrustdata/braintrust-claude-plugin#41 (same family of Windows execution
issues, different product/mechanism).
- 主要语言
- Shell
- 星标
- 2
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
docs: tutorial 7 still references removed A2AStarletteApplication可能已有人在做 @FOWEPJF255 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
a2aproject/A2A#2321 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
OpenSlides/OpenSlides#7180 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
magicmonty/bash-git-prompt#581 ·