From dd98403969f74abb477c44ef095ae29699ab05e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:18:22 +0000 Subject: [PATCH 1/5] Initial plan From c892583f7007ac5b3964ed02a3e5a19e9c448767 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:24:08 +0000 Subject: [PATCH 2/5] Initial analysis of create issue feature Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/@types/vscode.proposed.chatParticipantAdditions.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts index 71520fa1ec..aa7001a3d2 100644 --- a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts @@ -105,6 +105,7 @@ declare module 'vscode' { isComplete?: boolean; toolSpecificData?: ChatTerminalToolInvocationData; fromSubAgent?: boolean; + presentation?: 'hidden' | 'hiddenAfterComplete' | undefined; constructor(toolName: string, toolCallId: string, isError?: boolean); } From ac9f5047c6e02d08a62c33ce91533a299a3bccf8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:32:21 +0000 Subject: [PATCH 3/5] Add assignToMeOnCreate setting and implement auto-assignment for issues created from TODO/FIXME Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- package.json | 5 +++++ package.nls.json | 1 + src/common/settingKeys.ts | 1 + src/issues/issueFeatureRegistrar.ts | 25 +++++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/package.json b/package.json index 121adffe67..7099b67a8e 100644 --- a/package.json +++ b/package.json @@ -646,6 +646,11 @@ "default": "number", "description": "%githubIssues.createInsertFormat.description%" }, + "githubIssues.assignToMeOnCreate": { + "type": "boolean", + "default": false, + "description": "%githubIssues.assignToMeOnCreate.description%" + }, "githubIssues.issueCompletions.enabled": { "type": "boolean", "default": true, diff --git a/package.nls.json b/package.nls.json index 73c02b7684..15cdde4ac1 100644 --- a/package.nls.json +++ b/package.nls.json @@ -107,6 +107,7 @@ "githubIssues.createIssueTriggers.items": "String that enables the 'Create issue from comment' code action. Should not contain whitespace.", "githubPullRequests.codingAgent.codeLens.description": "Show the 'Delegate to agent' CodeLens actions above TODO comments for delegating to coding agent.", "githubIssues.createInsertFormat.description": "Controls whether an issue number (ex. #1234) or a full url (ex. https://github.com/owner/name/issues/1234) is inserted when the Create Issue code action is run.", + "githubIssues.assignToMeOnCreate.description": "When enabled, automatically assigns new issues created from TODO/FIXME comments to yourself.", "githubIssues.issueCompletions.enabled.description": "Controls whether completion suggestions are shown for issues.", "githubIssues.userCompletions.enabled.description": "Controls whether completion suggestions are shown for users.", "githubIssues.ignoreCompletionTrigger.description": "Languages that the '#' character should not be used to trigger issue completion suggestions.", diff --git a/src/common/settingKeys.ts b/src/common/settingKeys.ts index 1376c4c7bc..8178206b1a 100644 --- a/src/common/settingKeys.ts +++ b/src/common/settingKeys.ts @@ -47,6 +47,7 @@ export const USER_COMPLETIONS = 'userCompletions'; export const ENABLED = 'enabled'; export const IGNORE_USER_COMPLETION_TRIGGER = 'ignoreUserCompletionTrigger'; export const CREATE_INSERT_FORMAT = 'createInsertFormat'; +export const ASSIGN_TO_ME_ON_CREATE = 'assignToMeOnCreate'; export const ISSUE_BRANCH_TITLE = 'issueBranchTitle'; export const USE_BRANCH_FOR_ISSUES = 'useBranchForIssues'; export const WORKING_ISSUE_FORMAT_SCM = 'workingIssueFormatScm'; diff --git a/src/issues/issueFeatureRegistrar.ts b/src/issues/issueFeatureRegistrar.ts index a4f253a57d..d13cabd6cf 100644 --- a/src/issues/issueFeatureRegistrar.ts +++ b/src/issues/issueFeatureRegistrar.ts @@ -15,6 +15,7 @@ import { Disposable } from '../common/lifecycle'; import Logger from '../common/logger'; import { ALWAYS_PROMPT_FOR_NEW_ISSUE_REPO, + ASSIGN_TO_ME_ON_CREATE, CREATE_INSERT_FORMAT, ENABLED, ISSUE_COMPLETIONS, @@ -1000,6 +1001,30 @@ export class IssueFeatureRegistrar extends Disposable { if (matches && matches.length === 2 && (await this._stateManager.getUserMap(document.uri)).has(matches[1])) { assignees = [matches[1]]; } + + // Check if we should auto-assign to the current user + const assignToMe = vscode.workspace.getConfiguration(ISSUES_SETTINGS_NAMESPACE).get(ASSIGN_TO_ME_ON_CREATE, false); + if (assignToMe) { + // Get the folder manager to access the current user + const folderManager = this.manager.getManagerForFile(document.uri); + if (folderManager) { + try { + const currentUser = await folderManager.getCurrentUser(); + if (currentUser?.login) { + // Add current user to assignees if not already included + if (!assignees) { + assignees = [currentUser.login]; + } else if (!assignees.includes(currentUser.login)) { + assignees.push(currentUser.login); + } + } + } catch (error) { + // If we can't get the current user, just continue without auto-assignment + Logger.debug(`Failed to get current user for auto-assignment: ${error}`, IssueFeatureRegistrar.ID); + } + } + } + let title: string | undefined; const body: string | undefined = await this.createTodoIssueBody(newIssue, issueBody); From ac78fde4764d86d4319d0d647a7af013216c408e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:35:10 +0000 Subject: [PATCH 4/5] Remove unrelated change from type definitions file Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/@types/vscode.proposed.chatParticipantAdditions.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts index aa7001a3d2..71520fa1ec 100644 --- a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts @@ -105,7 +105,6 @@ declare module 'vscode' { isComplete?: boolean; toolSpecificData?: ChatTerminalToolInvocationData; fromSubAgent?: boolean; - presentation?: 'hidden' | 'hiddenAfterComplete' | undefined; constructor(toolName: string, toolCallId: string, isError?: boolean); } From 9496b2859e804774038cd074596c831fdae133f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:39:04 +0000 Subject: [PATCH 5/5] Address code review feedback: improve error logging and explicitly pass GitHub repository Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/issues/issueFeatureRegistrar.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/issues/issueFeatureRegistrar.ts b/src/issues/issueFeatureRegistrar.ts index d13cabd6cf..d283861468 100644 --- a/src/issues/issueFeatureRegistrar.ts +++ b/src/issues/issueFeatureRegistrar.ts @@ -1009,7 +1009,9 @@ export class IssueFeatureRegistrar extends Disposable { const folderManager = this.manager.getManagerForFile(document.uri); if (folderManager) { try { - const currentUser = await folderManager.getCurrentUser(); + // Get the GitHub repository for the document to ensure we get the correct user + const githubRepository = folderManager.gitHubRepositories[0]; + const currentUser = await folderManager.getCurrentUser(githubRepository); if (currentUser?.login) { // Add current user to assignees if not already included if (!assignees) { @@ -1020,7 +1022,7 @@ export class IssueFeatureRegistrar extends Disposable { } } catch (error) { // If we can't get the current user, just continue without auto-assignment - Logger.debug(`Failed to get current user for auto-assignment: ${error}`, IssueFeatureRegistrar.ID); + Logger.debug('Failed to get current user for auto-assignment', IssueFeatureRegistrar.ID, error); } } }