Skip to content

[codex] Preserve VCS project config error causes#3474

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-vcs-project-config-error-causes
Jun 21, 2026
Merged

[codex] Preserve VCS project config error causes#3474
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-vcs-project-config-error-causes

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 21, 2026

Copy link
Copy Markdown
Member

VCS project configuration discovery intentionally recovers from inspect, read, and decode failures so repositories remain usable with the automatic provider fallback. The recovery logger previously flattened VcsProjectConfigError into its message and copied fields, which discarded the original platform or schema cause and its stack before the error was swallowed.

This change logs the structured VcsProjectConfigError itself and retains the existing safe operation, working-directory, config-path, and error-tag annotations. Recovery behavior remains unchanged: failed candidate inspection continues walking parent directories, while read and decode failures still resolve to auto. No configuration contents or credentials are added to logging.

The existing focused recovery tests now verify that inspect, read, and decode fallbacks observe the structured error object and retain its nested platform or schema cause.

Validation:

  • vp test run apps/server/src/vcs/VcsProjectConfig.test.ts (8 tests)
  • vp check
  • vp run typecheck

Note

Low Risk
Observability-only change to warning logs during existing auto-fallback paths; no change to config resolution or credentials in logs.

Overview
VCS config discovery still swallows inspect/read/decode failures and falls back to auto; this PR only changes what gets logged on those recovery paths.

logVcsProjectConfigError now passes the full VcsProjectConfigError to Effect.logWarning and adds operation, cwd, configPath, and errorTag via Effect.annotateLogs, instead of logging the message string plus a copied context object. That keeps the wrapped cause (e.g. PlatformError, SchemaError) available in logs. stack is no longer duplicated in log annotations.

Tests for inspect, read, and decode recovery now assert the logger receives a VcsProjectConfigError instance (with _tag and cause) rather than a [message, context] tuple.

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

Note

Preserve error causes in logVcsProjectConfigError by logging the error object directly

Changes logVcsProjectConfigError in VcsProjectConfig.ts to pass the full error object to Effect.logWarning instead of a message string with a context object. Metadata (operation, cwd, configPath, errorTag) is now attached via Effect.annotateLogs. Tests in VcsProjectConfig.test.ts are updated to assert on the logged VcsProjectConfigError instance and its cause rather than a string message and context tuple.

Macroscope summarized e89f06d.

@coderabbitai

coderabbitai Bot commented Jun 21, 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: 93e5fe22-6fbf-409d-8a25-9022205bd015

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-vcs-project-config-error-causes

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:XS 0-9 changed lines (additions + deletions). labels Jun 21, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/preserve-vcs-project-config-error-causes branch from 97bf166 to e89f06d Compare June 21, 2026 03:01
@macroscopeapp

macroscopeapp Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR refactors error logging to preserve error cause chains, changing only how VcsProjectConfig errors are formatted in logs. The change is self-contained with updated tests and has no business logic or security implications.

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

@juliusmarminge
juliusmarminge merged commit 6155f5c into main Jun 21, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/preserve-vcs-project-config-error-causes branch June 21, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 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