diff --git a/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java b/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java index 475ae58e..801de3a0 100644 --- a/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java +++ b/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java @@ -59,11 +59,17 @@ public abstract class BaseAgent { /** * Max ReAct iterations (one reasoning + action + observation step counts as one). - * Default 100, hard ceiling 100 (enforced in AgentGraphBuilder so per-agent DB + * Default 150, hard ceiling 150 (enforced in AgentGraphBuilder so per-agent DB * overrides cannot exceed it). + * + *

Raised from 100 → 150 after the round-4 LLM-review smoke test, where a + * 10-model research task with browser_use + per-step verification hit the + * 100-iter cap with only 4/10 models completed. 150 gives roughly 50 % + * headroom for similar multi-step research workflows while still bounding + * a runaway agent. */ - public static final int MAX_ITERATIONS_HARD_CEILING = 100; - protected int maxIterations = 100; + public static final int MAX_ITERATIONS_HARD_CEILING = 150; + protected int maxIterations = 150; /** 工作区活动目录(限制文件工具访问范围,为空不限制) */ protected String workspaceBasePath; diff --git a/mateclaw-server/src/main/resources/db/migration/h2/V124__agent_max_iterations_150.sql b/mateclaw-server/src/main/resources/db/migration/h2/V124__agent_max_iterations_150.sql new file mode 100644 index 00000000..0ca37ad3 --- /dev/null +++ b/mateclaw-server/src/main/resources/db/migration/h2/V124__agent_max_iterations_150.sql @@ -0,0 +1,15 @@ +-- V124: bump default agents' max_iterations 100 → 150 to support longer +-- multi-step research workflows (10+ items × per-step browser verification). +-- +-- Calibrated from the round-4 LLM-review smoke test: a "research 10 LLMs, +-- write a section per model, summarise, generate PPTX" task hit the previous +-- 100-iter ceiling with only 4/10 models completed because each model takes +-- ~25 iterations of browser_use + read_file + edit_file + progress_update. +-- 150 gives ~50 % headroom while still bounding a runaway agent. +-- +-- Idempotent: only updates rows still holding the previous default (100) so +-- user-customised agents are not touched. BaseAgent's hard ceiling is also +-- raised to 150; AgentGraphBuilder clamps DB overrides against it. + +UPDATE mate_agent SET max_iterations = 150 +WHERE id IN (1000000001, 1000000002, 1000000003) AND max_iterations = 100; diff --git a/mateclaw-server/src/main/resources/db/migration/mysql/V124__agent_max_iterations_150.sql b/mateclaw-server/src/main/resources/db/migration/mysql/V124__agent_max_iterations_150.sql new file mode 100644 index 00000000..a8a55207 --- /dev/null +++ b/mateclaw-server/src/main/resources/db/migration/mysql/V124__agent_max_iterations_150.sql @@ -0,0 +1,6 @@ +-- V124: bump default agents' max_iterations 100 → 150 (see H2 copy for full +-- background). Same idempotent UPDATE — H2 and MySQL accept identical syntax +-- for this UPDATE so no dialect-specific guard is needed. + +UPDATE mate_agent SET max_iterations = 150 +WHERE id IN (1000000001, 1000000002, 1000000003) AND max_iterations = 100;