You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subscribing to a thread whose worktree was removed records failed Git spawn spans #39291
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Run a server that exports traces over OTLP.
Open a thread that has its own worktree, so the client subscribes to its branch or status.
Delete the worktree directory, then reload or reconnect the client so it subscribes again.
Open the trace for that subscribeVcsBranch or subscribeVcsStatus call.
Expected behavior
Subscribing to a thread whose worktree is gone records no error spans. The server already treats it as "not a repository".
Actual behavior
Every subscription records three failed spans: GitWorkflowService.headPath, runGitCommand and NonBlockingSpawner.spawn. They read Failed to spawn Git process / NotFound: FileSystem.access (<worktree path>).
Each subscription starts the HEAD watch, which calls GitWorkflowService.headPath(cwd) (VcsStatusBroadcaster.watchHead). headPath runs git rev-parse --git-path HEAD through GitVcsDriverCore.execute, which spawns Git with the missing directory as its working directory. The spawner's FileSystem.access(cwd) check fails before Git starts. headPath turns that into null, so the watch ends as intended, but the traced spans have already ended as errors.
Repository detection in the same trace has no error: GitVcsDriver.probeWorkTree runs git -C <cwd> from the server's own directory and checks that the cwd exists.
Activity