[codex] Preserve workspace RPC error messages - #3222
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 This PR refactors error handling to preserve detailed error messages at RPC boundaries instead of generic messages. The changes are limited to error formatting with comprehensive test coverage verifying the expected behavior. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
ab25ea9 to
6ab8b61
Compare
Summary
Testing
vp test apps/server/src/server.test.ts apps/server/src/workspace/WorkspaceEntries.test.ts apps/server/src/workspace/WorkspaceFileSystem.test.ts apps/server/src/project/ProjectSetupScriptRunner.test.ts(121 passed)vp checkvp run typecheckNote
Medium Risk
Changes user-visible error strings and error types for workspace RPC consumers; behavior is intentional but callers matching on the old
WorkspaceEntriesErrorwrapper need to handle specific variants.Overview
Restores specific failure text for workspace WebSocket RPCs and setup-script activity instead of generic one-liners.
WorkspaceEntriesno longer wraps list/search/normalize failures in a single taggedWorkspaceEntriesError; underlyingWorkspacePathsandWorkspaceSearchIndexvariants propagate.ws.tsmaps those variants (and browse/read/setup errors) into compatibility messages appended to RPC errors—e.g. missing workspace root, ENOENT on browse, outside-root file reads, and setup causes likepty unavailable.ProjectSetupScriptProjectNotFoundErroruses a shorter fixed message at the boundary.Integration tests now assert the full expected strings across search, list, read, and browse failures.
Reviewed by Cursor Bugbot for commit 6ab8b61. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve specific error messages in workspace RPC failure responses
projects.searchEntries,projects.listEntries,projects.readFile, andfilesystem.browseRPC handlers with error-variant-specific messages that include the exact cause (e.g., non-existent workspace root, ENOENT on directory scan).WorkspaceEntriesErrorwrapper class in WorkspaceEntries.ts so underlying errors fromWorkspacePathsandWorkspaceSearchIndexpropagate with their original types and messages.workspaceEntriesCompatibilityDetail,workspaceBrowseCompatibilityDetail,projectSetupScriptCompatibilityDetail) to map granular error variants to human-readable strings.WorkspaceEntriesErrorwill no longer receive that type; they must now handle the specific variants (e.g.,WorkspaceRootNotExistsError,WorkspaceSearchIndexSearchFailed).Macroscope summarized 6ab8b61.