[Windows Desktop 26.707.9981.0] Trusted hook orchestration completes but PowerShell handler never reaches script entry

Open 💬 3 comments Opened Jul 16, 2026 by gianajf
💡 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?

  • Codex Desktop: 26.707.9981.0 (x64)
  • Packaged Codex CLI: 0.144.2
  • Platform: Windows

What issue are you seeing?

A trusted project UserPromptSubmit hook is selected by Codex Desktop and generic hook orchestration runs, but the configured PowerShell handler never reaches the script's first durable telemetry marker.

Desktop emits:

  • turn/started
  • hook/started
  • hook/completed

During the same window, two PowerShell hosts start, but Codex Desktop does not persist enough execution evidence to identify the configured child process or determine its result. The production hook telemetry remains byte-for-byte unchanged, stdout parsing is not reached, and no additionalContext is attached.

Configured command

"C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -NonInteractive -File "<PROJECT_ROOT>\memory\SESSION-CONTINUITY\hooks\itagent-continuity.ps1" -Event userPromptSubmit

The handler is trusted, syntactically valid, and succeeds when invoked directly. Direct validation confirms:

  • exit code 0
  • valid JSON
  • expected hookSpecificOutput.additionalContext shape
  • correct variable expansion
  • privacy/output-shape checks pass

Reproduction

  1. Configure and trust a project-local UserPromptSubmit hook that invokes PowerShell 7 with -NoProfile -NonInteractive -File ... -Event userPromptSubmit.
  2. Add a durable marker at the first executable line of the production script.
  3. Send a later-turn prompt in Codex Desktop.
  4. Observe hook/started and hook/completed in Desktop logs.
  5. Observe that the production script's first marker is never written.
  6. Observe that no model-visible additionalContext is attached.

Actual behavior

  • Hook orchestration starts and completes generically.
  • The configured production script does not reach entry telemetry.
  • Actual child command line, resolved image path, parent/child PID relation, spawn result, exit code, stdout, and stderr are not persisted.
  • hook/completed does not prove successful execution, valid JSON, or empty stderr.
  • Stdout parsing and context attachment are not reached.

Expected behavior

Codex Desktop should:

  1. launch the exact trusted hook command;
  2. capture spawn result, exit code, stdout, and stderr;
  3. parse valid hook JSON;
  4. attach additionalContext to the model input;
  5. persist enough diagnostic information to distinguish launch failure, child-process failure, parse failure, and attachment failure.

Evidence summary

  • Repaired hook SHA-256: 19ebea91b6302633f64aac5206bbc7990b66c3c3c90063d9e5c85da762d3b394
  • Desktop app binary is validly signed by OpenAI.
  • Two PowerShell processes started between turn/started and hook/completed, but neither could be safely attributed to the configured hook.
  • Production telemetry remained unchanged at 12 records.
  • Repeated MoAppCrash events with problem code c06d007f were temporally correlated with several affected turns, but causation is not claimed.
  • No project hook/config/trust change occurred during reproduction.

Failure boundary

The product selects the trusted hook and begins orchestration, but execution fails somewhere between PowerShell host startup and production-script entry. The exact sub-boundary remains hidden because Desktop does not persist child-command, exit, stdout, or stderr details.

A privacy-minimised maintainer package exists locally with reproduction, crash evidence, and verification manifests. I can provide specific sanitized excerpts requested by maintainers.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #32402

Powered by Codex Action

gianajf · 1 month ago

Related open regression: #21639 documents Codex Desktop hooks failing after an update, including cases where the same hooks succeed through CLI but not Desktop/app-server execution. This Windows report is narrower: Desktop emits hook/started and hook/completed, PowerShell hosts appear, but the configured script never reaches its first durable marker and no additionalContext is attached. No safe ITAgent-side repair is currently evidence-supported. Please treat this issue as unresolved until Desktop child-command execution and result handling are fixed or a supported migration/workaround is documented.

xixi1990beibei · 1 month ago

Thanks for documenting this. I may be seeing the same execution boundary on Windows Desktop, with a native executable rather than PowerShell.

Environment:

  • Codex Desktop on Windows 11 x64
  • Event: UserPromptSubmit
  • Hook is enabled and trusted in the Desktop Hooks UI
  • commandWindows: %PLUGIN_ROOT%\dist\usetokensaver-hook.exe

Observed:

  • Direct CLI/SEA validation of the executable succeeds.
  • A synthetic Desktop submission reaches the model.
  • No hook intervention/evidence record or model-visible additionalContext is produced.
  • Local Application, AppLocker, and Defender logs contain no matching block or crash event.

This does not appear to be the quoted-path/cmd.exe case in #32402 because the configured command contains no quoted executable path.

Could maintainers confirm whether Desktop persists the child-process spawn result, exit code, stdout, and stderr for a trusted UserPromptSubmit hook, and whether plugin-bundled hooks are supported on this surface? A redacted diagnostic or supported workaround would help.