Skip to content

Commit 6344c32

Browse files
authored
for tasks with problem matchers, don't pass back output, only succinct reply (microsoft#269568)
fixes microsoft#269563
1 parent be15710 commit 6344c32

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ export async function taskProblemPollFn(execution: IExecution, token: Cancellati
224224
? new Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn)
225225
: undefined
226226
});
227-
const label: string = uri ? uri.path.split('/').pop() ?? uri.toString() : '';
228227
const message = marker.message ?? '';
229-
problemList.push(`Problem: ${message} in ${label} coming from ${owner}`);
228+
problemList.push(`Problem: ${message} in ${uri.fsPath} coming from ${owner} starting on line ${marker.startLineNumber}${marker.startColumn ? `, column ${marker.startColumn} and ending on line ${marker.endLineNumber}${marker.endColumn ? `, column ${marker.endColumn}` : ''}` : ''}`);
230229
}
231230
}
232231
if (problemList.length === 0) {

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
105105

106106
let modelOutputEvalResponse;
107107
let resources;
108+
let output;
108109

109110
let extended = false;
110111
try {
@@ -134,6 +135,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
134135
} else {
135136
resources = idleResult.resources;
136137
modelOutputEvalResponse = idleResult.modelOutputEvalResponse;
138+
output = idleResult.output;
137139
}
138140
break;
139141
}
@@ -149,7 +151,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
149151
} finally {
150152
this._pollingResult = {
151153
state: this._state,
152-
output: this._execution.getOutput(),
154+
output: output ?? this._execution.getOutput(),
153155
modelOutputEvalResponse: token.isCancellationRequested ? 'Cancelled' : modelOutputEvalResponse,
154156
pollDurationMs: Date.now() - pollStartTime,
155157
resources
@@ -161,7 +163,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
161163
}
162164

163165

164-
private async _handleIdleState(token: CancellationToken): Promise<{ resources?: ILinkLocation[]; modelOutputEvalResponse?: string; shouldContinuePollling: boolean }> {
166+
private async _handleIdleState(token: CancellationToken): Promise<{ resources?: ILinkLocation[]; modelOutputEvalResponse?: string; shouldContinuePollling: boolean; output?: string }> {
165167
const confirmationPrompt = await this._determineUserInputOptions(this._execution, token);
166168

167169
if (confirmationPrompt?.detectedRequestForFreeFormInput) {
@@ -208,7 +210,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
208210
const custom = await this._pollFn?.(this._execution, token, this._taskService);
209211
const resources = custom?.resources;
210212
const modelOutputEvalResponse = await this._assessOutputForErrors(this._execution.getOutput(), token);
211-
return { resources, modelOutputEvalResponse, shouldContinuePollling: false };
213+
return { resources, modelOutputEvalResponse, shouldContinuePollling: false, output: custom?.output };
212214
}
213215

214216
private async _handleTimeoutState(command: string, invocationContext: IToolInvocationContext | undefined, extended: boolean, token: CancellationToken): Promise<boolean> {

0 commit comments

Comments
 (0)