Skip to content

Comments

Consume tool_call_id in Message proto for FunctionResultContent#64

Merged
kzu merged 2 commits intomainfrom
copilot/consume-tool-call-id-in-message-proto
Feb 4, 2026
Merged

Consume tool_call_id in Message proto for FunctionResultContent#64
kzu merged 2 commits intomainfrom
copilot/consume-tool-call-id-in-message-proto

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
@kzu kzu marked this pull request as ready for review February 4, 2026 12:03
@kzu kzu enabled auto-merge (squash) February 4, 2026 12:04
@kzu
Copy link
Member

kzu commented Feb 4, 2026

22 passed 22 passed 23 skipped

🧪 Details on Ubuntu 24.04.3 LTS

from retest v1.1.0 on .NET 10.0.2 with 💜 by @devlooped

@kzu kzu merged commit 0bcbeaf into main Feb 4, 2026
4 checks passed
@kzu kzu deleted the copilot/consume-tool-call-id-in-message-proto branch February 4, 2026 12:04
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