fix(server): detect repositories after initialization - #4848
Conversation
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved f609a4d This is a focused bug fix that changes cache TTL behavior for negative repository lookups. The 3-line change prevents caching of "no repository found" results, enabling detection of repositories created after initial lookup. Well-tested with a clear unit test covering the exact scenario. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848 * perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843 * fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854 * Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979 * fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853 ## New Contributors * @ohbentos made their first contribution in pingdotgg/t3code#4854 * @Sy-D made their first contribution in pingdotgg/t3code#4853 **Full Changelog**: pingdotgg/t3code@v0.0.31-nightly.20260729.946...v0.0.31-nightly.20260729.948 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31-nightly.20260729.948
## What's Changed * Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806 * fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809 * Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828 * build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824 * Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832 * Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830 * Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679 * fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848 * perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843 * fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854 * Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979 * fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853 ## New Contributors * @wukko made their first contribution in pingdotgg/t3code#4824 * @ohbentos made their first contribution in pingdotgg/t3code#4854 * @Sy-D made their first contribution in pingdotgg/t3code#4853 **Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31 ## What's Changed * Fix Connect sign-in settings label by @juliusmarminge in pingdotgg/t3code#4806 * fix(desktop): restore T3 Connect sign-in by @PixPMusic in pingdotgg/t3code#4809 * Simplify files panel header by @juliusmarminge in pingdotgg/t3code#4828 * build(desktop): reduce installed app size by ~300MB by @wukko in pingdotgg/t3code#4824 * Update model version from claude-opus-4-8 to claude-opus-5 by @juliusmarminge in pingdotgg/t3code#4832 * Preserve the thread shell while detail loads by @juliusmarminge in pingdotgg/t3code#4830 * Reduce idle work and disk churn with native resource diagnostics by @juliusmarminge in pingdotgg/t3code#2679 * fix(server): detect repositories after initialization by @StiensWout in pingdotgg/t3code#4848 * perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat by @UtkarshUsername in pingdotgg/t3code#4843 * fix(git): disable external diff for review diff previews by @ohbentos in pingdotgg/t3code#4854 * Fix editable file focus and live syntax highlighting by @jakeleventhal in pingdotgg/t3code#3979 * fix(web): remember the rendered-markdown choice across threads by @Sy-D in pingdotgg/t3code#4853 ## New Contributors * @wukko made their first contribution in pingdotgg/t3code#4824 * @ohbentos made their first contribution in pingdotgg/t3code#4854 * @Sy-D made their first contribution in pingdotgg/t3code#4853 **Full Changelog**: pingdotgg/t3code@v0.0.30...v0.0.31 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.31
Problem
Initializing Git from a fresh thread creates the repository, but the immediate status refresh can reuse a cached negative repository detection. The UI then continues to show "Initialize Git" until another event, such as the first agent turn completing, refreshes Git status.
Fix
Cache successful repository detections for the existing two-second TTL, but do not retain negative detections. This lets the status refresh following
git initdiscover the repository immediately while preserving the positive detection cache.A focused registry test covers a path transitioning from non-repository to repository between consecutive detections.
Validation
vp test run apps/server/src/vcs/VcsDriverRegistry.test.ts apps/server/src/vcs/VcsProvisioningService.test.ts apps/server/src/vcs/VcsStatusBroadcaster.test.tsvp run --filter t3 typecheck.gitexisted within 100 ms, while the UI remained stale for 10+ seconds and updated only when the first agent turn completed.Generated with GPT-5.6-Sol in T3 Code using the Codex harness.
Note
Low Risk
Small, targeted cache TTL change in VCS detection with a regression test; no auth or data-path changes.
Overview
Fixes stale Initialize Git UI after
git initby changing how VCS repository detection is cached inVcsDriverRegistry.Successful detections still use the existing 2s TTL, but negative results (
null, no repo) are no longer cached—they get zero TTL so the next status refresh re-runs detection. Failures also skip retention. A new test asserts that a seconddetectcall sees a repo after the first call returned non-repo.Reviewed by Cursor Bugbot for commit f609a4d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix repository detection cache to not cache null results in
VcsDriverRegistryPreviously, a null result from repository detection (e.g. "not a git repository") was cached with the full TTL, preventing a subsequent positive detection. Now, only non-null detection results are cached; null results and failures expire immediately (TTL of zero). A new test in VcsDriverRegistry.test.ts verifies that a negative lookup followed by a positive one returns the correct repository on the second attempt.
Macroscope summarized f609a4d.