( sessionId: UUID, customTitle: string, fullPath?: string, source: 'user' | 'auto' = 'user', )
| 2654 | /* eslint-enable custom-rules/no-sync-fs */ |
| 2655 | |
| 2656 | export async function saveCustomTitle( |
| 2657 | sessionId: UUID, |
| 2658 | customTitle: string, |
| 2659 | fullPath?: string, |
| 2660 | source: 'user' | 'auto' = 'user', |
| 2661 | ) { |
| 2662 | // Fall back to computed path if fullPath is not provided |
| 2663 | const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId) |
| 2664 | appendEntryToFile(resolvedPath, { |
| 2665 | type: 'custom-title', |
| 2666 | customTitle, |
| 2667 | sessionId, |
| 2668 | }) |
| 2669 | // Cache for current session only (for immediate visibility) |
| 2670 | if (sessionId === getSessionId()) { |
| 2671 | getProject().currentSessionTitle = customTitle |
| 2672 | } |
| 2673 | logEvent('tengu_session_renamed', { |
| 2674 | source: |
| 2675 | source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 2676 | }) |
| 2677 | } |
| 2678 | |
| 2679 | /** |
| 2680 | * Persist an AI-generated title to the JSONL as a distinct `ai-title` entry. |
no test coverage detected