mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 04:41:16 -05:00
Fix terminal isHot logic to take into account commands that finished running and could have affected diagnostics
This commit is contained in:
@@ -1848,14 +1848,17 @@ ${this.customInstructions.trim()}
|
|||||||
}
|
}
|
||||||
|
|
||||||
const busyTerminals = this.terminalManager.getTerminals(true)
|
const busyTerminals = this.terminalManager.getTerminals(true)
|
||||||
|
const inactiveTerminals = this.terminalManager.getTerminals(false)
|
||||||
|
const allTerminals = [...busyTerminals, ...inactiveTerminals]
|
||||||
|
|
||||||
if (busyTerminals.length > 0 || this.didEditFile) {
|
if (busyTerminals.length > 0 || this.didEditFile) {
|
||||||
await delay(300) // delay after saving file to let terminals/diagnostics catch up
|
await delay(300) // delay after saving file to let terminals/diagnostics catch up
|
||||||
}
|
}
|
||||||
|
|
||||||
if (busyTerminals.length > 0) {
|
if (allTerminals.length > 0) {
|
||||||
// wait for terminals to cool down
|
// wait for terminals to cool down
|
||||||
await pWaitFor(() => busyTerminals.every((t) => !this.terminalManager.isProcessHot(t.id)), {
|
// note this does not mean they're actively running just that they recently output something
|
||||||
|
await pWaitFor(() => allTerminals.every((t) => !this.terminalManager.isProcessHot(t.id)), {
|
||||||
interval: 100,
|
interval: 100,
|
||||||
timeout: 15_000,
|
timeout: 15_000,
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
@@ -1896,7 +1899,6 @@ ${this.customInstructions.trim()}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// only show inactive terminals if there's output to show
|
// only show inactive terminals if there's output to show
|
||||||
const inactiveTerminals = this.terminalManager.getTerminals(false)
|
|
||||||
if (inactiveTerminals.length > 0) {
|
if (inactiveTerminals.length > 0) {
|
||||||
const inactiveTerminalOutputs = new Map<number, string>()
|
const inactiveTerminalOutputs = new Map<number, string>()
|
||||||
for (const inactiveTerminal of inactiveTerminals) {
|
for (const inactiveTerminal of inactiveTerminals) {
|
||||||
|
|||||||
@@ -377,10 +377,11 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
|
|||||||
|
|
||||||
this.emitRemainingBufferIfListening()
|
this.emitRemainingBufferIfListening()
|
||||||
|
|
||||||
if (this.hotTimer) {
|
// even though the command is finished, we still want to consider it 'hot' in case so that api request stalls to let diagnostics catch up
|
||||||
clearTimeout(this.hotTimer)
|
// if (this.hotTimer) {
|
||||||
}
|
// clearTimeout(this.hotTimer)
|
||||||
this.isHot = false
|
// }
|
||||||
|
// this.isHot = false
|
||||||
|
|
||||||
this.emit("completed")
|
this.emit("completed")
|
||||||
this.emit("continue")
|
this.emit("continue")
|
||||||
|
|||||||
Reference in New Issue
Block a user