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

Function saveAgentColor

src/utils/sessionStorage.ts:2839–2855  ·  view source on GitHub ↗
(
  sessionId: UUID,
  agentColor: string,
  fullPath?: string,
)

Source from the content-addressed store, hash-verified

2837}
2838
2839export async function saveAgentColor(
2840 sessionId: UUID,
2841 agentColor: string,
2842 fullPath?: string,
2843) {
2844 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2845 appendEntryToFile(resolvedPath, {
2846 type: 'agent-color',
2847 agentColor,
2848 sessionId,
2849 })
2850 // Cache for current session only (for immediate visibility)
2851 if (sessionId === getSessionId()) {
2852 getProject().currentSessionAgentColor = agentColor
2853 }
2854 logEvent('tengu_agent_color_set', {})
2855}
2856
2857/**
2858 * Cache the session agent setting. Written to disk by materializeSessionFile

Callers 1

callFunction · 0.85

Calls 5

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

Tested by

no test coverage detected