Skip to content
Source
Sign inSign up
pingdotgg/t3code

[codex] Enrich Git VCS driver errors #3253

Mergedjuliusmarmingemerged 5 commits intomain fromrefs/pull/3253/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • give Git command failures structured operation, cwd, fixed executable, argument-count, exit-code, and output-length context
  • keep raw argv, stdout, and stderr out of direct error fields and messages while preserving exact platform and crypto causes
  • detect missing working directories structurally and classify non-repository results before constructing sanitized errors
  • remove the synthetic remove-worktree wrapper so callers retain the original Git failure

Validation

  • vp test apps/server/src/vcs/GitVcsDriverCore.test.ts apps/server/src/git/GitManager.test.ts (82 tests)
  • vp check
  • vp run typecheck
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: 7b76cd94-b657-4ab8-959b-ee9bd3929a4c

      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-git-vcs-driver-errors`

      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved

      This PR refactors Git VCS driver error handling to provide more structured error metadata while removing raw command arguments and stderr from error messages (a security improvement). The changes don't affect git operation logic, only error reporting, and include comprehensive test updates.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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: Non-git cwd status regression
        • Added stderr substring checks for 'not a git repository' in both readStatusDetailsLocal and readStatusDetailsRemote before the generic GitCommandError throw, returning the non-repository sentinel values so GitManager correctly identifies non-git directories.

      Create PR

      Or push these changes by commenting:

      @cursor push 51cf41d948
      Preview (pingdotgg/t3code@51cf41d948)
      diff --git a/apps/server/src/vcs/GitVcsDriverCore.ts b/apps/server/src/vcs/GitVcsDriverCore.ts
      --- a/apps/server/src/vcs/GitVcsDriverCore.ts
      +++ b/apps/server/src/vcs/GitVcsDriverCore.ts
      @@ -1196,6 +1196,9 @@
             return NON_REPOSITORY_REMOTE_STATUS_DETAILS;
           }
           if (branchResult.exitCode !== 0) {
      +      if (branchResult.stderr.toLowerCase().includes("not a git repository")) {
      +        return NON_REPOSITORY_REMOTE_STATUS_DETAILS;
      +      }
             return yield* new GitCommandError({
               ...gitCommandContext({
                 operation: "GitVcsDriver.statusDetailsRemote.branch",
      @@ -1316,6 +1319,9 @@
           }
       
           if (statusResult.exitCode !== 0) {
      +      if (statusResult.stderr.toLowerCase().includes("not a git repository")) {
      +        return NON_REPOSITORY_STATUS_DETAILS;
      +      }
             return yield* new GitCommandError({
               ...gitCommandContext({
                 operation: "GitVcsDriver.statusDetails.status",
      You can send follow-ups to the cloud agent here. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c4d0cd4999c76037e99cdebe5ad1493bbb89ed3d. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. juliusmarminge merged this4238a0e

    6. juliusmarminge closed this

Sign in to join this conversation.