Don't run timer when agent stopped on "continue to iterate" (fix #283923)

This commit is contained in:
Benjamin Pasero
2025-12-18 16:57:44 +01:00
parent 3f52ca0da5
commit 3c0ce891c7

View File

@@ -273,7 +273,7 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
// Fallback to state label
else {
if (isSessionInProgressStatus(session.element.status)) {
if (session.element.status === AgentSessionStatus.InProgress) {
template.description.textContent = localize('chat.session.status.inProgress', "Working...");
} else if (session.element.status === AgentSessionStatus.NeedsInput) {
template.description.textContent = localize('chat.session.status.needsInput', "Input needed.");
@@ -310,7 +310,7 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
const getStatus = (session: IAgentSession) => {
let timeLabel: string | undefined;
if (isSessionInProgressStatus(session.status) && session.timing.inProgressTime) {
if (session.status === AgentSessionStatus.InProgress && session.timing.inProgressTime) {
timeLabel = this.toDuration(session.timing.inProgressTime, Date.now());
}
@@ -323,7 +323,7 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
template.status.textContent = getStatus(session.element);
const timer = template.elementDisposable.add(new IntervalTimer());
timer.cancelAndSet(() => template.status.textContent = getStatus(session.element), isSessionInProgressStatus(session.element.status) ? 1000 /* every second */ : 60 * 1000 /* every minute */);
timer.cancelAndSet(() => template.status.textContent = getStatus(session.element), session.element.status === AgentSessionStatus.InProgress ? 1000 /* every second */ : 60 * 1000 /* every minute */);
}
private renderHover(session: ITreeNode<IAgentSession, FuzzyScore>, template: IAgentSessionItemTemplate): void {