fix(ui): add partial output to cancelled shell UI (#21178)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Dev Randalpura
2026-03-05 09:30:20 -08:00
committed by GitHub
parent 0228c2b9f0
commit f20e45175e
3 changed files with 29 additions and 2 deletions
+13 -2
View File
@@ -477,13 +477,24 @@ export class SchedulerStateManager {
}
}
// Capture any existing live output so it isn't lost when forcing cancellation.
let existingOutput: ToolResultDisplay | undefined = undefined;
if (call.status === CoreToolCallStatus.Executing && call.liveOutput) {
existingOutput = call.liveOutput;
}
if (isToolCallResponseInfo(reason)) {
const finalResponse = { ...reason };
if (!finalResponse.resultDisplay) {
finalResponse.resultDisplay = resultDisplay ?? existingOutput;
}
return {
request: call.request,
tool: call.tool,
invocation: call.invocation,
status: CoreToolCallStatus.Cancelled,
response: reason,
response: finalResponse,
durationMs: startTime ? Date.now() - startTime : undefined,
outcome: call.outcome,
schedulerId: call.schedulerId,
@@ -508,7 +519,7 @@ export class SchedulerStateManager {
},
},
],
resultDisplay,
resultDisplay: resultDisplay ?? existingOutput,
error: undefined,
errorType: undefined,
contentLength: errorMessage.length,