Skip to content

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

Open
mokbhai wants to merge 1 commit intopingdotgg:mainfrom
mokbhai:fix/checkpoint-home-directory-timeout
Open

🐛 fix: prevent checkpoint timeout when running from home directory#1228
mokbhai wants to merge 1 commit intopingdotgg:mainfrom
mokbhai:fix/checkpoint-home-directory-timeout

Conversation

@mokbhai
Copy link

@mokbhai mokbhai commented Mar 20, 2026

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)

Related Issue

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.

When T3 is run from home directory, git add -A -- . times out
because home directory contains thousands of files. This fix:
- Detects home directory using homedir() from node:os
- Skips checkpointing with warning log when cwd is home
- Returns false for isGitRepository on home directories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 git add timeout when running T3 from home directory

1 participant