From 716286895b095fc83fd87f71bd108f8f90129de6 Mon Sep 17 00:00:00 2001 From: Patrick Bareiss Date: Wed, 15 Jul 2026 16:08:57 +0200 Subject: [PATCH 1/2] Fix stuck progress label during non-advancing reqs2X phases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The progress notification only updated its label when the numeric progress advanced (increment > 0). Reqs2X emits a progress event at the start of each phase with the new step name but no advance, so the notification stayed frozen on the previous phase's label — e.g. showing "Precomputing context" for the whole "waiting for first model response" window while tests were already being generated. Report on a step-label change too, clamping the bar increment to 0 for label-only updates. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/requirements/processRunner.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/requirements/processRunner.ts b/src/requirements/processRunner.ts index 74a2b577..895523b5 100644 --- a/src/requirements/processRunner.ts +++ b/src/requirements/processRunner.ts @@ -10,6 +10,7 @@ import { spawnWithVcastEnv } from "./llmProvider"; */ export class ProgressTracker { private lastProgress = 0.0; + private lastStep: string | undefined; constructor( private progress: vscode.Progress<{ message?: string; increment?: number }>, @@ -53,9 +54,19 @@ export class ProgressTracker { if (newProgress === undefined) return; const increment = (newProgress - this.lastProgress) * 100; - if (increment > 0) { - this.progress.report({ message: step, increment }); - this.lastProgress = newProgress; + // Reqs2X emits a progress event at the start of each phase with the new + // step label but no advance (increment 0). Report on a label change too, + // otherwise the notification stays frozen on the previous phase's name + // during long, non-advancing steps (e.g. waiting for the first model + // response while tests are already being generated). + const stepChanged = step !== undefined && step !== this.lastStep; + if (increment > 0 || stepChanged) { + this.progress.report({ + message: step, + increment: increment > 0 ? increment : 0, + }); + if (increment > 0) this.lastProgress = newProgress; + if (step !== undefined) this.lastStep = step; logCliOperation( `${this.logPrefix} Progress: ${(newProgress * 100).toFixed(2)}% - ${step ?? ""}` ); From 6e0e28d98ab10b703f79157c80305c2318fd838c Mon Sep 17 00:00:00 2001 From: Patrick Bareiss Date: Wed, 15 Jul 2026 16:12:22 +0200 Subject: [PATCH 2/2] Use Math.max for increment clamp Addresses SonarQube: prefer Math.max(increment, 0) over a ternary. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/requirements/processRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/requirements/processRunner.ts b/src/requirements/processRunner.ts index 895523b5..7095b16b 100644 --- a/src/requirements/processRunner.ts +++ b/src/requirements/processRunner.ts @@ -63,7 +63,7 @@ export class ProgressTracker { if (increment > 0 || stepChanged) { this.progress.report({ message: step, - increment: increment > 0 ? increment : 0, + increment: Math.max(increment, 0), }); if (increment > 0) this.lastProgress = newProgress; if (step !== undefined) this.lastStep = step;