66import { default as assert } from 'assert' ;
77import { SinonSandbox , createSandbox } from 'sinon' ;
88import * as vscode from 'vscode' ;
9- import { CopilotRemoteAgentManager } from '../../github/copilotRemoteAgent' ;
9+ import { CopilotRemoteAgentManager , SessionIdForPr } from '../../github/copilotRemoteAgent' ;
1010import { MockCommandRegistry } from '../mocks/mockCommandRegistry' ;
1111import { MockTelemetry } from '../mocks/mockTelemetry' ;
1212import { CredentialStore } from '../../github/credentials' ;
@@ -21,6 +21,7 @@ import { ReposManagerState } from '../../github/folderRepositoryManager';
2121import { GitApiImpl } from '../../api/api1' ;
2222import { MockPrsTreeModel } from '../mocks/mockPRsTreeModel' ;
2323import { PrsTreeModel } from '../../view/prsTreeModel' ;
24+ import { COPILOT_SWE_AGENT } from '../../common/copilot' ;
2425
2526const telemetry = new MockTelemetry ( ) ;
2627const protocol = new Protocol ( 'https://github.com/github/test.git' ) ;
@@ -271,7 +272,7 @@ describe('CopilotRemoteAgentManager', function () {
271272 it ( 'should return empty session when copilot API is not available' , async function ( ) {
272273 const token = new vscode . CancellationTokenSource ( ) . token ;
273274
274- const result = await manager . provideChatSessionContent ( ' 123' , token ) ;
275+ const result = await manager . provideChatSessionContent ( SessionIdForPr . getResource ( 123 , 0 ) , token ) ;
275276
276277 assert . strictEqual ( Array . isArray ( result . history ) , true ) ;
277278 assert . strictEqual ( result . history . length , 0 ) ;
@@ -282,7 +283,7 @@ describe('CopilotRemoteAgentManager', function () {
282283 const tokenSource = new vscode . CancellationTokenSource ( ) ;
283284 tokenSource . cancel ( ) ;
284285
285- const result = await manager . provideChatSessionContent ( ' 123' , tokenSource . token ) ;
286+ const result = await manager . provideChatSessionContent ( SessionIdForPr . getResource ( 123 , 0 ) , tokenSource . token ) ;
286287
287288 assert . strictEqual ( Array . isArray ( result . history ) , true ) ;
288289 assert . strictEqual ( result . history . length , 0 ) ;
@@ -291,7 +292,7 @@ describe('CopilotRemoteAgentManager', function () {
291292 it ( 'should return empty session for invalid PR number' , async function ( ) {
292293 const token = new vscode . CancellationTokenSource ( ) . token ;
293294
294- const result = await manager . provideChatSessionContent ( ' invalid', token ) ;
295+ const result = await manager . provideChatSessionContent ( vscode . Uri . from ( { scheme : COPILOT_SWE_AGENT , path : '/ invalid' } ) , token ) ;
295296
296297 assert . strictEqual ( Array . isArray ( result . history ) , true ) ;
297298 assert . strictEqual ( result . history . length , 0 ) ;
0 commit comments