diff --git a/docs/liteflow-react-agent-guide.md b/docs/liteflow-react-agent-guide.md index bc0479907..eb13fd442 100644 --- a/docs/liteflow-react-agent-guide.md +++ b/docs/liteflow-react-agent-guide.md @@ -69,6 +69,8 @@ liteflow.agent.openai-compatible.deepseek.base-url=https://api.deepseek.com/v1 AgentConfigException: liteflow.agent.workspace.root is required ``` +**路径形式**:`workspace.root` 同时支持绝对路径与相对路径。框架内部通过 `Paths.get(root).toAbsolutePath().normalize()` 解析,相对路径会基于 JVM 启动时的 `user.dir`(当前工作目录)拼成绝对路径。由于 `user.dir` 在 IDE 启动、`java -jar`、systemd、容器等不同场景下差异巨大,**生产环境一律建议使用绝对路径**(如示例中的 `/var/lib/liteflow/agent-workspaces`),避免同一份配置在不同部署方式下落盘到不同位置,进而影响 session 持久化、conversation workspace 复用等行为。 + ### 2.3 编写 Agent 组件 Agent 组件继承 `ReActAgentComponent`,至少实现三个无参方法: @@ -750,6 +752,8 @@ liteflow.agent.skills.strict=true | `path` | `./skills` | skills 根目录,目录下每个子目录表示一个 skill | | `strict` | `true` | 严格模式。目录缺失、声明的 skill 不存在、`tools` 类加载失败等问题会快速失败;设为 `false` 时记录 warn 并尽量继续 | +**路径形式**:`skills.path` 同时支持绝对路径与相对路径,与 [`workspace.root`](#22-配置-liteflow-与-agent) 同样基于 JVM `user.dir` 解析相对路径。默认值 `./skills` 只是开发与本地 demo 的便利值,**生产环境建议改成绝对路径**(如 `/opt/liteflow/skills`),既能避免不同启动方式定位到不同目录,又便于配合只读挂载、版本化发布等运维约束。若开启 skills 但目录不存在:`strict=true` 抛出 `Skills root not found`;`strict=false` 仅记录 warn 后跳过 skills 加载。 + 配置只是把可选技能放入 Agent 的 `SkillBox`。某个技能是否在本轮真正被使用,取决于 AgentScope ReAct 运行过程中是否调用 `load_skill_through_path` 加载该技能。 ### 7.2 目录结构与 SKILL.md @@ -1010,7 +1014,7 @@ liteflow.agent.shell.max-output-bytes=1048576 liteflow.agent.logging.react-enabled=true # ReAct 默认最大迭代次数 -liteflow.agent.defaults.max-iterations=15 +liteflow.agent.defaults.max-iterations=50 # Skills liteflow.agent.skills.enabled=false diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/DefaultsConfig.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/DefaultsConfig.java index a3ed9a6f1..9a05a4f16 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/DefaultsConfig.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/DefaultsConfig.java @@ -11,7 +11,7 @@ public class DefaultsConfig { *

仅在 {@code ReActAgentComponent#maxIterations()} 未显式覆盖(返回值 ≤ 0)时生效, * 用于防止 LLM 陷入死循环造成无限调用。 */ - private int maxIterations = 15; + private int maxIterations = 50; public int getMaxIterations() { return maxIterations; diff --git a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index ae381a302..b094c09ec 100644 --- a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -401,7 +401,7 @@ "type": "java.lang.Integer", "description": "Default max iterations for agent.", "sourceType": "com.yomahub.liteflow.property.agent.DefaultsConfig", - "defaultValue": 15 + "defaultValue": 50 }, { "name": "liteflow.agent.logging.react-enabled", diff --git a/pom.xml b/pom.xml index d1ffe6bd3..a0c40ef9b 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 4.1.1 1.14.0 2.9.3 - 1.0.11 + 1.0.12 1.38.0 1.2.0