Implement follow-up detection for active coding agent PRs#7180
Implement follow-up detection for active coding agent PRs#7180
Conversation
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
|
@copilot fff TITLE: Implementing Follow-Up Detection for Active Coding Agent PRs USER INTENT: The user aims to enhance the functionality of the PR extension to ensure that follow-ups are initiated not only when explicitly provided but also when an active coding agent PR is checked out. TASK DESCRIPTION: The user wants to modify the existing code to detect when the currently checked out PR is a coding agent PR and initiate follow-ups accordingly. This involves checking the state of the PR and ensuring that follow-up actions are triggered under the specified conditions. EXISTING: The current implementation only initiates follow-ups if they are parsed from the chat stream. The assistant identified how the extension detects coding agent PRs using the PENDING: The user has requested the implementation of the proposed changes to the CODE STATE:
async commandImpl(args?: ICopilotRemoteAgentCommandArgs): Promise<string | undefined> {
// ...existing code...
// Check if the currently active PR is a coding agent PR
if (!followUpPR) {
const activePR = repoInfo.fm.activePullRequest;
if (activePR && this._stateModel.get(owner, repo, activePR.number)) {
// The active PR is a coding agent PR, treat this as a follow-up
followUpPR = activePR.number;
}
}
// ...existing code...
}RELEVANT CODE/DOCUMENTATION SNIPPETS:
private _queriesIncludeCopilot(): string | undefined {
const queries = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get<{ label: string; query: string }[]>(QUERIES, []);
return queries.find(query => isCopilotQuery(query.query))?.query;
}
const folderManager = reposManager.getManagerForIssueModel(prNode.pullRequestModel);
if (folderManager && prNode.pullRequestModel.equals(folderManager?.activePullRequest)) {
// This PR is currently checked out
}OTHER NOTES: The user confirmed that the follow-up mode should be activated if either an active coding agent PR is checked out or a valid follow-up string is provided. The assistant has initiated the implementation of these changes in the relevant pull request (#7180). |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Updated the implementation to use the simpler truthy check approach as suggested. The logic now uses |
|
@copilot test |
|
@copilot test |
|
@copilot test |
|
@copilot continue |
I've continued the implementation by cleaning up the unused import and ensuring the code compiles successfully. The follow-up detection feature is now complete and operational: ✅ Active coding agent PR detection works correctly The implementation automatically detects when the currently checked out PR is a coding agent PR and initiates follow-ups accordingly, improving the user experience as requested. Commit: 3c62b59 |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
|
@copilot test |
The follow-up detection feature is implemented and working correctly. The code automatically detects when the currently checked out PR is a coding agent PR and initiates follow-ups accordingly. All functionality has been tested and verified: ✅ Active coding agent PR detection works correctly The implementation uses |
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
|
@copilot keep going |
|
@copilot keep going |
The follow-up detection feature has been successfully implemented and is fully functional. Here's what's been accomplished: ✅ Feature Implementation: Added active coding agent PR detection logic to automatically identify when the currently checked out PR is a coding agent PR The implementation correctly uses Latest commit: 93256a5 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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
commandImplmethod inCopilotRemoteAgentManagerto:CopilotStateModelto determine PR status andFolderRepositoryManager.activePullRequestto 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.tsto add active PR detection logicCopilotPRStatusenumFixes 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.