Skip to content

Commit 5a6ae80

Browse files
authored
Merge branch 'main' into alexr00/dying-snake
2 parents b6653fb + 0a966de commit 5a6ae80

4 files changed

Lines changed: 39 additions & 37 deletions

File tree

package.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,37 +3723,6 @@
37233723
}
37243724
],
37253725
"languageModelTools": [
3726-
{
3727-
"name": "github-pull-request_copilot-coding-agent",
3728-
"displayName": "%languageModelTools.github-pull-request_copilot-coding-agent.displayName%",
3729-
"modelDescription": "Completes the provided task using an asynchronous coding agent. Use when the user wants copilot continue completing a task in the background or asynchronously. IMPORTANT: Use this tool LAST/FINAL when users mention '#github-pull-request_copilot-coding-agent' in their query. This indicates they want the task/job implemented by the remote coding agent after all other analysis, planning, and preparation is complete. Call this tool at the END to hand off the fully-scoped task to the asynchronous GitHub Copilot coding agent. The agent will create a new branch, implement the changes, and open a pull request. Always use this tool as the final step when the hashtag is mentioned, after completing any other necessary tools or analysis first.",
3730-
"when": "config.githubPullRequests.codingAgent.enabled",
3731-
"icon": "$(send-to-remote-agent)",
3732-
"canBeReferencedInPrompt": true,
3733-
"toolReferenceName": "copilotCodingAgent",
3734-
"userDescription": "%languageModelTools.github-pull-request_copilot-coding-agent.userDescription%",
3735-
"inputSchema": {
3736-
"type": "object",
3737-
"required": [
3738-
"title",
3739-
"body"
3740-
],
3741-
"properties": {
3742-
"title": {
3743-
"type": "string",
3744-
"description": "The title of the issue. Populate from chat context."
3745-
},
3746-
"body": {
3747-
"type": "string",
3748-
"description": "The body/description of the issue. Populate from chat context."
3749-
},
3750-
"existingPullRequest": {
3751-
"type": "number",
3752-
"description": "The number of an existing pull request related to the current coding agent task. Look in the chat history for this number. In the chat it may look like 'Coding agent will continue work in #17...'. In this example, you should return '17'."
3753-
}
3754-
}
3755-
}
3756-
},
37573726
{
37583727
"name": "github-pull-request_issue_fetch",
37593728
"tags": [
@@ -4299,7 +4268,7 @@
42994268
],
43004269
"toolReferenceName": "openPullRequest",
43014270
"displayName": "%languageModelTools.github-pull-request_openPullRequest.displayName%",
4302-
"modelDescription": "Get comprehensive information about the GitHub pull request (PR) which is currently visible, but not necessarily checked out. This includes the PR title, full description, list of changed files, review comments, PR state, and status checks/CI results. For PRs created by Copilot, it also includes the session logs which indicate the development process and decisions made by the coding agent. When asked about the currently open pull request, do this first! Use this tool for any request related to \"pull request details,\" \"what changed,\" \"PR status,\" or similar queries even if the user does not explicitly mention \"pull request.\" When asked to use this tool, ALWAYS use it.",
4271+
"modelDescription": "Get comprehensive information about the GitHub pull request (PR) which is currently visible, but not necessarily checked out. This is the pull request that the user is currently viewing. This includes the PR title, full description, list of changed files, review comments, PR state, and status checks/CI results. For PRs created by Copilot, it also includes the session logs which indicate the development process and decisions made by the coding agent. When asked about the currently open pull request, do this first! Use this tool for any request related to \"pull request details,\" \"what changed,\" \"PR status,\" or similar queries even if the user does not explicitly mention \"pull request.\" When asked to use this tool, ALWAYS use it.",
43034272
"icon": "$(git-pull-request)",
43044273
"canBeReferencedInPrompt": true,
43054274
"userDescription": "%languageModelTools.github-pull-request_openPullRequest.description%",

package.nls.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,5 @@
425425
"languageModelTools.github-pull-request_activePullRequest.displayName": "Active Pull Request",
426426
"languageModelTools.github-pull-request_activePullRequest.description": "Get information about the active GitHub pull request. This information includes: comments, files changed, pull request title + description, pull request state, and pull request status checks/CI.",
427427
"languageModelTools.github-pull-request_openPullRequest.displayName": "Open Pull Request",
428-
"languageModelTools.github-pull-request_openPullRequest.description": "Get information about the open GitHub pull request. This information includes: comments, files changed, pull request title + description, pull request state, and pull request status checks/CI.",
429-
"languageModelTools.github-pull-request_copilot-coding-agent.displayName": "Copilot coding agent",
430-
"languageModelTools.github-pull-request_copilot-coding-agent.userDescription": "Completes the provided task using an asynchronous coding agent. Use when the user wants copilot continue completing a task in the background or asynchronously. Launch an autonomous GitHub Copilot agent to work on coding tasks in the background. The agent will create a new branch, implement the requested changes, and open a pull request with the completed work."
428+
"languageModelTools.github-pull-request_openPullRequest.description": "Get information about the open GitHub pull request. This information includes: comments, files changed, pull request title + description, pull request state, and pull request status checks/CI."
431429
}

src/github/createPRViewProvider.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,42 @@ Don't forget to commit your template file to the repository so that it can be us
13761376
const compareRepositoryName = message.args.compareRepo;
13771377
const compareBranchName = message.args.compareBranch;
13781378
const compareGithubRemoteName = `${compareOwner}/${compareRepositoryName}`;
1379-
const compareBranch = await this._folderRepositoryManager.repository.getBranch(compareBranchName);
1379+
let compareBranch = await this._folderRepositoryManager.repository.getBranch(compareBranchName);
1380+
1381+
// Fetch upstream to get accurate ahead/behind count
1382+
if (compareBranch.upstream) {
1383+
await this._folderRepositoryManager.repository.fetch(compareBranch.upstream.remote, compareBranch.upstream.name);
1384+
// Re-fetch branch info after fetch to get accurate ahead count
1385+
compareBranch = await this._folderRepositoryManager.repository.getBranch(compareBranchName);
1386+
}
1387+
1388+
// Check for unpushed commits when there's an upstream
1389+
if (compareBranch.upstream && compareBranch.ahead && compareBranch.ahead > 0) {
1390+
const pushCommits = vscode.l10n.t('Push Commits');
1391+
const continueWithoutPushing = vscode.l10n.t('Continue Without Pushing');
1392+
const commitCount = compareBranch.ahead;
1393+
const messageResult = await vscode.window.showInformationMessage(
1394+
vscode.l10n.t({
1395+
message: 'You have {0} unpushed commit(s) on \'{1}\'.\n\nDo you want to push them before creating the pull request?',
1396+
comment: ['{0} is the number of commits, {1} is the branch name'],
1397+
args: [commitCount, compareBranchName]
1398+
}),
1399+
{ modal: true },
1400+
pushCommits,
1401+
continueWithoutPushing
1402+
);
1403+
if (messageResult === pushCommits) {
1404+
progress.report({ message: vscode.l10n.t('Pushing commits'), increment: 10 });
1405+
totalIncrement += 10;
1406+
await this._folderRepositoryManager.repository.push(compareBranch.upstream.remote, compareBranchName);
1407+
} else if (messageResult !== continueWithoutPushing) {
1408+
// User cancelled (clicked X or pressed Escape)
1409+
progress.report({ message: vscode.l10n.t('Pull request cancelled'), increment: 100 - totalIncrement });
1410+
return;
1411+
}
1412+
// If continueWithoutPushing was selected, just continue with PR creation
1413+
}
1414+
13801415
let headRepo = compareBranch.upstream ? this._folderRepositoryManager.findRepo((githubRepo) => {
13811416
return (githubRepo.remote.owner === compareOwner) && (githubRepo.remote.repositoryName === compareRepositoryName);
13821417
}) : undefined;

webviews/common/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ body img.avatar {
350350
.label {
351351
display: flex;
352352
justify-content: normal;
353-
padding: 0 2px 0 8px;
353+
padding: 0 8px;
354354
border-radius: 20px;
355355
border-style: solid;
356356
border-width: 1px;

0 commit comments

Comments
 (0)