( agentId: string, agentName: string, parentAgentId?: string, )
| 390 | * Call this when a subagent/teammate is spawned |
| 391 | */ |
| 392 | export function registerAgent( |
| 393 | agentId: string, |
| 394 | agentName: string, |
| 395 | parentAgentId?: string, |
| 396 | ): void { |
| 397 | if (!isEnabled) return |
| 398 | |
| 399 | const info: AgentInfo = { |
| 400 | agentId, |
| 401 | agentName, |
| 402 | parentAgentId, |
| 403 | processId: getProcessIdForAgent(agentId), |
| 404 | threadId: stringToNumericHash(agentName), |
| 405 | } |
| 406 | |
| 407 | agentRegistry.set(agentId, info) |
| 408 | totalAgentCount++ |
| 409 | emitProcessMetadata(info) |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * Unregister an agent from the trace. |
nothing calls this directly
no test coverage detected