MCPcopy Index your code
hub / github.com/codeaashu/claude-code / linkSessionToPR

Function linkSessionToPR

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

Source from the content-addressed store, hash-verified

2703 * This stores the PR number, URL, and repository for tracking and navigation.
2704 */
2705export async function linkSessionToPR(
2706 sessionId: UUID,
2707 prNumber: number,
2708 prUrl: string,
2709 prRepository: string,
2710 fullPath?: string,
2711): Promise<void> {
2712 const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId)
2713 appendEntryToFile(resolvedPath, {
2714 type: 'pr-link',
2715 sessionId,
2716 prNumber,
2717 prUrl,
2718 prRepository,
2719 timestamp: new Date().toISOString(),
2720 })
2721 // Cache for current session so reAppendSessionMetadata can re-write after compaction
2722 if (sessionId === getSessionId()) {
2723 const project = getProject()
2724 project.currentSessionPrNumber = prNumber
2725 project.currentSessionPrUrl = prUrl
2726 project.currentSessionPrRepository = prRepository
2727 }
2728 logEvent('tengu_session_linked_to_pr', { prNumber })
2729}
2730
2731export function getCurrentSessionTag(sessionId: UUID): string | undefined {
2732 // 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