You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sx...@apache.org on 2025/10/31 09:15:16 UTC

(flink-agents) branch main updated: [hotfix] toolCallContext not updated in ChatModelAction, causing data loss (#289)

This is an automated email from the ASF dual-hosted git repository.

sxnan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git


The following commit(s) were added to refs/heads/main by this push:
     new da299d9  [hotfix] toolCallContext not updated in ChatModelAction, causing data loss (#289)
da299d9 is described below

commit da299d9426753e41291bb90a78a31f3ba4997942
Author: Eugene <me...@gmail.com>
AuthorDate: Fri Oct 31 17:15:10 2025 +0800

    [hotfix] toolCallContext not updated in ChatModelAction, causing data loss (#289)
---
 .../main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java b/plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java
index 6fdbd92..5465ccf 100644
--- a/plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java
+++ b/plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java
@@ -83,6 +83,7 @@ public class ChatModelAction {
                     new ArrayList<>((List<ChatMessage>) toolCallContext.get(initialRequestId));
 
             messageContext.add(response);
+            toolCallContext.put(initialRequestId, messageContext);
             stm.set(TOOL_CALL_CONTEXT, toolCallContext);
 
             ToolRequestEvent toolRequestEvent =
@@ -182,6 +183,7 @@ public class ChatModelAction {
                                     extraArgs));
                 }
             }
+            toolCallContext.put(initialRequestId, messages);
             // overwrite tool call context
             stm.set(TOOL_CALL_CONTEXT, toolCallContext);