Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions packages/runtime/src/repo-watch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,15 @@ async function scanProject(
const hints = matchedHints.length > 0 || worktree.path !== root.topLevel
? matchedHints
: root.hints;
worktrees.push(await scanWorktree(worktree, hints, git, now, options));
const scanned = await scanWorktree(worktree, hints, git, now, options);
// Drop worktrees we can't actually read β€” stale `git worktree list`
// registrations whose dir was deleted (ephemeral /tmp or cache builds), or
// otherwise unreadable. They surface as "SCAN ERR" noise with no signal.
if (scanned.error != null) {
warnings.push(`Repo Watch skipped unreadable worktree ${worktree.path}.`);
continue;
}
worktrees.push(scanned);
}
const stats = statsForProject(worktrees);
const attention = maxAttention(worktrees.map((worktree) => worktree.attention));
Expand Down Expand Up @@ -986,7 +994,11 @@ export async function getRepoWatchSnapshot(options: RepoWatchSnapshotOptions = {
includeLastCommit: options.includeLastCommit ?? false,
deadlineMs,
});
projects.push(result.project);
// A project whose only worktrees were unreadable (all skipped) is itself
// stale β€” don't surface an empty shell.
if (result.project.worktrees.length > 0) {
projects.push(result.project);
}
warnings.push(...result.warnings);
}
projects.sort((left, right) => {
Expand Down