MCPcopy Create free account
hub / github.com/Noumena-Network/code / loadAllSubagentTranscriptsFromDisk

Function loadAllSubagentTranscriptsFromDisk

src/utils/sessionStorage.ts:4551–4573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4549
4550// Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction.
4551export async function loadAllSubagentTranscriptsFromDisk(): Promise<{
4552 [agentId: string]: Message[]
4553}> {
4554 const subagentsDir = join(
4555 getSessionProjectDir() ?? getProjectDir(getOriginalCwd()),
4556 getSessionId(),
4557 'subagents',
4558 )
4559 let entries: Dirent[]
4560 try {
4561 entries = await readdir(subagentsDir, { withFileTypes: true })
4562 } catch {
4563 return {}
4564 }
4565 // Filename format is the inverse of getAgentTranscriptPath() — keep in sync.
4566 const agentIds = entries
4567 .filter(
4568 d =>
4569 d.isFile() && d.name.startsWith('agent-') && d.name.endsWith('.jsonl'),
4570 )
4571 .map(d => d.name.slice('agent-'.length, -'.jsonl'.length))
4572 return loadSubagentTranscripts(agentIds)
4573}
4574
4575// Exported so useLogMessages can sync-compute the last loggable uuid
4576// without awaiting recordTranscript's return value (race-free hint tracking).

Callers 1

FeedbackFunction · 0.85

Calls 6

getSessionProjectDirFunction · 0.85
getOriginalCwdFunction · 0.85
getSessionIdFunction · 0.85
readdirFunction · 0.85
loadSubagentTranscriptsFunction · 0.85
getProjectDirFunction · 0.70

Tested by

no test coverage detected