Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 26, 2025

Chat session agents (registered via the chat session API) were not receiving full history metadata - they only received metadata for their own turns, not for the entire conversation.

Root Cause

The isContributedChatSession flag was passed from mainThreadChatAgents2.ts but didn't flow through the protocol to prepareHistoryTurns, which decides whether to include metadata:

// prepareHistoryTurns strips metadata unless conditions are met
const result: vscode.ChatResult = agentId === h.request.agentId || context.isContributedChatSession ?
    ehResult :
    { ...ehResult, metadata: undefined };  // metadata stripped here

Changes

  • Protocol alignment: Moved isContributedChatSession from nested chatSummary object to root context level in ExtHostChatAgentsShape2 interface
  • Flow completion: Updated $invokeAgent, $provideFollowups, $provideChatTitle, and $provideChatSummary to pass isContributedChatSession through their context objects
  • Type propagation: Added isContributedChatSession to _createRequest signature to forward flag to prepareHistoryTurns

Chat session agents now receive full history metadata across all agent interactions (invoke, followups, title, summary).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Expose history to chat session agents Expose full chat history to chat session agents Oct 26, 2025
Copilot finished work on behalf of joshspicer October 26, 2025 23:41
Copilot AI requested a review from joshspicer October 26, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants