fix: show clear error when project directory is missing#1008
fix: show clear error when project directory is missing#1008chuks-qua wants to merge 10 commits intopingdotgg:mainfrom
Conversation
…oject directories
Add a WS endpoint (projects.checkDirectories) that checks whether project directories exist on disk, a React hook that calls it on mount and window focus (debounced at 500ms), and a generic request() method on NativeApi for untyped RPC calls.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolve merge conflicts in Sidebar.tsx and __root.tsx after upstream removed newThreadId, preferredTerminalEditor, and related store selectors.
|
@juliusmarminge could you please authorize the ci, and check review please |
What Changed
When a project folder is deleted or moved, the app now shows a clear "Project directory does not exist" error instead of the misleading "Codex CLI (codex) is not installed or not executable" message. The composer is disabled, sidebar threads show strikethrough styling, and everything auto-recovers when the folder is restored.
Why
Fixes #975. When a project directory no longer exists,
spawnSync("codex", ["--version"], { cwd: deletedPath })fails with ENOENT. The existing code assumed ENOENT always meant the binary was missing, producing a confusing error. Users had no way to understand the actual problem or recover from it.Key Changes
assertSupportedCodexCliVersionby checkingexistsSync(input.cwd)in the error path (zero cost in happy path)projects.checkDirectoriesmethod that stats project cwds in parallel viaEffect.forEachuseProjectDirectoryCheckchecks directories on mount and window focus (debounced 500ms), using shallow-compared cwd selectors to avoid unnecessary re-checksline-through text-destructive/60strikethroughUI Changes
Before
After
Checklist
Note
Show clear error and disable chat input when project directory is missing
projects.checkDirectoriesWebSocket RPC endpoint in wsServer.ts that stats each provided path and returns missing or non-directory cwds.missingProjectCwdsset in the app store.ThreadErrorBannerwhen the active project directory is missing.cwdand a missing CLI binary on ENOENT failures.Macroscope summarized 29fb16a.