( sessionId: UUID, prNumber: number, prUrl: string, prRepository: string, fullPath?: string, )
| 2749 | * This stores the PR number, URL, and repository for tracking and navigation. |
| 2750 | */ |
| 2751 | export async function linkSessionToPR( |
| 2752 | sessionId: UUID, |
| 2753 | prNumber: number, |
| 2754 | prUrl: string, |
| 2755 | prRepository: string, |
| 2756 | fullPath?: string, |
| 2757 | ): Promise<void> { |
| 2758 | const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId) |
| 2759 | appendEntryToFile(resolvedPath, { |
| 2760 | type: 'pr-link', |
| 2761 | sessionId, |
| 2762 | prNumber, |
| 2763 | prUrl, |
| 2764 | prRepository, |
| 2765 | timestamp: new Date().toISOString(), |
| 2766 | }) |
| 2767 | // Cache for current session so reAppendSessionMetadata can re-write after compaction |
| 2768 | if (sessionId === getSessionId()) { |
| 2769 | const project = getProject() |
| 2770 | project.currentSessionPrNumber = prNumber |
| 2771 | project.currentSessionPrUrl = prUrl |
| 2772 | project.currentSessionPrRepository = prRepository |
| 2773 | } |
| 2774 | logEvent('tengu_session_linked_to_pr', { prNumber }) |
| 2775 | } |
| 2776 | |
| 2777 | export function getCurrentSessionTag(sessionId: UUID): string | undefined { |
| 2778 | // Only returns tag for current session (the only one we cache) |
no test coverage detected