[codex] enrich Git workflow errors#3241
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
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 enriches Git workflow errors by adding a You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 3c998fc
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 94b5e0a
Summary
cwdcontext toGitManagerErrorand populate it at every construction sitecausewhile keeping user-facingdetailindependent ofcause.messageWhy
Git workflow routing failures previously flattened upstream errors into
detail, discarded the original cause, and sometimes embeddedcwdonly 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 typecheckNote
Medium Risk
cwdis now mandatory onGitManagerError, so any missed construction site will fail at runtime; error shape and logging behavior changes affect all Git workflow and status streaming paths.Overview
GitManagerErrornow requires acwdfield in contracts, and every throw site inGitManager/GitWorkflowServicebuilds errors explicitly (helper constructors removed) with stabledetailtext while chaining upstream failures viacauseinstead of copying their messages.GitWorkflowServicemaps VCS registry detect/resolve failures to fixed user-facing details and asserts upstream secrets stay out oferror.message(new tests).VcsStatusBroadcasterlogs remote refresh failures usingremoteRefreshFailureDiagnostics(counts, tags, operations) pluscwdLengthrather than full paths orcause.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
cwdfield to Git workflow errors and sanitize remote poller failure logscwdfield toGitManagerErrorin git.ts, propagated to all construction sites inGitManager.tsandGitWorkflowService.ts.gitManagerError/unsupportedGitWorkflowhelper functions with inline error construction that includescwdand structuredcause.remoteRefreshFailureDiagnosticsinVcsStatusBroadcaster.tsto produce sanitized failure summaries (counts, tags, operations) without exposing raw cause strings or repo paths.VcsStatusBroadcasterto stop on interruption causes instead of continuing, and replacesexit.cause.toString()in warning logs with sanitized diagnostics andcwdLength.GitManagerErrornow requirescwdat construction — any code building these errors directly must be updated.Macroscope summarized 94b5e0a.