Skip to content

[codex] enrich Git workflow errors#3241

Merged
juliusmarminge merged 3 commits into
mainfrom
codex/enrich-server-vcs-errors
Jun 20, 2026
Merged

[codex] enrich Git workflow errors#3241
juliusmarminge merged 3 commits into
mainfrom
codex/enrich-server-vcs-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add structured cwd context to GitManagerError and populate it at every construction site
  • remove constructor-only Git manager and Git workflow error helpers in favor of explicit errors at the failure boundary
  • preserve upstream VCS failures as cause while keeping user-facing detail independent of cause.message
  • retain the existing Git manager error message format while exposing the workspace path structurally

Why

Git workflow routing failures previously flattened upstream errors into detail, discarded the original cause, and sometimes embedded cwd only inside message text. That made failures harder to correlate and broke the causal stack. The constructor helpers also obscured which fields were actually attached.

Validation

  • vp test run apps/server/src/git/GitWorkflowService.test.ts apps/server/src/git/GitManager.test.ts apps/server/src/vcs/VcsStatusBroadcaster.test.ts (75 tests)
  • vp check (passes with existing unrelated warnings)
  • vp run typecheck

Note

Medium Risk
cwd is now mandatory on GitManagerError, so any missed construction site will fail at runtime; error shape and logging behavior changes affect all Git workflow and status streaming paths.

Overview
GitManagerError now requires a cwd field in contracts, and every throw site in GitManager / GitWorkflowService builds errors explicitly (helper constructors removed) with stable detail text while chaining upstream failures via cause instead of copying their messages.

GitWorkflowService maps VCS registry detect/resolve failures to fixed user-facing details and asserts upstream secrets stay out of error.message (new tests).

VcsStatusBroadcaster logs remote refresh failures using remoteRefreshFailureDiagnostics (counts, tags, operations) plus cwdLength rather than full paths or cause.toString(); interrupts on failed refreshes propagate immediately instead of being retried as failures.

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

Note

Add cwd field to Git workflow errors and sanitize remote poller failure logs

  • Adds a required cwd field to GitManagerError in git.ts, propagated to all construction sites in GitManager.ts and GitWorkflowService.ts.
  • Replaces the removed gitManagerError/unsupportedGitWorkflow helper functions with inline error construction that includes cwd and structured cause.
  • Introduces remoteRefreshFailureDiagnostics in VcsStatusBroadcaster.ts to produce sanitized failure summaries (counts, tags, operations) without exposing raw cause strings or repo paths.
  • Fixes the remote poller in VcsStatusBroadcaster to stop on interruption causes instead of continuing, and replaces exit.cause.toString() in warning logs with sanitized diagnostics and cwdLength.
  • Behavioral Change: GitManagerError now requires cwd at construction — any code building these errors directly must be updated.

Macroscope summarized 94b5e0a.

Co-authored-by: codex <codex@users.noreply.github.com>
@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: c8bc4f80-c549-47b9-a9a4-49b8fbf950be

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/enrich-server-vcs-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:L 100-499 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

This PR enriches Git workflow errors by adding a cwd field for debugging context and introduces safe diagnostic logging that avoids exposing sensitive file paths. The changes are mechanical refactoring of error construction with no impact on runtime behavior beyond improved error messages.

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

Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 18:00

Dismissing prior approval to re-evaluate 3c998fc

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 20:10

Dismissing prior approval to re-evaluate 94b5e0a

@juliusmarminge
juliusmarminge merged commit c637dfc into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/enrich-server-vcs-errors branch June 20, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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