Skip to content

[codex] Preserve workspace root stat failures - #3278

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-workspace-root-stat-errors
Jun 20, 2026
Merged

[codex] Preserve workspace root stat failures#3278
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-workspace-root-stat-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • distinguish missing workspace roots from non-NotFound stat failures
  • preserve the original platform cause with root, normalized path, and validation phase
  • propagate the structured failure through workspace entries and the websocket compatibility boundary
  • cover validation, post-create verification, and RPC display behavior

Validation

  • vp test apps/server/src/workspace/WorkspacePaths.test.ts apps/server/src/workspace/WorkspaceEntries.test.ts apps/server/src/server.test.ts
  • vp check
  • vp run typecheck

Overlap


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 stat failure as “path missing.” Only NotFound still maps to WorkspaceRootNotExistsError; permission and other platform errors become a new WorkspaceRootStatFailedError with phase (validate-existing or verify-created) and the original cause.

That error is wired through WorkspaceEntries, the websocket ProjectListEntries failure mapping (workspace_root_stat_failed + detail), and packages/contracts. Integration coverage asserts the RPC reports workspace_root_stat_failed when 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_failed errors

  • Previously, all stat failures on the workspace root in normalizeWorkspaceRoot were swallowed via orElseSucceed(null), treating permission errors and other non-NotFound failures as "missing directory".
  • Introduces WorkspaceRootStatFailedError in WorkspacePaths.ts with a phase field (validate-existing or verify-created) and the original cause, so callers can distinguish stat failures from missing directories.
  • Surfaces this error through the WebSocket project listing response as workspace_root_stat_failed with the phase as detail in ws.ts.
  • Extends the ProjectEntriesFailure contract schema and WorkspaceEntriesError union to include the new error variant.
  • Behavioral Change: non-NotFound stat errors on the workspace root now propagate as failures instead of being silently treated as not found.

Macroscope summarized a0c9461.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cb5fe854-77e4-4409-8518-b1061861a742

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/preserve-workspace-root-stat-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@juliusmarminge
juliusmarminge marked this pull request as draft June 20, 2026 10:52
@juliusmarminge
juliusmarminge marked this pull request as ready for review June 20, 2026 10:52
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 10:53

Dismissing prior approval to re-evaluate a7fd4b7

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/preserve-workspace-root-stat-errors branch from a7fd4b7 to a0c9461 Compare June 20, 2026 19:39
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 19:39

Dismissing prior approval to re-evaluate a0c9461

@juliusmarminge
juliusmarminge merged commit be56fa4 into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/preserve-workspace-root-stat-errors branch June 20, 2026 19:59
sukar0972 pushed a commit to sukar0972/moreCode that referenced this pull request Jun 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit be56fa4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant