Skip to content

feat: add commit and sync skill buttons to Changes View for agent-hos…#317951

Open
Nico0248 wants to merge 1 commit into
microsoft:mainfrom
Nico0248:devin/1779435179-commit-sync-buttons
Open

feat: add commit and sync skill buttons to Changes View for agent-hos…#317951
Nico0248 wants to merge 1 commit into
microsoft:mainfrom
Nico0248:devin/1779435179-commit-sync-buttons

Conversation

@Nico0248
Copy link
Copy Markdown

Fixes #317937

Description

Adds Commit and Sync skill buttons to the Changes View toolbar for agent-host sessions, complementing the existing Merge/Create PR/Update PR skill buttons in the dropdown submenu.

Changes

agentHostSkillButtons.ts

  • Added commit skill button registered on AgentsChangesToolbar:
    • Visible when worktree isolation mode with uncommitted changes
    • Sends /commit prompt to the agent
  • Added sync skill button registered on AgentsChangesToolbar:
    • Visible when upstream exists with incoming/outgoing changes
    • Sends /sync prompt to the agent
  • Added optional menuId field to IAgentHostSkillButtonSpec to support registering buttons on either the toolbar directly or the dropdown submenu
  • Exported AGENT_HOST_SKILL_BUTTON_COMMIT_ID and AGENT_HOST_SKILL_BUTTON_SYNC_ID constants

changesView.ts

  • Added button configuration for the commit button: shows loading spinner during git operations
  • Added button configuration for the sync button: shows outgoing changes count badge () and loading spinner

agentHostSkillButtons.test.ts

  • Added test for commit/sync toolbar registration
  • Updated skillButtonItems() helper to accept a menu ID parameter
  • Updated context key validation to cover all skill buttons (toolbar + submenu)
  • Added tests for exported commit and sync button IDs

How to Test

  1. Open a session in the Agent Window with an agent-host provider using worktree isolation
  2. Make changes that result in uncommitted files → Commit button should appear on the Changes View toolbar
  3. After committing, if there are outgoing changes → Sync button should appear with count badge (e.g., Sync 2↑)
  4. During git operations, both buttons should show loading spinners
  5. The existing Merge/PR dropdown should still work alongside the new toolbar buttons
  6. Unit tests: scripts/test.sh --grep "agentHostSkillButtons" → 13 tests passing

…t sessions (microsoft#317937)

Add Commit and Sync skill buttons to the Changes View toolbar for
agent-host sessions, complementing the existing Merge/PR dropdown.

- Commit button: visible when worktree has uncommitted changes,
  shows loading spinner during git operations
- Sync button: visible when upstream exists with incoming/outgoing
  changes, shows outgoing count badge and loading spinner
- Both buttons registered on AgentsChangesToolbar via new optional
  menuId field on IAgentHostSkillButtonSpec
- Unit tests cover toolbar registration, context key gating, and
  exported ID validation

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 22, 2026 07:35
@Nico0248
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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

Note

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

Adds first-class Agent Host “Commit” and “Sync” skill buttons to the Changes toolbar and updates the Changes view + tests to recognize and validate these new commands.

Changes:

  • Register new commit and sync skill buttons on MenuId.AgentsChangesToolbar (with worktree-related context conditions).
  • Export new command ID constants and update Changes view button rendering logic for these actions.
  • Expand menu registration tests to cover the toolbar and the new exported IDs.

Reviewed changes

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

File Description
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSkillButtons.test.ts Extends menu/command registration tests to validate Commit/Sync toolbar buttons and exported IDs.
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSkillButtons.ts Adds Commit/Sync skill specifications, optional per-skill menu targeting, and exports new command ID constants.
src/vs/sessions/contrib/changes/browser/changesView.ts Adds special label/icon handling for Commit/Sync actions in the Changes toolbar widget.

Comment on lines +214 to +223
if (action.id === AGENT_HOST_SKILL_BUTTON_COMMIT_ID) {
if (!hasGitOperationInProgress) {
return { showIcon: true, showLabel: true, isSecondary: false };
}
const customLabelObs = derived(reader => {
const running = runningLabelObs.read(reader);
return `$(loading) ${running ?? action.label}`;
});
return { showIcon: false, showLabel: true, isSecondary: false, customLabelObs };
}
Comment on lines +89 to +96
{
id: `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}commit`,
title: localize2('agentSessions.runSkill.commit', "Commit"),
skill: 'commit',
icon: Codicon.check,
group: 'navigation',
order: 0,
menuId: MenuId.AgentsChangesToolbar,
Comment on lines 184 to 189
* as the Copilot CLI extension's Sync PR button. Exported so the changes
* view can pick it out of the toolbar without re-deriving the ID.
*/
export const AGENT_HOST_SKILL_BUTTON_COMMIT_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}commit`;
export const AGENT_HOST_SKILL_BUTTON_SYNC_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}sync`;
export const AGENT_HOST_SKILL_BUTTON_UPDATE_PR_ID = `${AGENT_HOST_SKILL_BUTTON_ID_PREFIX}updatePR`;
skill: 'sync',
icon: Codicon.sync,
group: 'navigation',
order: 0,
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.

Support Merge Operations in Chagesets and Changes View of Agent Window

3 participants