1667
// the same fetch+map path as the default chat via `_reconstructTurns`.
1668
if (isSubagentSession(session)) {
1669
>
const parsed = parseSubagentSessionUri(session);
claudeAgent.ts
1670
>
const parentSession = parsed ? this._sessions.get(AgentSession.id(parsed.parentSession))?.defaultChat : undefined;
1671
>
if (!parentSession) {
1672
>
// Parent session is gone (disposed or never materialized).
1673
>
// The registry that holds the agentId cache lives on the
1674
>
// parent session, so we cannot resolve the subagent.
1675
>
this._logService.warn(`[Claude] getSessionMessages: parent session not found for subagent ${session.toString()} (registry unavailable)`);
1676
>
return [];
1677
>
}
1678
try {
1679
return await getSubagentTranscript(session, parentSession.subagents, this._sdkService, this._logService, CancellationToken.None);