mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
## Summary Fixes #9041 - Adds update_search_dir() method to FileSearchManager to allow updating the search directory after initialization - Calls this method when the session CWD changes: new session, resume, or fork ## Problem The FileSearchManager was created once with the initial search_dir and never updated. When a user: 1. Starts Codex in a non-git directory (e.g., /tmp/random) 2. Resumes or forks a session from a different workspace 3. The @filename lookup still searched the original directory This caused no matches to be returned even when files existed in the current workspace. ## Solution Update FileSearchManager.search_dir whenever the session working directory changes: - AppEvent::NewSession: Use current config CWD - SessionSelection::Resume: Use resumed session CWD - SessionSelection::Fork: Use forked session CWD ## Test plan - [ ] Start Codex in /tmp/test-dir (non-git) - [ ] Resume a session from a project with actual files - [ ] Verify @filename returns matches from the resumed session directory --------- Co-authored-by: Eric Traut <etraut@openai.com>