MCPcopy
hub / github.com/codeaashu/claude-code / saveAgentName

Function saveAgentName

src/utils/sessionStorage.ts:2819–2836  ·  view source on GitHub ↗
(
  sessionId: UUID,
  agentName: string,
  fullPath?: string,
  source: 'user' | 'auto' = 'user',
)

Source from the content-addressed store, hash-verified

2817}
2818
2819export async function saveAgentName(
2820 sessionId: UUID,
2821 agentName: string,
2822 fullPath?: string,
2823 source: 'user' | 'auto' = 'user',
2824) {
2825 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2826 appendEntryToFile(resolvedPath, { type: 'agent-name', agentName, sessionId })
2827 // Cache for current session only (for immediate visibility)
2828 if (sessionId === getSessionId()) {
2829 getProject().currentSessionAgentName = agentName
2830 void updateSessionName(agentName)
2831 }
2832 logEvent('tengu_agent_name_set', {
2833 source:
2834 source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
2835 })
2836}
2837
2838export async function saveAgentColor(
2839 sessionId: UUID,

Callers 2

autoNameSessionFromPlanFunction · 0.85
callFunction · 0.85

Calls 6

appendEntryToFileFunction · 0.85
getSessionIdFunction · 0.85
getProjectFunction · 0.85
updateSessionNameFunction · 0.85
logEventFunction · 0.85

Tested by

no test coverage detected