VS Code extension skips lifecycle hooks although bundled CLI and direct app-server run them
What version of the IDE extension are you using?
openai.chatgpt-26.707.71524-win32-x64 (bundled Codex CLI/runtime 0.144.2)
What subscription do you have?
ChatGPT paid subscription
Which IDE are you using?
Visual Studio Code
What platform is your computer?
Windows 11 Pro 10.0.26200 x64
What issue are you seeing?
No lifecycle hooks run in real VS Code extension threads, even though the same trusted project hook configuration runs correctly with the exact same extension-bundled Codex binary in both CLI mode and direct app-server mode.
In a fresh VS Code Codex thread, the rollout goes from task start to user prompt to answer with:
- no
hook/started - no
hook/completed - no
SessionStarthook output - no
UserPromptSubmithook output
The extension log likewise contains no hook execution for the thread. This is a controlled differential: the hook scripts, configuration, trust, OS support, and executable are held constant; only the real codex_vscode thread path fails.
What steps can reproduce the bug?
- In a trusted repository, configure command hooks in
.codex/hooks.jsonforSessionStartandUserPromptSubmit. - Run the hooks with the extension-bundled
codex.exein CLI mode. Both execute. - Start that exact bundled binary directly in app-server mode with the real user/project configuration. Both hooks emit
hook/started,hook/completed, and inject their expected context. - Reload the VS Code window.
- Create a brand-new Codex chat in that repository.
- Send one prompt:
Reply exactly: hook probe received.
Controlled VS Code session:
- session id:
019f6723-e218-7a53-914f-3ee47d502f61 - originator:
codex_vscode - runtime:
0.144.2
The rollout contains the task start, prompt, and answer, but zero hook events or injected hook output.
What is the expected behavior?
The VS Code extension should load and execute the same trusted project/user lifecycle hooks as CLI and direct app-server, including SessionStart, UserPromptSubmit, and PreCompact.
Additional information
Why this is not a script/config/trust failure:
- The same hooks/config/trust pass the project verifier.
- The same exact bundled Codex binary executes them in CLI mode.
- The same exact bundled binary executes them through direct app-server mode with the real configuration.
- Only the real
codex_vscodethread path omits them. - The extension bundle itself contains handlers for
hook/startedandhook/completed.
Related:
- #17930 was closed because hooks were said to already work in the IDE extension and app.
- #18090 was closed because its bundled Windows CLI was too old and the next releases would include Windows hook support. In this report, the current bundled CLI does support and execute Windows hooks; the failure is isolated to the extension thread path.
- Hooks docs: https://learn.chatgpt.com/docs/hooks
- Advanced config: https://developers.openai.com/codex/config-advanced#hooks