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

Function saveAgentName

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

Source from the content-addressed store, hash-verified

2901}
2902
2903export async function saveAgentName(
2904 sessionId: UUID,
2905 agentName: string,
2906 fullPath?: string,
2907 source: 'user' | 'auto' = 'user',
2908) {
2909 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2910 appendEntryToFile(resolvedPath, { type: 'agent-name', agentName, sessionId })
2911 // Cache for current session only (for immediate visibility)
2912 if (sessionId === getSessionId()) {
2913 getProject().currentSessionAgentName = agentName
2914 void updateSessionName(agentName)
2915 }
2916 logEvent('tengu_agent_name_set', {
2917 source:
2918 source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
2919 })
2920}
2921
2922export async function saveAgentColor(
2923 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