mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-10 00:27:05 -06:00
Pass in isBackground for proper task chat agent message (#282266)
fixes #281570
This commit is contained in:
parent
fdab7f7d2c
commit
aab8d1abe9
@ -137,7 +137,7 @@ export class CreateAndRunTaskTool implements IToolImpl {
|
||||
const details = terminalResults.map(r => `Terminal: ${r.name}\nOutput:\n${r.output}`);
|
||||
const uniqueDetails = Array.from(new Set(details)).join('\n\n');
|
||||
const toolResultDetails = toolResultDetailsFromResponse(terminalResults);
|
||||
const toolResultMessage = toolResultMessageFromResponse(result, args.task.label, toolResultDetails, terminalResults);
|
||||
const toolResultMessage = toolResultMessageFromResponse(result, args.task.label, toolResultDetails, terminalResults, undefined, task.configurationProperties.isBackground);
|
||||
return {
|
||||
content: [{ kind: 'text', value: uniqueDetails }],
|
||||
toolResultMessage,
|
||||
|
||||
@ -124,7 +124,7 @@ export class GetTaskOutputTool extends Disposable implements IToolImpl {
|
||||
const details = terminalResults.map(r => `Terminal: ${r.name}\nOutput:\n${r.output}`);
|
||||
const uniqueDetails = Array.from(new Set(details)).join('\n\n');
|
||||
const toolResultDetails = toolResultDetailsFromResponse(terminalResults);
|
||||
const toolResultMessage = toolResultMessageFromResponse(undefined, taskLabel, toolResultDetails, terminalResults, true);
|
||||
const toolResultMessage = toolResultMessageFromResponse(undefined, taskLabel, toolResultDetails, terminalResults, true, task.configurationProperties.isBackground);
|
||||
|
||||
return {
|
||||
content: [{ kind: 'text', value: uniqueDetails }],
|
||||
|
||||
@ -97,7 +97,7 @@ export class RunTaskTool implements IToolImpl {
|
||||
const details = terminalResults.map(r => `Terminal: ${r.name}\nOutput:\n${r.output}`);
|
||||
const uniqueDetails = Array.from(new Set(details)).join('\n\n');
|
||||
const toolResultDetails = toolResultDetailsFromResponse(terminalResults);
|
||||
const toolResultMessage = toolResultMessageFromResponse(result, taskLabel, toolResultDetails, terminalResults);
|
||||
const toolResultMessage = toolResultMessageFromResponse(result, taskLabel, toolResultDetails, terminalResults, undefined, task.configurationProperties.isBackground);
|
||||
|
||||
return {
|
||||
content: [{ kind: 'text', value: uniqueDetails }],
|
||||
|
||||
@ -27,7 +27,7 @@ export function toolResultDetailsFromResponse(terminalResults: { output: string;
|
||||
).values());
|
||||
}
|
||||
|
||||
export function toolResultMessageFromResponse(result: ITaskSummary | undefined, taskLabel: string, toolResultDetails: (URI | Location)[], terminalResults: { output: string; resources?: ILinkLocation[]; state: OutputMonitorState }[], getOutputTool?: boolean): MarkdownString {
|
||||
export function toolResultMessageFromResponse(result: ITaskSummary | undefined, taskLabel: string, toolResultDetails: (URI | Location)[], terminalResults: { output: string; resources?: ILinkLocation[]; state: OutputMonitorState }[], getOutputTool?: boolean, isBackground?: boolean): MarkdownString {
|
||||
let resultSummary = '';
|
||||
if (result?.exitCode) {
|
||||
resultSummary = localize('copilotChat.taskFailedWithExitCode', 'Task `{0}` failed with exit code {1}.', taskLabel, result.exitCode);
|
||||
@ -42,9 +42,13 @@ export function toolResultMessageFromResponse(result: ITaskSummary | undefined,
|
||||
? (problemCount
|
||||
? `finished with \`${problemCount}\` problem${problemCount === 1 ? '' : 's'}`
|
||||
: 'finished')
|
||||
: (problemCount
|
||||
? `started and will continue to run in the background with \`${problemCount}\` problem${problemCount === 1 ? '' : 's'}`
|
||||
: 'started and will continue to run in the background');
|
||||
: (isBackground
|
||||
? (problemCount
|
||||
? `started and will continue to run in the background with \`${problemCount}\` problem${problemCount === 1 ? '' : 's'}`
|
||||
: 'started and will continue to run in the background')
|
||||
: (problemCount
|
||||
? `started with \`${problemCount}\` problem${problemCount === 1 ? '' : 's'}`
|
||||
: 'started'));
|
||||
}
|
||||
}
|
||||
return new MarkdownString(resultSummary);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user