Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

PR #62 added tool_call_id field to the Message proto for associating tool responses with prior invocations. This change ensures the SDK properly sets this field when converting FunctionResultContent to protocol messages.

Changes

  • GrokChatClient.cs: Set Message.ToolCallId from FunctionResultContent.CallId when creating tool result messages
  • ChatClientTests.cs: Add unit tests verifying ToolCallId mapping behavior

Example

When a FunctionResultContent with a CallId is converted:

var messages = new List<ChatMessage>
{
    new(ChatRole.Assistant, [new FunctionCallContent("call-123", "get_time")]),
    new(ChatRole.Tool, [new FunctionResultContent("call-123", "2024-01-01T00:00:00Z")]),
};

// The resulting Message now includes:
// { Role: RoleTool, ToolCallId: "call-123", Content: [...] }
Original prompt

Ensure we properly consume the new tool_call_id in the Message proto from #62


💡 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.

…essages

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure proper consumption of tool_call_id in Message proto Consume tool_call_id in Message proto for FunctionResultContent Jan 19, 2026
Copilot AI requested a review from kzu January 19, 2026 19:03
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