Skip to content

Commit adb5a77

Browse files
committed
get last request
1 parent 21a7b8b commit adb5a77

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,10 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
951951
if (!(chatModel instanceof ChatModel)) {
952952
throw new Error('No model');
953953
}
954-
const request = chatModel.getRequests().at(-1);
954+
// In async mode the last request may be an implicit (hidden) steering request.
955+
// Attach the elicitation to the last visible request so it renders in the UI.
956+
const requests = chatModel.getRequests();
957+
const request = requests.findLast(r => !r.isImplicit) ?? requests.at(-1);
955958
if (!request) {
956959
throw new Error('No request');
957960
}

0 commit comments

Comments
 (0)