@@ -26,6 +26,12 @@ export interface IAPISessionLogs {
2626 logs : string ;
2727}
2828
29+ export interface ICopilotRemoteAgentCommandArgs {
30+ userPrompt : string ;
31+ summary ?: string ;
32+ source ?: string ;
33+ }
34+
2935const LEARN_MORE = vscode . l10n . t ( 'Learn about Coding Agent' ) ;
3036// Without Pending Changes
3137const CONTINUE = vscode . l10n . t ( 'Continue' ) ;
@@ -192,11 +198,12 @@ export class CopilotRemoteAgentManager extends Disposable {
192198 return { owner, repo, remote, baseRef, repository } ;
193199 }
194200
195- async commandImpl ( args ?: any ) : Promise < string | undefined > {
196- // https://github.com/microsoft/vscode-copilot/issues/18918
197- const userPrompt : string | undefined = args . userPrompt ;
198- const summary : string | undefined = args . summary ;
201+ async commandImpl ( args ?: ICopilotRemoteAgentCommandArgs ) : Promise < string | undefined > {
202+ if ( ! args ) {
203+ return ;
204+ }
199205
206+ const { userPrompt, summary, source } = args ;
200207 if ( ! userPrompt || userPrompt . trim ( ) . length === 0 ) {
201208 return ;
202209 }
@@ -216,7 +223,7 @@ export class CopilotRemoteAgentManager extends Disposable {
216223
217224 let autoPushAndCommit = false ;
218225 const message = vscode . l10n . t ( 'GitHub Coding Agent will continue your work in \'{0}\'' , repoName ) ;
219- if ( hasChanges && this . autoCommitAndPushEnabled ( ) ) {
226+ if ( source !== 'prompt' && hasChanges && this . autoCommitAndPushEnabled ( ) ) {
220227 const modalResult = await vscode . window . showInformationMessage (
221228 message ,
222229 {
@@ -242,7 +249,7 @@ export class CopilotRemoteAgentManager extends Disposable {
242249 }
243250 } else {
244251 const modalResult = await vscode . window . showInformationMessage (
245- message ,
252+ ( source !== 'prompt' ? message : vscode . l10n . t ( 'GitHub Coding Agent will implement the specification outlined in this prompt file' ) ) ,
246253 {
247254 modal : true ,
248255 } ,
@@ -271,6 +278,17 @@ export class CopilotRemoteAgentManager extends Disposable {
271278 }
272279
273280 const { webviewUri, link, number } = result ;
281+
282+ if ( source === 'prompt' ) {
283+ const VIEW = vscode . l10n . t ( 'View' ) ;
284+ const finished = vscode . l10n . t ( 'Coding agent has begun work on your prompt in #{0}' , number ) ;
285+ vscode . window . showInformationMessage ( finished , VIEW ) . then ( ( value ) => {
286+ if ( value === VIEW ) {
287+ vscode . commands . executeCommand ( 'vscode.open' , webviewUri ) ;
288+ }
289+ } ) ;
290+ }
291+
274292 // allow-any-unicode-next-line
275293 return vscode . l10n . t ( '🚀 Coding agent will continue work in [#{0}]({1}). Track progress [here]({2}).' , number , link , webviewUri . toString ( ) ) ;
276294 }
0 commit comments