MCPcopy Create free account
hub / github.com/WJX20/claude-code / saveAgentName

Function saveAgentName

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

Source from the content-addressed store, hash-verified

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