Skip to content
Source
Sign inSign up
pingdotgg/t3code

🐛 fix: prevent checkpoint timeout when running from home directory #1228

Closedmokbhai(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/1228/headopened View on GitHub

Summary

  • Prevents git timeout when T3 is run from home directory
  • Detects home directory using homedir() from node:os
  • Skips checkpointing with warning log instead of letting 30-second timeout occur
  • Returns false for isGitRepository on home directories

Changes

This PR adds early detection of home directories to prevent the git add -A -- . command from timing out. Home directories typically contain thousands of files (Applications, .npm, .cache, etc.) which makes staging extremely slow.

The checkpoint system is designed for project-level work where git repositories have a manageable number of tracked files—not for entire home directories.

Files Modified

  • apps/server/src/checkpointing/Layers/CheckpointStore.ts:
    • Added isHomeDirectory() helper function
    • Updated isGitRepository() to return false for home directories
    • Updated captureCheckpoint() to skip with warning for home directories

Test Plan

  • TypeScript compilation passes (npx tsc --noEmit)
  • Manual testing: Run T3 from home directory and verify warning appears instead of timeout
  • Manual testing: Run T3 from a project directory and verify checkpointing still works

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (added inline comments explaining the fix)
  • No new warnings generated (typecheck passes)
  • Tests added/updated (no existing tests for this specific scenario)

Resolves #1227

Notes

This is a small, focused bug fix that aligns with the contribution guidelines:

  • Small reliability fix (prevents timeout crashes)
  • Minimal code change (32 lines added, 11 removed)
  • Clear explanation of what and why
  • No scope expansion or feature creep

If running from home directory, users should navigate to a project directory first (e.g., cd ~/my-project && npx t3).

Note

Fix checkpoint timeout when running from the home directory

Running the app from the home directory could trigger a checkpoint timeout because git operations on ~ are slow or hang. isGitRepository now short-circuits to false and captureCheckpoint exits early with a warning log when cwd matches os.homedir(), skipping all git index and commit logic.

Macroscope summarized 54c00d9.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. 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: b8a04df5-1201-44b3-ae15-e0fce610f241

      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
      📝 Coding Plan
      • Generate coding plan for human review comments

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.

      Tip

      You can disable the changed files summary in the walkthrough.

      Disable the reviews.changed_files_summary setting to disable the changed files summary in the walkthrough.

    3. #1214 better fix

    4. juliusmarminge closed this

Sign in to join this conversation.