Agents - refresh repository state after git operation (ex: commit, sync)#317317
Merged
Conversation
dbaeumer
approved these changes
May 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures Copilot CLI “Agent sessions” repository metadata is refreshed after git operations (commit and sync), so UI/state derived from the Git extension repository state reflects the latest HEAD/changes/incoming/outgoing information.
Changes:
- After
commit(and optional pull/push), callrepository.status()to refresh the Git extension repository state. - After
sync(pull + push), callrepository.status()to refresh the Git extension repository state. - Apply the same behavior to both the current and V1 (“Contribution”) command implementations.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Adds a post-operation repository.status() refresh to commit/sync commands in the V1 implementation. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts | Adds a post-operation repository.status() refresh to commit/sync commands in the current implementation. |
Copilot's findings
Comments suppressed due to low confidence (2)
extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts:1684
- This
repository.status()refresh can throw; if it fails after pull/push, the sync command will fail even though the network operations may have succeeded. Handle it as best-effort (try/catch + optional logging) to avoid surfacing a refresh failure as a command failure.
// Refresh repository state
await repository.status();
extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:2737
- This
repository.status()refresh can throw; if it fails after pull/push, the sync command can fail even though pull/push succeeded. Consider making this best-effort (try/catch + optional logging) so repository refresh issues don’t break the command.
// Refresh repository state
await repository.status();
- Files reviewed: 2/2 changed files
- Comments generated: 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.