Skip to content

fix: surface missing Git LFS git errors#319973

Merged
dmitrivMS merged 2 commits into
microsoft:mainfrom
KirtiRamchandani:fix/git-lfs-missing-error
Jun 5, 2026
Merged

fix: surface missing Git LFS git errors#319973
dmitrivMS merged 2 commits into
microsoft:mainfrom
KirtiRamchandani:fix/git-lfs-missing-error

Conversation

@KirtiRamchandani

Copy link
Copy Markdown
Contributor

Summary

Fixes #319824.

When git worktree add fails because Git LFS is missing, stderr can include a useful line followed by a generic fatal line:

  • git-lfs filter-process: git-lfs: command not found
  • fatal: the remote end hung up unexpectedly

The agent host Git error formatter summarized only the last stderr line, so users saw the generic fatal message instead of the actionable missing Git LFS cause.

This change keeps the existing last-line behavior for ordinary multi-line/progress stderr, but prefers a git-lfs missing-command line when present. It also adds a regression test for the issue shape.

Validation

  • node -e sanity check for the formatter behavior and existing progress-meter behavior
  • git diff --check

I did not run the full VS Code unit test harness in this sparse checkout.

Copilot AI review requested due to automatic review settings June 4, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Improves Git error reporting by preferring a more actionable git-lfs missing stderr line over a later generic fatal message.

Changes:

  • Update summarizeStderrForError to scan stderr for a “git-lfs missing” line and prefer it in the final error message.
  • Add a unit test ensuring the git-lfs missing message is preserved over a subsequent fatal: line.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/platform/agentHost/node/agentHostGitService.ts Adjusts stderr summarization to prioritize “git-lfs missing” errors over the last stderr line.
src/vs/platform/agentHost/test/node/agentHostGitService.test.ts Adds test coverage for the new stderr summarization behavior.

Comment thread src/vs/platform/agentHost/node/agentHostGitService.ts
Comment thread src/vs/platform/agentHost/test/node/agentHostGitService.test.ts
roblourens
roblourens previously approved these changes Jun 4, 2026
@roblourens roblourens enabled auto-merge (squash) June 4, 2026 22:12
dmitrivMS
dmitrivMS previously approved these changes Jun 4, 2026
@dmitrivMS

Copy link
Copy Markdown
Contributor

@KirtiRamchandani Could you please address the CI error:
] /mnt/vss/_work/vscode/vscode/src/vs/platform/agentHost/test/node/agentHostGitService.test.ts: line 302, col 5, Warning - Only use double-quoted strings for externalized strings. (local/code-no-unexternalized-strings)

auto-merge was automatically disabled June 5, 2026 04:50

Head branch was pushed to by a user without write access

@KirtiRamchandani KirtiRamchandani dismissed stale reviews from dmitrivMS and roblourens via 7c27bb5 June 5, 2026 04:50
@KirtiRamchandani

Copy link
Copy Markdown
Contributor Author

Thanks for catching that. Fixed the hygiene warning in 7c27bb5 by switching the test string to single quotes. Local check: git diff --check passes; waiting for CI to rerun on the updated branch.

@dmitrivMS dmitrivMS enabled auto-merge (squash) June 5, 2026 16:44
@dmitrivMS dmitrivMS merged commit cf16646 into microsoft:main Jun 5, 2026
28 of 47 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad error message when missing git lfs

5 participants