After deleting all projects, the Hooks page shows "No hooks found", but the plugin-level SessionStart hook still takes effect

Open 💬 2 comments Opened Jun 30, 2026 by ZLWMF
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop App 26.623.70822 (build 4559)

What subscription do you have?

删除所有项目后,Hooks 页面显示“未找到钩子”,但插件级 SessionStart hook 实际仍然生效。疑似 Hooks 设置页在 project-order 为空时没有展示全局/插件级 hooks

What platform is your computer?

macOS

What issue are you seeing?

019f1820-99d4-7301-874f-de4e2b8cb513
删除所有项目后,Hooks 页面显示“未找到钩子”,但插件级 SessionStart hook 实际仍然生效。疑似 Hooks 设置页在 project-order 为空时没有展示全局/插件级 hooks

What steps can reproduce the bug?

Feedback ID: 019f1820-99d4-7301-874f-de4e2b8cb513

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

English translation:

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop App 26.623.70822 (build 4559)

What subscription do you have?

After deleting all projects, the Hooks page shows "No hooks found", but the plugin-level SessionStart hook still takes effect. It seems the Hooks settings page does not display global/plugin-level hooks when project-order is empty.

What platform is your computer?

macOS

What issue are you seeing?

019f1820-99d4-7301-874f-de4e2b8cb513
After deleting all projects, the Hooks page shows "No hooks found", but the plugin-level SessionStart hook still takes effect. It seems the Hooks settings page does not display global/plugin-level hooks when project-order is empty.

What steps can reproduce the bug?

Feedback ID: 019f1820-99d4-7301-874f-de4e2b8cb513

What is the expected behavior?

_No response_

Additional information

_No response_

<!-- codex-issue-translator -->

luvs01 · 1 day ago

Still reproducible on Windows with Codex Desktop 26.820.9563.0 (bundled app-server/core 0.150.0-alpha.8).

I traced the projectless / zero-saved-project case:

  • Opening the Hooks settings page and pressing Reload produced zero hooks/list requests in the Desktop log. The empty state is selected before the RPC layer.
  • The renderer query is enabled only when cwds != null && cwds.length > 0; its query function also throws Cannot list hooks without project roots for an empty list.
  • The exact same bundled app-server successfully handles hooks/list with { "cwds": [] } and returns the global plugin SessionStart hook as source: "plugin", enabled: true, trustStatus: "untrusted", with no warnings or errors.
  • The renderer's later grouping code would display that object; untrusted only increments the review-needed count and does not filter the hook out.

This isolates the bug to the Desktop UI's project-root gate, not plugin discovery or trust. Global/user/plugin hooks should remain discoverable and reviewable when there are no saved projects.

Suggested fix:

  1. Allow hooks/list to run with cwds: [].
  2. Render user/admin/plugin/session sources from that response while leaving project sections empty.
  3. Keep Reload enabled for this state.

Useful regression cases:

  • zero saved projects + plugin hook -> hook is shown as needing review;
  • zero saved projects + user hook -> hook is shown;
  • zero saved projects + no hooks -> true empty state;
  • project-root hooks continue to be grouped by project.

This also matches the documented behavior that Codex lists configured hooks before deciding whether they can run: https://learn.chatgpt.com/docs/hooks