MCPcopy Index your code
hub / github.com/Noumena-Network/code / getTranscriptPathForSession

Function getTranscriptPathForSession

src/utils/sessionStorage.ts:235–253  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

233}
234
235export function getTranscriptPathForSession(sessionId: string): string {
236 // When asking for the CURRENT session's transcript, honor sessionProjectDir
237 // the same way getTranscriptPath() does. Without this, hooks get a
238 // transcript_path computed from originalCwd while the actual file was
239 // written to sessionProjectDir (set by switchActiveSession on resume/branch)
240 // — different directories, so the hook sees MISSING (gh-30217). CC-34
241 // made sessionId + sessionProjectDir atomic precisely to prevent this
242 // kind of drift; this function just wasn't updated to read both.
243 //
244 // For OTHER session IDs we can only guess via originalCwd — we don't
245 // track a sessionId→projectDir map. Callers wanting a specific other
246 // session's path should pass fullPath explicitly (most save* functions
247 // already accept this).
248 if (sessionId === getSessionId()) {
249 return getTranscriptPath()
250 }
251 const projectDir = getProjectDir(getOriginalCwd())
252 return join(projectDir, `${sessionId}.jsonl`)
253}
254
255// 50 MB — session JSONL can grow to multiple GB (inc-3930). Callers that
256// read the raw transcript must bail out above this threshold to avoid OOM.

Callers 13

hydrateRemoteSessionFunction · 0.85
saveCustomTitleFunction · 0.85
saveAiGeneratedTitleFunction · 0.85
saveTaskSummaryFunction · 0.85
saveTagFunction · 0.85
linkSessionToPRFunction · 0.85
saveAgentNameFunction · 0.85
saveAgentColorFunction · 0.85
getLastSessionLogFunction · 0.85
createBaseHookInputFunction · 0.85

Calls 4

getSessionIdFunction · 0.85
getTranscriptPathFunction · 0.85
getOriginalCwdFunction · 0.85
getProjectDirFunction · 0.70

Tested by

no test coverage detected