fix(codex-hooks): 避免 Claude manifest 在 Codex 變成空路徑 #50

Merged
admin merged 1 commits from fix/codex-claude-hook-manifest into develop 2026-08-28 10:09:31 +00:00
Member

摘要

  • 需求描述:避免 Codex 讀取 Claude 外掛 manifest 時,因 ${CLAUDE_PLUGIN_ROOT} 未設定而把 UserPromptSubmit hook 路徑展開成 /hooks/...。
  • 計畫名稱:無
  • 計畫頁:無
  • 分析頁:無

變更內容

檔案 為什麼改
hooks/hooks.json 所有 hook command 先取 ${CLAUDE_PLUGIN_ROOT},沒有時退回 $JSC_HOME/current/jsc-hooks。
tools/wire-cli.sh Codex 狀態檢查新增 plugin-user-prompt-root,可查出已安裝快取仍含舊版 Claude-only command。
skills/hooks-install/SKILL.md 補上 hooks manifest 也要使用穩定路徑 fallback 的技能規則。
plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 同步 jsc-hooks 版本。

設計重點

  • 保留 Claude 原生 ${CLAUDE_PLUGIN_ROOT} 行為。
  • Codex 或其他 CLI 讀到同一份 manifest 時,改用 $JSC_HOME/current/jsc-hooks。
  • 讓 wire-cli.sh status codex 能把舊快取風險列成缺漏項目。

測試結果

  • python3 -m json.tool hooks/hooks.json >/dev/null && python3 -m json.tool plugin.json >/dev/null && python3 -m json.tool .claude-plugin/plugin.json >/dev/null && python3 -m json.tool .codex-plugin/plugin.json >/dev/null && find tools hooks -type f -name '*.sh' -exec sh -n {} \; && git diff --check:通過。
  • grep 舊版 command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/:未找到。
  • ./tools/wire-cli.sh status codex:目前本機已安裝快取仍是舊版,因此正確回報 plugin-user-prompt-root missing。
  • 使用臨時 CODEX_HOME 模擬新版快取後,./tools/wire-cli.sh status codex 回到預期 degraded,且 plugin-user-prompt-root present。
  • ./hooks/comment-scope.sh sweep:通過。

前置 Push Request

  • 無
## 摘要 - 需求描述:避免 Codex 讀取 Claude 外掛 manifest 時,因 `${CLAUDE_PLUGIN_ROOT}` 未設定而把 UserPromptSubmit hook 路徑展開成 `/hooks/...`。 - 計畫名稱:無 - 計畫頁:無 - 分析頁:無 ## 變更內容 | 檔案 | 為什麼改 | | --- | --- | | `hooks/hooks.json` | 所有 hook command 先取 `${CLAUDE_PLUGIN_ROOT}`,沒有時退回 `$JSC_HOME/current/jsc-hooks`。 | | `tools/wire-cli.sh` | Codex 狀態檢查新增 `plugin-user-prompt-root`,可查出已安裝快取仍含舊版 Claude-only command。 | | `skills/hooks-install/SKILL.md` | 補上 hooks manifest 也要使用穩定路徑 fallback 的技能規則。 | | `plugin.json`、`.claude-plugin/plugin.json`、`.codex-plugin/plugin.json` | 同步 jsc-hooks 版本。 | ## 設計重點 - 保留 Claude 原生 `${CLAUDE_PLUGIN_ROOT}` 行為。 - Codex 或其他 CLI 讀到同一份 manifest 時,改用 `$JSC_HOME/current/jsc-hooks`。 - 讓 `wire-cli.sh status codex` 能把舊快取風險列成缺漏項目。 ## 測試結果 - `python3 -m json.tool hooks/hooks.json >/dev/null && python3 -m json.tool plugin.json >/dev/null && python3 -m json.tool .claude-plugin/plugin.json >/dev/null && python3 -m json.tool .codex-plugin/plugin.json >/dev/null && find tools hooks -type f -name '*.sh' -exec sh -n {} \; && git diff --check`:通過。 - `grep` 舊版 `command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/`:未找到。 - `./tools/wire-cli.sh status codex`:目前本機已安裝快取仍是舊版,因此正確回報 `plugin-user-prompt-root missing`。 - 使用臨時 `CODEX_HOME` 模擬新版快取後,`./tools/wire-cli.sh status codex` 回到預期 `degraded`,且 `plugin-user-prompt-root present`。 - `./hooks/comment-scope.sh sweep`:通過。 ## 前置 Push Request - 無
jiantw83 added 1 commit 2026-08-28 10:07:59 +00:00
admin merged commit ca68de8540 into develop 2026-08-28 10:09:31 +00:00
admin deleted branch fix/codex-claude-hook-manifest 2026-08-28 10:09:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: plugins/hooks#50