You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subagent turns appear as separate assistant messages after restoration #163
When a subagent executes (e.g. run_subagent tool call), its progress events are persisted as independent CopilotTurnData entries in the conversation JSON. When the conversation is restored from history, these subagent turns appear as separate assistant messages instead of being nested under the parent agent turn.
Root Cause
ChatView.onChatProgress() calls persistenceManager.cacheConversationProgress() for all progress events, including subagent events. updateConversationProgressInternal() creates a new CopilotTurnData for the subagent's turnId. Since subagent turnIds don't match any UserTurnData, they become orphaned copilot turns.
During restoration, restoreTurn() renders each CopilotTurnData as an independent assistant message, with no knowledge that it was a subagent execution.
Reproduction Steps
Start a conversation in Agent mode
Send a message that triggers subagent execution
Wait for subagent to complete
Open chat history, switch to another conversation, then switch back
Observe: subagent tool calls appear as a separate assistant message below the parent turn
changed the title [-]Subagent turns persisted as independent CopilotTurnData, restored as separate assistant messages[/-][+] Subagent turns appear as separate assistant messages after restoration[/+]on May 9, 2026
Activity
[-]Subagent turns persisted as independent CopilotTurnData, restored as separate assistant messages[/-][+] Subagent turns appear as separate assistant messages after restoration[/+]