Skip to content

fix(server): overlapping status reads share one untracked listing - #34574

Open
yaacovcorcos wants to merge 1 commit into
pingdotgg:mainfrom
yaacovcorcos:fix/untracked-listing-followups
Open

yaacovcorcos wants to merge 1 commit into
pingdotgg:mainfrom
yaacovcorcos:fix/untracked-listing-followups

Conversation

@yaacovcorcos

Copy link
Copy Markdown
Contributor

Problem

Two follow-ups from CodeRabbit's review of #34460, which merged without them:

  1. Overlapping status reads for one worktree each run their own git ls-files --others. The
    backoff from fix(server): branch totals stop relisting untracked files after a failed listing #34460 only applies once a listing has failed, so reads that pass the check while a
    slow listing is still running (for example a status read restarted by a file change during a
    30 s listing timeout) each walk the whole untracked tree again, holding foreground Git slots.
  2. The branch-totals error keeps only the listing error's text. Its exit code, output length and
    underlying failure are dropped, against the rule that a wrapping error keeps the error it wraps
    as cause.

Change

  • The untracked listing goes through an Effect Cache keyed by worktree and pathspecs, with a
    timeToLive of zero. A read that arrives while the same listing is running waits for it instead
    of starting another; the result is never kept, so the next read lists again. The cache keeps a
    shared listing running until its last waiter leaves, so one interrupted read does not cancel the
    others. Each read still prepares its own temporary review index.
  • The listing's GitCommandError is kept as cause on the branch-totals error, for a fresh failure
    and for the remembered one. "Too many untracked files to count." has no cause.

Scope and approval

Follow-up to #34460 (issue #34457), answering its two open CodeRabbit comments. No setting,
contract or UI change. Submitted under the focused obvious-bug exception in CONTRIBUTING.md; no
maintainer approval is claimed.

Verification

  • New test share one listing between overlapping status reads (GitVcsDriverCore.test.ts): the
    spawner holds the first read's listing until the second read's last Git command before its
    listing (show-ref of the branch) has returned, then releases it. Both reads report the same
    totals.
    • On main: fails, 2 listings (3 of 3 runs).
    • With the change: passes, 1 listing (5 of 5 runs).
  • The cause is not visible through statusDetailsLocal, which turns a totals failure into missing
    totals; it shows in the readBranchChangeTotals span. No separate test.
  • vp test run src/vcs/GitVcsDriverCore.test.ts: all pass except
    keeps generated worktree folders short without changing long branch names, which also fails on
    unchanged main on this Mac (/private/var versus /var). Server typecheck; vp lint and
    vp fmt on apps/server/src. macOS only; not run on Linux or Windows.

Written with Claude Opus 5.5 in Claude Code; reviewed with gpt-6.1-sol in Codex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T21:55:32.467933Z 427726b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Nov 11, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Nov 11, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 427726b

Macroscope's review found this PR approvable — Overlapping status reads now share the same in-flight untracked-file listing, while later reads refresh normally. The change also preserves underlying error details without changing product defaults or persistent repository data.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Overlapping local status reads now share an in-flight untracked-file listing for the same working directory and path arguments. Listing failures retain their GitCommandError cause through retry state and the resulting error.

Changes: Untracked review totals

Layer / File(s) Summary
Share listings and preserve failure causes
apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts
A zero-TTL cache shares concurrent listings with identical working directories and path arguments. Listing failures retain their cause through retry state and the resulting error. A concurrency test checks that two reads return the same totals after only one listing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 25558: The change shares overlapping untracked listings, but does not address the reported timeout or repeated recomputation on each poll.
  • Issue 34457: The change shares overlapping failing listings and preserves the GitCommandError cause.

Possibly related PRs

  • pingdotgg/t3code#28374: Changes the path set passed to the same branch-totals listing path that this change caches.

Suggested reviewers: macroscopeapp, juliusmarminge

Merge Risk: Minimal · up to 42772

The change deduplicates overlapping untracked-file listings and keeps the underlying error cause on failures. No merge-blocking risk was found; the new concurrency test could occasionally be timing-sensitive.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: overlapping status reads now share one untracked-file listing. It follows conventional commit form and fits the changeset. It omits the error-cause change, which is a …
Description check Passed The description follows the template. It has Problem, Change, Scope and approval, and Verification sections. It gives a concrete problem statement with reproduction context (a status read restarted du…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: overlapping status reads now share one untracked-file listing. It follows conventional commit form and fits the changeset. It omits the error-cause change, which is a secondary part of the PR and does not need to be in the title.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope and approval, and Verification sections. It gives a concrete problem statement with reproduction context (a status read restarted during a 30 s listing timeout). It explains the change, cites the follow-up issue and the approval basis, and reports specific test results on macOS with the unrun platforms stated. The template's optional self-attribution line is included. Minor gap: the Problem section does not give a full reproduction in steps, but the scenario is clear enough for a reviewer.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 694076d and 427726b.

Files selected for processing: 2

  • apps/server/src/vcs/GitVcsDriverCore.test.ts
  • apps/server/src/vcs/GitVcsDriverCore.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant