fix: surface missing Git LFS git errors#319973
Conversation
There was a problem hiding this comment.
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
summarizeStderrForErrorto 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. |
|
@KirtiRamchandani Could you please address the CI error: |
Head branch was pushed to by a user without write access
7c27bb5
|
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. |
Summary
Fixes #319824.
When
git worktree addfails 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 foundfatal: the remote end hung up unexpectedlyThe 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-lfsmissing-command line when present. It also adds a regression test for the issue shape.Validation
node -esanity check for the formatter behavior and existing progress-meter behaviorgit diff --checkI did not run the full VS Code unit test harness in this sparse checkout.