[codex] Preserve workspace root stat failures - #3278
Conversation
|
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)
Comment |
ApprovabilityVerdict: Approved Straightforward bug fix that properly preserves filesystem stat failures instead of silently swallowing them as 'not found' errors. Changes are additive (new error class, handler, tests) with clear intent and limited scope. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate a7fd4b7
Co-authored-by: codex <codex@users.noreply.github.com>
a7fd4b7 to
a0c9461
Compare
Dismissing prior approval to re-evaluate a0c9461
Co-authored-by: codex <codex@users.noreply.github.com> (cherry picked from commit be56fa4)
Summary
Validation
vp test apps/server/src/workspace/WorkspacePaths.test.ts apps/server/src/workspace/WorkspaceEntries.test.ts apps/server/src/server.test.tsvp checkvp run typecheckOverlap
apps/server/src/workspace/WorkspaceEntries.tsalso changes in fix: include Windows directory junctions in project browser #2798; this PR only adds the new error union member there.Note
Low Risk
Narrow error-handling change in workspace path validation with clearer client-facing failures; no auth or data mutation paths.
Overview
Workspace root validation no longer treats every
statfailure as “path missing.” OnlyNotFoundstill maps toWorkspaceRootNotExistsError; permission and other platform errors become a newWorkspaceRootStatFailedErrorwithphase(validate-existingorverify-created) and the original cause.That error is wired through
WorkspaceEntries, the websocketProjectListEntriesfailure mapping (workspace_root_stat_failed+detail), andpackages/contracts. Integration coverage asserts the RPC reportsworkspace_root_stat_failedwhen the root directory is unreadable (non-Windows).Reviewed by Cursor Bugbot for commit a0c9461. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Propagate workspace root stat failures as distinct
workspace_root_stat_failederrorsnormalizeWorkspaceRootwere swallowed viaorElseSucceed(null), treating permission errors and other non-NotFound failures as "missing directory".WorkspaceRootStatFailedErrorinWorkspacePaths.tswith aphasefield (validate-existingorverify-created) and the original cause, so callers can distinguish stat failures from missing directories.workspace_root_stat_failedwith thephaseas detail inws.ts.ProjectEntriesFailurecontract schema andWorkspaceEntriesErrorunion to include the new error variant.Macroscope summarized a0c9461.