Skip to content

Commit c4afa24

Browse files
authored
remove /codingAgent participant command (#7073)
1 parent c8c44a3 commit c4afa24

File tree

4 files changed

+20
-55
lines changed

4 files changed

+20
-55
lines changed

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@
6969
"name": "githubpr",
7070
"fullName": "GitHub Pull Requests",
7171
"description": "Chat participant for GitHub Pull Requests extension",
72-
"when": "config.githubPullRequests.experimental.chat",
73-
"commands": [
74-
{
75-
"name": "codingAgent",
76-
"description": "Provide a task for the Copilot Coding Agent to complete asynchronously",
77-
"when": "config.githubPullRequests.codingAgent.enabled"
78-
}
79-
]
72+
"when": "config.githubPullRequests.experimental.chat"
8073
}
8174
],
8275
"configuration": {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,20 @@ declare module 'vscode' {
334334
copiedCharacters: number;
335335
totalCharacters: number;
336336
copiedText: string;
337+
totalLines: number;
338+
copiedLines: number;
339+
modelId: string;
340+
languageId?: string;
337341
}
338342

339343
export interface ChatInsertAction {
340344
// eslint-disable-next-line local/vscode-dts-string-type-literals
341345
kind: 'insert';
342346
codeBlockIndex: number;
343347
totalCharacters: number;
348+
totalLines: number;
349+
languageId?: string;
350+
modelId: string;
344351
newFile?: boolean;
345352
}
346353

@@ -349,6 +356,9 @@ declare module 'vscode' {
349356
kind: 'apply';
350357
codeBlockIndex: number;
351358
totalCharacters: number;
359+
totalLines: number;
360+
languageId?: string;
361+
modelId: string;
352362
newFile?: boolean;
353363
codeMapper?: string;
354364
}

src/lm/participants.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { renderPrompt } from '@vscode/prompt-tsx';
88
import * as vscode from 'vscode';
99
import { Disposable } from '../common/lifecycle';
10-
import { CodingAgentPrompt, ParticipantsPrompt } from './participantsPrompt';
10+
import { ParticipantsPrompt } from './participantsPrompt';
1111
import { IToolCall, TOOL_COMMAND_RESULT, TOOL_MARKDOWN_RESULT } from './tools/toolsUtils';
1212

1313
export class ChatParticipantState {
@@ -76,26 +76,22 @@ export class ChatParticipant extends Disposable {
7676
): Promise<void> {
7777
this.state.reset();
7878

79-
const useCodingAgent = request.command && request.command === 'codingAgent';
8079
const models = await vscode.lm.selectChatModels({
8180
vendor: 'copilot',
8281
family: 'gpt-4o'
8382
});
8483
const model = models[0];
8584

86-
const allTools = (useCodingAgent
87-
? vscode.lm.tools
88-
.filter(tool => tool.name === 'github-pull-request_copilot-coding-agent')
89-
: vscode.lm.tools).map((tool): vscode.LanguageModelChatTool => {
90-
return {
91-
name: tool.name,
92-
description: tool.description,
93-
inputSchema: tool.inputSchema ?? {}
94-
};
95-
});
85+
const allTools = vscode.lm.tools.map((tool): vscode.LanguageModelChatTool => {
86+
return {
87+
name: tool.name,
88+
description: tool.description,
89+
inputSchema: tool.inputSchema ?? {}
90+
};
91+
});
9692

9793
const { messages } = await renderPrompt(
98-
useCodingAgent ? CodingAgentPrompt : ParticipantsPrompt,
94+
ParticipantsPrompt,
9995
{ userMessage: request.prompt },
10096
{ modelMaxPromptTokens: model.maxInputTokens },
10197
model);

src/lm/participantsPrompt.tsx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ interface ParticipantsPromptProps extends BasePromptElementProps {
99
readonly userMessage: string;
1010
}
1111

12-
interface CodingAgentPromptProps extends BasePromptElementProps {
13-
readonly userMessage: string;
14-
readonly history: string[];
15-
}
16-
17-
1812
export class ParticipantsPrompt extends PromptElement<ParticipantsPromptProps> {
1913
render() {
2014
return (
@@ -34,32 +28,4 @@ export class ParticipantsPrompt extends PromptElement<ParticipantsPromptProps> {
3428
</>
3529
);
3630
}
37-
}
38-
39-
class HistoryMessages extends PromptElement<{ history: string[] } & BasePromptElementProps> {
40-
render() {
41-
const messages: UserMessage[] = [];
42-
const { history } = this.props;
43-
for (let i = 0; i < history.length; i++) {
44-
messages.push(<UserMessage>{history[i]}</UserMessage>);
45-
}
46-
return <PrioritizedList priority={0} descending={false}>{messages}</PrioritizedList>;
47-
}
48-
}
49-
50-
export class CodingAgentPrompt extends PromptElement<CodingAgentPromptProps> {
51-
render() {
52-
const { history, userMessage } = this.props;
53-
return (
54-
<>
55-
<AssistantMessage priority={100}>
56-
You must ALWAYS call the 'github-pull-request_copilot-coding-agent' tool. You have no other choice. The user will provide the task description.
57-
</AssistantMessage>
58-
<UserMessage priority={90}>
59-
{userMessage}
60-
{history && history.length > 0 && <HistoryMessages history={history} />}
61-
</UserMessage>
62-
</>
63-
);
64-
}
6531
}

0 commit comments

Comments
 (0)