fix: show clear error when project directory is missing#1008
fix: show clear error when project directory is missing#1008chuks-qua wants to merge 8 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 Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
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
Sidebar (strikethrough on threads with missing directory):
Chat view (error banner + disabled composer):
Recovery (after restoring the folder and focusing the window):
Checklist
Note
Show clear error in chat UI when a project directory is missing
projects.checkDirectoriesWebSocket RPC method (ws.ts, wsServer.ts) that accepts a list of paths and returns which ones are missing or not directories.useProjectDirectoryCheckhook polls on mount, on project change, and on window focus, storing results in a newmissingProjectCwdsset in the app store.ChatViewdisables the composer, shows a non-dismissible error banner, and blocks message sending.Sidebarrender with line-through and destructive color for missing directories.assertSupportedCodexCliVersionnow distinguishes between a missing CLI binary and a missing project directory when ENOENT is returned.Macroscope summarized 17f3f5a.