Repository navigation
Description
Operating system
Windows
Orca version
v1.4.91.0
Details
Short summary
Orca-generated Codex hook commands are not safely invoked on Windows when the Windows user profile path contains a space.
What happened?
When Codex was launched through Orca, the SessionStart and UserPromptSubmit hooks failed with exit code 1:
SessionStart hook (failed)
error: hook exited with code 1
UserPromptSubmit hook (failed)
error: hook exited with code 1
Orca generated the following command in its Codex runtime hook configuration:
"command": "C:\\Users\\Jorge Silva\\.orca\\agent-hooks\\codex-hook.cmd"The active configuration was located at:
%APPDATA%\orca\codex-runtime-home\home\hooks.json
The normal %USERPROFILE%\.codex\hooks.json file was not the configuration used by the Orca-launched Codex process because Orca sets CODEX_HOME to its own runtime directory.
On Windows, the generated command is split at the space in Jorge Silva, so the hook runner attempts to execute an invalid path.
How can we reproduce it?
- Use Windows with a user profile path containing a space, such as
C:\Users\Jorge Silva. - Launch Codex through Orca with agent hooks enabled.
- Start a new Codex session.
- Submit a prompt.
- Observe
SessionStartandUserPromptSubmithook failures with exit code 1.
Expected behavior
Orca should generate a Windows-safe command that explicitly invokes the batch file through cmd.exe and quotes its path:
"command": "cmd.exe /d /c call \"C:\\Users\\Jorge Silva\\.orca\\agent-hooks\\codex-hook.cmd\""Confirmed workaround
Replacing every Orca Codex hook command in %APPDATA%\orca\codex-runtime-home\home\hooks.json with the following fixes the issue:
cmd.exe /d /c call "C:\Users\Jorge Silva\.orca\agent-hooks\codex-hook.cmd"
After applying this change:
SessionStart_exit=0
UserPromptSubmit_exit=0
The fix was also confirmed by restarting Codex through Orca and using it normally.
Suggested fix
When generating Codex hook configuration on Windows, Orca should invoke .cmd hook files through cmd.exe /d /c call and quote the full path. This should be covered by a test using a Windows profile path containing spaces.
Orca should also preserve this safe command format whenever it regenerates the runtime hooks.json file.
Activity
fix(agent-hooks): wrap Windows hook commands in cmd.exe to survive sp…
Jinwoo-H commentedon Jun 22, 2026
will be in next release, usually within 24 hours
Speed up Windows Codex/Claude hooks without dropping events (#6402)
fix(agent-hooks): ship the launcher shape #16003 actually measured as…
fix(agent-hooks): stop the Windows hook launcher spelling the AV-deni…
fix(agent-hooks): stop the Windows hook launcher spelling the AV-deni…
fix(agent-hooks): stop the Windows hook launcher spelling the AV-deni…
fix(agent-hooks): stop the Windows hook launcher spelling the AV-deni…
test: retire hook and installer cases whose guards or arithmetic cann…
fix(agent-hooks): wrap Windows hook commands in cmd.exe to survive sp…
Speed up Windows Codex/Claude hooks without dropping events (stablyai…
fix(claude): use Git Bash-safe hook fast path
fix(agent-hooks): stop the Windows hook launcher spelling the AV-deni…