MCPcopy Create free account
hub / github.com/Noumena-Network/code / saveAgentName

Function saveAgentName

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

Source from the content-addressed store, hash-verified

2997}
2998
2999export async function saveAgentName(
3000 sessionId: UUID,
3001 agentName: string,
3002 fullPath?: string,
3003 source: 'user' | 'auto' = 'user',
3004) {
3005 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
3006 appendEntryToFile(resolvedPath, { type: 'agent-name', agentName, sessionId })
3007 // Cache for current session only (for immediate visibility)
3008 if (sessionId === getSessionId()) {
3009 getProject().currentSessionAgentName = agentName
3010 void updateSessionName(agentName)
3011 }
3012 logEvent('ncode_agent_name_set', {
3013 source:
3014 source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
3015 })
3016}
3017
3018export async function saveAgentColor(
3019 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.50

Tested by

no test coverage detected