* Clear all subscriber transcripts for an agent. * Called at the end of each agent loop iteration.
(agentId: string)
| 203 | * Called at the end of each agent loop iteration. |
| 204 | */ |
| 205 | public clearSubscriberTranscripts(agentId: string): void { |
| 206 | let clearedCount = 0; |
| 207 | for (const [key, subscriber] of this.subscribers) { |
| 208 | if (key.startsWith(`${agentId}:`)) { |
| 209 | subscriber.clear(); |
| 210 | clearedCount++; |
| 211 | } |
| 212 | } |
| 213 | if (clearedCount > 0) { |
| 214 | Logger.debug("StreamManager", `Cleared ${clearedCount} subscriber transcript(s) for agent ${agentId}`); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Destroy all subscribers for an agent. |
no test coverage detected