1408
*/
1409
private async _getChatMessages(provider: IAgent, chat: URI): Promise<readonly Turn[]> {
1410
>
const turns = await provider.chats.getMessages(chat);
agentService.ts
1411
>
// Host-owned worktree restore announcement: re-inject the "Created isolated
1412
>
// worktree" message at the top of the default chat's first turn from
1413
>
// persisted metadata. No-op for folder sessions and non-default chats (peer
1414
>
// / subagent). Agents stay unaware of worktrees.
1415
>
if (this._worktree && isDefaultChatUri(chat)) {
1416
return this._worktree.applyRestoreAnnouncement(URI.parse(parseRequiredSessionUriFromChatUri(chat.toString())), turns);
1417
}
1419
>
}
1420
1421
/**