Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Windows: Codex Desktop never invokes trace-codex hooks — 0 traces delivered, "hook exited with code 1" for every lifecycle event

已关闭
#18 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。