* Clear all subscriber transcripts for an agent. * Called at the end of each agent loop iteration.
(agentId: string)
| 231 | * Called at the end of each agent loop iteration. |
| 232 | */ |
| 233 | public clearSubscriberTranscripts(agentId: string): void { |
| 234 | let clearedCount = 0; |
| 235 | for (const [key, subscriber] of this.subscribers) { |
| 236 | if (key.startsWith(`${agentId}:`)) { |
| 237 | subscriber.clear(); |
| 238 | clearedCount++; |
| 239 | } |
| 240 | } |
| 241 | if (clearedCount > 0) { |
| 242 | Logger.debug("StreamManager", `Cleared ${clearedCount} subscriber transcript(s) for agent ${agentId}`); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Destroy all subscribers for an agent. |
no test coverage detected