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