Skip to content

Commit 1a7255f

Browse files
committed
Merge branch 'pawang/improveGitBranchNaming' of github.com:microsoft/vscode-pull-request-github into pawang/improveGitBranchNaming
2 parents 92aa1c2 + c8bc724 commit 1a7255f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ declare module 'vscode' {
194194

195195
export interface ChatContext {
196196
readonly chatSessionContext?: ChatSessionContext;
197+
readonly chatSummary?: {
198+
readonly prompt?: string;
199+
readonly history?: string;
200+
};
197201
}
198202

199203
export interface ChatSessionContext {

src/github/copilotRemoteAgent.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,31 @@ export namespace SessionIdForPr {
7272

7373
export class CopilotRemoteAgentManager extends Disposable {
7474
async chatParticipantImpl(request: vscode.ChatRequest, context: vscode.ChatContext, stream: vscode.ChatResponseStream, token: vscode.CancellationToken) {
75-
const startSession = async (prompt: string, history: ReadonlyArray<vscode.ChatRequestTurn | vscode.ChatResponseTurn>, source: string) => {
75+
const startSession = async (prompt: string, history: ReadonlyArray<vscode.ChatRequestTurn | vscode.ChatResponseTurn>, source: string, chatSummary?: { prompt?: string; history?: string }) => {
7676
/* __GDPR__
7777
"copilot.remoteagent.editor.invoke" : {
7878
"promptLength" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
7979
"historyLength" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
80+
"hasPromptSummary" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
81+
"hasHistorySummary" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
8082
"source" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
8183
}
8284
*/
85+
const promptSummary = chatSummary?.prompt;
86+
const historySummary = chatSummary?.history;
8387
this.telemetry.sendTelemetryEvent('copilot.remoteagent.editor.invoke', {
8488
promptLength: prompt.length.toString(),
8589
historyLength: history?.length.toString(),
90+
hasPromptSummary: String(!!promptSummary),
91+
hasHistorySummary: String(!!historySummary),
8692
source,
8793
});
8894
stream.progress(vscode.l10n.t('Delegating to coding agent'));
8995
const result = await this.invokeRemoteAgent(
90-
prompt,
96+
promptSummary || prompt,
9197
[
9298
this.extractFileReferences(request.references),
93-
await this.extractHistory(history)
99+
historySummary || await this.extractHistory(history)
94100
].join('\n\n').trim(),
95101
token,
96102
false,
@@ -171,7 +177,7 @@ export class CopilotRemoteAgentManager extends Disposable {
171177

172178
// TODO(jospicer): Use confirmations to guide users
173179

174-
const number = await startSession(request.prompt, context.history, 'chat'); // TODO(jospicer): 'All of the chat messages so far in the current chat session. Currently, only chat messages for the current participant are included'
180+
const number = await startSession(request.prompt, context.history, 'chat', context.chatSummary); // TODO(jospicer): 'All of the chat messages so far in the current chat session. Currently, only chat messages for the current participant are included'
175181
if (!number) {
176182
return {};
177183
}

0 commit comments

Comments
 (0)