Skip to content

[codex] Structure VCS project config failures#3315

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/structure-vcs-project-config-errors
Jun 20, 2026
Merged

[codex] Structure VCS project config failures#3315
juliusmarminge merged 2 commits into
mainfrom
codex/structure-vcs-project-config-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary:

  • retain inspect, read, and decode context for VCS project-config failures
  • preserve original filesystem and schema causes while keeping the best-effort auto fallback
  • verify structured logs for malformed and unreadable config paths

Tests:

  • vp test apps/server/src/vcs/VcsProjectConfig.test.ts
  • vp check
  • vp run typecheck

Note

Low Risk
Changes are localized to VCS config discovery with preserved auto fallback; main effect is new warning logs on previously silent failures.

Overview
VCS project config resolution now surfaces inspect, read, and decode failures as VcsProjectConfigError (operation, cwd, configPath, original cause) instead of silently treating them as missing or invalid config.

resolveKind still falls back to auto, but emits structured warnings via logVcsProjectConfigError. JSON parsing uses decodeUnknownEffect so decode failures are typed errors, not Option.none. During parent walk, a failed exists check on a candidate path is logged and skipped so a valid parent .t3code/vcs.json can still be used.

Tests cover error shape, inspect-then-parent behavior, and warning log fields for malformed JSON and unreadable paths.

Reviewed by Cursor Bugbot for commit 569a697. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Structure VCS project config failures with typed errors and structured logging

  • Introduces VcsProjectConfigError, a tagged error class carrying operation ('inspect' | 'read' | 'decode'), cwd, configPath, and cause, replacing silent Option.none fallbacks with typed failures.
  • Adds logVcsProjectConfigError to emit structured warnings with operation, path, and stack context whenever config inspection, reading, or decoding fails.
  • findConfigPath now catches inspect errors, logs them, and continues traversal to parent directories instead of aborting.
  • resolveKind catches all VcsProjectConfigError variants, logs a structured warning, and falls back to 'auto' rather than propagating the failure.
  • Behavioral Change: decode errors now fail the Effect pipeline rather than silently returning Option.none; all failure paths now produce log output.

Macroscope summarized 569a697.

@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: e0c1229a-3970-497e-9747-f96f3c87f1bb

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/structure-vcs-project-config-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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Inspect failures abort config discovery
    • Replaced Effect.mapError (which propagated the error and aborted the directory walk) with Effect.orElseSucceed(() => false) so that a failed fileSystem.exists is treated as 'not found' and the upward search continues to parent directories.

Create PR

Or push these changes by commenting:

@cursor push 99690f3d5b
Preview (99690f3d5b)
diff --git a/apps/server/src/vcs/VcsProjectConfig.ts b/apps/server/src/vcs/VcsProjectConfig.ts
--- a/apps/server/src/vcs/VcsProjectConfig.ts
+++ b/apps/server/src/vcs/VcsProjectConfig.ts
@@ -62,17 +62,7 @@
     let current = cwd;
     while (true) {
       const candidate = path.join(current, ".t3code", "vcs.json");
-      const exists = yield* fileSystem.exists(candidate).pipe(
-        Effect.mapError(
-          (cause) =>
-            new VcsProjectConfigError({
-              operation: "inspect",
-              cwd,
-              configPath: candidate,
-              cause,
-            }),
-        ),
-      );
+      const exists = yield* fileSystem.exists(candidate).pipe(Effect.orElseSucceed(() => false));
       if (exists) {
         return Option.some(candidate);
       }

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 69d4522. Configure here.

Comment thread apps/server/src/vcs/VcsProjectConfig.ts
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR refactors error handling in VcsProjectConfig to use structured errors with better context (operation, cwd, configPath) for logging and debugging. Runtime behavior remains unchanged - errors still gracefully fall back to 'auto'. Tests thoroughly verify the new error structure.

You can customize Macroscope's approvability policy. Learn more.

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/structure-vcs-project-config-errors branch from 69d4522 to 0502c5e Compare June 20, 2026 12:07
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 17:17

Dismissing prior approval to re-evaluate 569a697

@juliusmarminge
juliusmarminge merged commit 1cbe8a7 into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/structure-vcs-project-config-errors branch June 20, 2026 18:51
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