Skip to content

Agents - refresh repository state after git operation (ex: commit, sync)#317317

Merged
lszomoru merged 1 commit into
mainfrom
lszomoru/compatible-rattlesnake
May 19, 2026
Merged

Agents - refresh repository state after git operation (ex: commit, sync)#317317
lszomoru merged 1 commit into
mainfrom
lszomoru/compatible-rattlesnake

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 19, 2026 15:17
@lszomoru lszomoru enabled auto-merge (squash) May 19, 2026 15:18
@lszomoru lszomoru self-assigned this May 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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), call repository.status() to refresh the Git extension repository state.
  • After sync (pull + push), call repository.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

@lszomoru lszomoru merged commit c83b3c1 into main May 19, 2026
29 checks passed
@lszomoru lszomoru deleted the lszomoru/compatible-rattlesnake branch May 19, 2026 15:48
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 19, 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.

3 participants