MCPcopy Create free account
hub / github.com/WJX20/claude-code / loadSubagentTranscripts

Function loadSubagentTranscripts

src/utils/sessionStorage.ts:4298–4323  ·  view source on GitHub ↗
(
  agentIds: string[],
)

Source from the content-addressed store, hash-verified

4296 * Load subagent transcripts for the given agent IDs
4297 */
4298export async function loadSubagentTranscripts(
4299 agentIds: string[],
4300): Promise<{ [agentId: string]: Message[] }> {
4301 const results = await Promise.all(
4302 agentIds.map(async agentId => {
4303 try {
4304 const result = await getAgentTranscript(asAgentId(agentId))
4305 if (result && result.messages.length > 0) {
4306 return { agentId, transcript: result.messages }
4307 }
4308 return null
4309 } catch {
4310 // Skip if transcript can't be loaded
4311 return null
4312 }
4313 }),
4314 )
4315
4316 const transcripts: { [agentId: string]: Message[] } = {}
4317 for (const result of results) {
4318 if (result) {
4319 transcripts[result.agentId] = result.transcript
4320 }
4321 }
4322 return transcripts
4323}
4324
4325// Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction.
4326export async function loadAllSubagentTranscriptsFromDisk(): Promise<{

Callers 2

submitTranscriptShareFunction · 0.85

Calls 2

getAgentTranscriptFunction · 0.85
asAgentIdFunction · 0.85

Tested by

no test coverage detected