MCPcopy Create free account
hub / github.com/codeaashu/claude-code / registerAgent

Function registerAgent

src/utils/telemetry/perfettoTracing.ts:392–410  ·  view source on GitHub ↗
(
  agentId: string,
  agentName: string,
  parentAgentId?: string,
)

Source from the content-addressed store, hash-verified

390 * Call this when a subagent/teammate is spawned
391 */
392export 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.

Callers

nothing calls this directly

Calls 4

getProcessIdForAgentFunction · 0.85
stringToNumericHashFunction · 0.85
emitProcessMetadataFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected