fix(chat): preserve provider tool-call metadata

This commit is contained in:
Yeongpil Yoon
2026-06-09 18:30:42 +09:00
committed by lyingbug
parent 2aadd61fcc
commit c6fc315042
14 changed files with 369 additions and 45 deletions
@@ -165,8 +165,9 @@ func buildAssistantHistoryMessages(m *types.Message) []chat.Message {
for _, tc := range nonTerminalCalls {
argsJSON, _ := json.Marshal(tc.Args)
assistantMsg.ToolCalls = append(assistantMsg.ToolCalls, chat.ToolCall{
ID: tc.ID,
Type: "function",
ID: tc.ID,
Type: "function",
ProviderMetadata: tc.ProviderMetadata,
Function: chat.FunctionCall{
Name: tc.Name,
Arguments: string(argsJSON),