fix(coding-agent): keep pending tool renders after thinking toggle
closes #4167
This commit is contained in:
@@ -2633,6 +2633,7 @@ export class InteractiveMode {
|
||||
|
||||
switch (event.type) {
|
||||
case "agent_start":
|
||||
this.pendingTools.clear();
|
||||
if (this.settingsManager.getShowTerminalProgress()) {
|
||||
this.ui.terminal.setProgress(true);
|
||||
}
|
||||
@@ -3100,6 +3101,7 @@ export class InteractiveMode {
|
||||
options: { updateFooter?: boolean; populateHistory?: boolean } = {},
|
||||
): void {
|
||||
this.pendingTools.clear();
|
||||
const renderedPendingTools = new Map<string, ToolExecutionComponent>();
|
||||
|
||||
if (options.updateFooter) {
|
||||
this.footer.invalidate();
|
||||
@@ -3141,16 +3143,16 @@ export class InteractiveMode {
|
||||
}
|
||||
component.updateResult({ content: [{ type: "text", text: errorMessage }], isError: true });
|
||||
} else {
|
||||
this.pendingTools.set(content.id, component);
|
||||
renderedPendingTools.set(content.id, component);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (message.role === "toolResult") {
|
||||
// Match tool results to pending tool components
|
||||
const component = this.pendingTools.get(message.toolCallId);
|
||||
const component = renderedPendingTools.get(message.toolCallId);
|
||||
if (component) {
|
||||
component.updateResult(message);
|
||||
this.pendingTools.delete(message.toolCallId);
|
||||
renderedPendingTools.delete(message.toolCallId);
|
||||
}
|
||||
} else {
|
||||
// All other messages use standard rendering
|
||||
@@ -3158,7 +3160,9 @@ export class InteractiveMode {
|
||||
}
|
||||
}
|
||||
|
||||
this.pendingTools.clear();
|
||||
for (const [toolCallId, component] of renderedPendingTools) {
|
||||
this.pendingTools.set(toolCallId, component);
|
||||
}
|
||||
this.ui.requestRender();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user