From 2deb96a31c4ec81752e80947e99624470efaaa97 Mon Sep 17 00:00:00 2001 From: Zhoujie628 Date: Thu, 17 Sep 2026 19:39:38 +0800 Subject: [PATCH] fix(samples): raise default LLM max tokens to 4000 Field logs show the reasoning-capable model exhausting 2000 output tokens: validation responses came back with finish_reason=length or truncated JSON, forcing the caller-side retries and adding tens of seconds per affected call. Raise the LlmHelper fallback default to 4000 to match the documented .env.example value; deployments that set A2AT_LLM_MAX_TOKENS explicitly are unaffected. Signed-off-by: Zhoujie628 --- .../dev/openan/workflow/engine/examples/util/LlmHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/src/main/java/dev/openan/workflow/engine/examples/util/LlmHelper.java b/samples/src/main/java/dev/openan/workflow/engine/examples/util/LlmHelper.java index 0beb72d..8eef601 100644 --- a/samples/src/main/java/dev/openan/workflow/engine/examples/util/LlmHelper.java +++ b/samples/src/main/java/dev/openan/workflow/engine/examples/util/LlmHelper.java @@ -197,7 +197,7 @@ private static Config loadFromEnv(Path envFile) { log.warn("[LlmHelper] Missing LLM config in .env (need API_KEY, BASE_URL, MODEL)"); return null; } - int maxTokens = getIntProperty(properties, "A2AT_LLM_MAX_TOKENS", 2000); + int maxTokens = getIntProperty(properties, "A2AT_LLM_MAX_TOKENS", 4000); double temperature = getDoubleProperty(properties, "A2AT_LLM_TEMPERATURE", 0.0); int timeout = getIntProperty(properties, "A2AT_LLM_TIMEOUT_SECONDS", 60); return new Config(envFile.toString(), apiKey, baseUrl, model, maxTokens, temperature, timeout);