* Starts tracking CLI activity (tool execution, AI response, etc.)
(operationId: string)
| 84 | * Starts tracking CLI activity (tool execution, AI response, etc.) |
| 85 | */ |
| 86 | startCLIActivity(operationId: string): void { |
| 87 | // If operation already exists, it likely means the previous one didn't clean up |
| 88 | // properly (e.g., component crashed/unmounted without calling end). Force cleanup |
| 89 | // to avoid overestimating time - better to underestimate than overestimate. |
| 90 | if (this.activeOperations.has(operationId)) { |
| 91 | this.endCLIActivity(operationId) |
| 92 | } |
| 93 | |
| 94 | const wasEmpty = this.activeOperations.size === 0 |
| 95 | this.activeOperations.add(operationId) |
| 96 | |
| 97 | if (wasEmpty) { |
| 98 | this.isCLIActive = true |
| 99 | this.lastCLIRecordedTime = this.getNow() |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Stops tracking CLI activity |
no test coverage detected