MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / linkSessionToPR

Function linkSessionToPR

src/utils/sessionStorage.ts:2751–2775  ·  view source on GitHub ↗
(
  sessionId: UUID,
  prNumber: number,
  prUrl: string,
  prRepository: string,
  fullPath?: string,
)

Source from the content-addressed store, hash-verified

2749 * This stores the PR number, URL, and repository for tracking and navigation.
2750 */
2751export 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
2777export function getCurrentSessionTag(sessionId: UUID): string | undefined {
2778 // Only returns tag for current session (the only one we cache)

Callers 1

trackGitOperationsFunction · 0.85

Calls 5

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

Tested by

no test coverage detected