Implement follow-up detection for active coding agent PRs #7180
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.
Summary
This PR enhances the copilot remote agent functionality to automatically detect when the currently checked out PR is a coding agent PR and initiate follow-ups accordingly, improving the user experience by making follow-ups more context-aware.
Problem
Previously, follow-up mode was only initiated when an explicit follow-up parameter was provided in the chat stream. This meant users had to manually specify follow-up information even when they were already working on an active coding agent PR.
Solution
Enhanced the
commandImpl
method inCopilotRemoteAgentManager
to:CopilotStateModel
to determine PR status andFolderRepositoryManager.activePullRequest
to get the current PRImplementation Details
The logic considers a PR to be a coding agent PR if it has any status other than
CopilotPRStatus.None
(i.e., Started, Completed, or Failed).Benefits
Testing
The implementation was verified to:
Changes
src/github/copilotRemoteAgent.ts
to add active PR detection logicCopilotPRStatus
enumFixes the issue where follow-up mode wasn't automatically activated when working on active coding agent PRs.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.