Skip to content

[Bug]: Codex hooks fail on Windows when user path contains spaces #6078

Closed

Description

@jorge-huxley

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?

  1. Use Windows with a user profile path containing a space, such as C:\Users\Jorge Silva.
  2. Launch Codex through Orca with agent hooks enabled.
  3. Start a new Codex session.
  4. Submit a prompt.
  5. Observe SessionStart and UserPromptSubmit hook 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

  1. Jinwoo-H commented on Jun 22, 2026

    @Jinwoo-H
    Contributor

    will be in next release, usually within 24 hours

  2. added theissue type on Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingos:Windowssize/sSmall PR (≤150 added lines, ≤10 files)

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions