( sessionId: UUID, agentName: string, fullPath?: string, source: 'user' | 'auto' = 'user', )
| 2817 | } |
| 2818 | |
| 2819 | export 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 | |
| 2838 | export async function saveAgentColor( |
| 2839 | sessionId: UUID, |
no test coverage detected