You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by xt...@apache.org on 2026/01/08 05:57:10 UTC
(flink-agents) branch main updated: [plan][hotfix] Avoid retrying chat even if response is valid. (#420)
This is an automated email from the ASF dual-hosted git repository.
xtsong 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 ebb41d8 [plan][hotfix] Avoid retrying chat even if response is valid. (#420)
ebb41d8 is described below
commit ebb41d8a73439477e72ecf29ed7b16fc6c889903
Author: Wenjin Xie <16...@users.noreply.github.com>
AuthorDate: Thu Jan 8 13:57:06 2026 +0800
[plan][hotfix] Avoid retrying chat even if response is valid. (#420)
---
.../java/org/apache/flink/agents/plan/actions/ChatModelAction.java | 1 +
python/flink_agents/plan/actions/chat_model_action.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
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 aa51fa4..7d5b34c 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
@@ -215,6 +215,7 @@ public class ChatModelAction {
if (outputSchema != null && response.getToolCalls().isEmpty()) {
response = generateStructuredOutput(response, outputSchema);
}
+ break;
} catch (Exception e) {
if (strategy == Agent.ErrorHandlingStrategy.IGNORE) {
LOG.warn(
diff --git a/python/flink_agents/plan/actions/chat_model_action.py b/python/flink_agents/plan/actions/chat_model_action.py
index 0db7e5a..7413fa2 100644
--- a/python/flink_agents/plan/actions/chat_model_action.py
+++ b/python/flink_agents/plan/actions/chat_model_action.py
@@ -185,7 +185,8 @@ def chat(
response = chat_model.chat(messages)
if output_schema is not None and len(response.tool_calls) == 0:
response = _generate_structured_output(response, output_schema)
- except Exception as e: # noqa: PERF203
+ break
+ except Exception as e:
if error_handling_strategy == ErrorHandlingStrategy.IGNORE:
_logger.warning(
f"Chat request {initial_request_id} failed with error: {e}, ignored."