Skip to content

Commit ab691f1

Browse files
authored
Fix "Continue waiting for" prompt not hiding when poll throws exception (#278391)
1 parent 48ac66b commit ab691f1

File tree

1 file changed

+4
-1
lines changed
  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring

1 file changed

+4
-1
lines changed

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
@@ -249,11 +249,14 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
249249
} else {
250250
// A background poll completed while waiting for a decision
251251
const r = race.r;
252+
// r can be either an OutputMonitorState or an IPollingResult object (from catch)
253+
const state = (typeof r === 'object' && r !== null) ? r.state : r;
252254

253-
if (r === OutputMonitorState.Idle || r === OutputMonitorState.Cancelled || r === OutputMonitorState.Timeout) {
255+
if (state === OutputMonitorState.Idle || state === OutputMonitorState.Cancelled || state === OutputMonitorState.Timeout) {
254256
try { continuePollingPart?.hide(); } catch { /* noop */ }
255257
continuePollingPart = undefined;
256258
continuePollingDecisionP = undefined;
259+
this._promptPart = undefined;
257260

258261
return false;
259262
}

0 commit comments

Comments
 (0)