Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): idle status polls and PR sweeps start fewer git processes #16272

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/16272/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

When T3 Code is idle, it keeps starting git processes. On Windows this makes the whole desktop lag (#12498). Some of those processes ask questions that the server answered a few seconds before.

I measured one repo that has a branch and a cached PR:

callgit processes beforeafter
status poll, VCS detection (each 30 s tick)30 on a cache hit
branchPullRequest, PR cache hit (each thread, 2 sweeps per minute)54
branchPullRequest, PR cache miss86

VCS detection. The cache lasted 2 seconds, so each status poll ran rev-parse three times. Now a hit lasts 5 minutes and is checked with stats only, so these cases are still found on the next call:

  • a removed worktree folder or .git folder
  • a git init in a project folder that was inside a parent repo (for example a dotfiles repo at ~)

PR lookup. When a branch tracks origin, the lookup read remote.origin.url twice for the "head" and "target" remotes. It now reads it once.

This is a smaller alternative to #12602. That PR answers git questions by reading .git files itself. Here, git still gives every answer.

🤖 Generated with Claude Code using Claude Opus 5.5.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

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

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The runtime changes are localized VCS/PR lookup performance optimizations with targeted tests. Human review is required because the PR adds a line-level preferSchemaOverJson:off static-analysis suppression directive.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: fc4ecc8 · PR result: 9937e24 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign in to join this conversation.