mirror of
https://github.com/openai/codex.git
synced 2026-10-27 18:48:37 +00:00
## Why `PermissionRequest` and `PostToolUse` hook inputs could report the turn's working directory instead of the local command's execution directory. This also affected commands whose results were collected in a later turn after the working directory changed. ## What changed - Report the local command's execution directory in hook input `cwd`, consistent with `PreToolUse`. - Preserve the original directory through `write_stdin` approvals and delayed completion, including network permission requests. - Retain the host directory for remote commands and keep hook process working directories unchanged. ## Testing Add coverage for relative and absolute workdirs, approval denials, command rewrites, completion and stdin approval across turns, remote command fallback, network approvals, and Unix and Windows path formatting. GitOrigin-RevId: ef5dad2a0634dda9edb2f841ef4fe49ae0d1187d