Skip to content

agentHost: add draft PR Agent Merge operation - #333964

Open
Benjamin Christopher Simmonds (benibenj) wants to merge 8 commits into
mainfrom
sessions/draft-pr-agent-merge
Open

agentHost: add draft PR Agent Merge operation#333964
Benjamin Christopher Simmonds (benibenj) wants to merge 8 commits into
mainfrom
sessions/draft-pr-agent-merge

Conversation

@benibenj

@benibenj Benjamin Christopher Simmonds (benibenj) commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Create Draft PR & Agent Merge changeset operation alongside the existing ready PR variant
  • create the pull request as a draft while enabling Agent Merge and preserving session overrides
  • seed the initial Agent Merge target from exact branch-matched session GitHub metadata so an existing PR is reported as already monitored
  • evaluate draft readiness in the Agent Host from required checks and actionable review feedback
  • advertise a secondary pr-mark-ready-with-agent-merge operation, also labeled Mark Ready, while Agent Merge owns the running primary button
  • replace it with the normal primary Mark Ready operation once checks and review feedback are clear
  • post a dedicated, linked Agent Merge merged pull request system notification after a successful native merge; it is persisted for the user but never sent to the agent
  • remove response footer actions from Agent Merge system-notification rows and show their completion timestamp at the row's right edge, aligned to the final visible text baseline, on hover or keyboard focus
  • add full-chat component fixtures covering a normal turn, Agent Merge enablement, a real Agent Merge repair turn and response, and merge completion at rest and hovered
  • verify Agent Merge repairs draft PR CI failures and review feedback without automatically merging drafts
  • shorten both combined creation labels to omit "Enable"
  • use enabled and disabled consistently in Agent Merge transcript notices instead of on/off terminology

Testing

  • npm run transpile-client
  • npm run typecheck-client
  • npm run eslint -- <changed TypeScript files>
  • npm run stylelint -- src\vs\workbench\contrib\chat\browser\widget\media\chat.css src\vs\workbench\contrib\chat\browser\widget\chatContentParts\media\chatSystemNotificationContentPart.css
  • scripts\test.bat src\vs\platform\agentHost\test\common\agentMerge.test.ts src\vs\platform\agentHost\test\node\agentHostPullRequestOperationHandler.test.ts src\vs\platform\agentHost\test\node\agentHostPullRequestOperationProvider.test.ts (42 passing)
  • scripts\test.bat src\vs\platform\agentHost\test\common\agentMerge.test.ts src\vs\platform\agentHost\test\node\agentHostPullRequestStatusService.test.ts src\vs\platform\agentHost\test\node\agentHostPullRequestOperationProvider.test.ts src\vs\platform\agentHost\test\node\agentHostPullRequestLifecycleOperationHandler.test.ts src\vs\sessions\contrib\providers\agentHost\test\browser\agentMergeActions.test.ts (50 passing)
  • scripts\test.bat src\vs\platform\agentHost\test\node\agentMergeController.test.ts (16 passing)
  • scripts\test.bat src\vs\platform\agentHost\test\common\agentMerge.test.ts src\vs\platform\agentHost\test\node\agentMergeController.test.ts src\vs\workbench\contrib\chat\test\browser\agentSessions\stateToProgressAdapter.test.ts (182 passing)
  • scripts\test.bat src\vs\workbench\contrib\chat\test\browser\agentSessions\stateToProgressAdapter.test.ts src\vs\workbench\contrib\chat\test\browser\widget\chatContentParts\chatSystemNotificationContentPart.test.ts src\vs\workbench\contrib\chat\test\browser\widget\chatListRenderer.test.ts (194 passing, 1 pending)
  • Component Explorer: verified both full-flow fixtures at rest and hovered in dark and light themes

Add a combined operation that creates a draft pull request and enables Agent Merge while keeping draft PRs ineligible for automatic merging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 2, 2026 10:08

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.

Copilot review overview

🟢 Approval recommended

The implementation is consistent with existing flows and has focused coverage for the new draft behavior.

Review tier: Balanced
Findings: None

What changed in this PR

Adds a draft PR creation option that enables Agent Merge while preventing automatic draft merging.

Changes:

  • Registers and advertises the new draft Agent Merge operation.
  • Preserves Agent Merge configuration and reports draft creation accurately.
  • Tests draft repair behavior, creation, labels, and operation ordering.
File Description
src/​vs/​platform/​agentHost/​node/​agentHostPullRequestOperationHandler.ts Defines and reports the draft Agent Merge operation.
src/​vs/​platform/​agentHost/​node/​agentHostPullRequestOperationProvider.ts Registers and exposes the new operation.
src/​vs/​platform/​agentHost/​test/​common/​agentMerge.test.ts Verifies drafts are repaired but not merged.
src/​vs/​platform/​agentHost/​test/​node/​agentHostPullRequestOperationHandler.test.ts Tests draft creation and Agent Merge enablement.
src/​vs/​platform/​agentHost/​test/​node/​agentHostPullRequestOperationProvider.test.ts Tests labels and advertised operation order.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Keep the running Agent Merge action primary while draft pull request CI or review comments remain unsettled, then restore Mark Ready once both are clear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Advertise a separate Mark Ready operation while Agent Merge owns the primary button, and switch to the normal Mark Ready operation only after required checks and actionable review feedback are clear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use branch-matched session GitHub metadata when Agent Merge first captures its target so the enablement notice immediately reflects an existing pull request without delaying the feedback watermark.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Post a host-owned, user-only system notification with the pull request link after Agent Merge successfully merges it, using a dedicated Agent Merge completion kind and icon.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 3a01d742 Current: d1005f88

Changed (12)

chat/chatAgentMergeNotice/Enabled/Dark
Before After
before after
chat/chatAgentMergeNotice/Enabled/Light
Before After
before after
chat/chatAgentMergeNotice/EnabledExpanded/Dark
Before After
before after
chat/chatAgentMergeNotice/EnabledExpanded/Light
Before After
before after
chat/chatAgentMergeNotice/DisabledByUser/Dark
Before After
before after
chat/chatAgentMergeNotice/DisabledByUser/Light
Before After
before after
chat/chatAgentMergeNotice/DisabledByBranchChange/Dark
Before After
before after
chat/chatAgentMergeNotice/DisabledByBranchChange/Light
Before After
before after
chat/chatAgentMergeNotice/DisabledByRepairBudget/Dark
Before After
before after
chat/chatAgentMergeNotice/DisabledByRepairBudget/Light
Before After
before after
chat/chatAgentMergeNotice/DisabledByIndeterminateState/Dark
Before After
before after
chat/chatAgentMergeNotice/DisabledByIndeterminateState/Light
Before After
before after

2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Added (6)

chat/chatAgentMergeFlow/FullConversation/Dark

current

chat/chatAgentMergeFlow/FullConversation/Light

current

chat/chatAgentMergeFlow/FullConversationMergedNoticeHovered/Dark

current

chat/chatAgentMergeFlow/FullConversationMergedNoticeHovered/Light

current

chat/chatAgentMergeNotice/PullRequestMerged/Dark

current

chat/chatAgentMergeNotice/PullRequestMerged/Light

current

Removed (2)

chat/chatAgentMergeNotice/DisabledByMerge/Dark

baseline

chat/chatAgentMergeNotice/DisabledByMerge/Light

baseline

Hide response footer actions for Agent Merge system notifications and render their completion time inline on hover or keyboard focus. Add full-chat fixtures for the enablement, repair, response, and merged-notice flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align inline Agent Merge timestamps to the notification's last text baseline and place them at the chat row's right edge, matching response footer timing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace on, off, and turned-off terminology in Agent Merge transcript notices with enabled and disabled wording, including automatic merge demotion guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benibenj
Benjamin Christopher Simmonds (benibenj) marked this pull request as ready for review September 2, 2026 14:52
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