mirror of
https://github.com/stablyai/orca.git
synced 2026-11-06 12:07:58 +00:00
Every native terminal spawn schedules a Codex hook reconcile, which resolved the Codex path twice with a synchronous stat scan of PATH and install dirs (~50ms main-process block per spawn on Windows with a long PATH and no Codex). The reconcile now resolves the path once and passes it to both the live lookup and the saved-answer read. On Windows, where each stat is slow, that lookup runs every read (PATH candidates, nvm dirs and aliases, install dirs) through fs/promises; macOS and Linux keep the sync scan, now run once. Sync and async share one lookup that yields its reads, so they cannot diverge. Hook rechecks stay immediate on every spawn and nothing is cached. A spawn that lands before a run's hook-file pass (while it is still finding Codex or waiting for its answer) gets one trailing rerun, so an install or upgrade that moved Codex mid-run cannot leave hooks unchecked. Fixes #35565 Co-authored-by: Chad Tolkien <chad@sodadigital.com.au>