From b1b67b973e4ab8cfdf865fd3203dc627805320ad Mon Sep 17 00:00:00 2001 From: Richard Palethorpe Date: Sat, 21 Feb 2026 18:03:49 +0000 Subject: [PATCH] fix(realtime): Add functions to conversation history (#8616) Signed-off-by: Richard Palethorpe --- CLAUDE.md | 1 + core/http/endpoints/openai/realtime.go | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 120000 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 000000000..47dc3e3d8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/core/http/endpoints/openai/realtime.go b/core/http/endpoints/openai/realtime.go index b34ee031e..415e75b18 100644 --- a/core/http/endpoints/openai/realtime.go +++ b/core/http/endpoints/openai/realtime.go @@ -1046,6 +1046,27 @@ func triggerResponse(session *Session, conv *Conversation, c *LockedWebsocket, o Content: content.Text, }) } + } else if item.FunctionCall != nil { + conversationHistory = append(conversationHistory, schema.Message{ + Role: string(types.MessageRoleAssistant), + ToolCalls: []schema.ToolCall{ + { + ID: item.FunctionCall.CallID, + Type: "function", + FunctionCall: schema.FunctionCall{ + Name: item.FunctionCall.Name, + Arguments: item.FunctionCall.Arguments, + }, + }, + }, + }) + } else if item.FunctionCallOutput != nil { + conversationHistory = append(conversationHistory, schema.Message{ + Role: "tool", + Name: item.FunctionCallOutput.CallID, + Content: item.FunctionCallOutput.Output, + StringContent: item.FunctionCallOutput.Output, + }) } } conv.Lock.Unlock()