Increase default tool rounds to 100 with 300 cap.

Raise Admin/UI defaults and backend clamps for AIA_TURN_MAX_TOOL_ROUNDS across gateway, worker, and direct loop paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-28 11:34:20 +08:00
parent 89b295293d
commit 8233db93db
9 changed files with 18 additions and 18 deletions

View file

@ -1961,7 +1961,7 @@ def build_admin_router() -> APIRouter:
tmr_raw = str(store.get_setting("AIA_TURN_MAX_TOOL_ROUNDS") or "").strip()
tmc_raw = str(store.get_setting("AIA_TURN_MAX_CONTEXT_MESSAGES") or "").strip()
turn_max_tool_workers = max(1, min(int(tmw_raw), 32)) if tmw_raw.isdigit() else 8
turn_max_tool_rounds = max(1, min(int(tmr_raw), 100)) if tmr_raw.isdigit() else 30
turn_max_tool_rounds = max(1, min(int(tmr_raw), 300)) if tmr_raw.isdigit() else 100
turn_max_context_messages = max(10, min(int(tmc_raw), 400)) if tmc_raw.isdigit() else 80
# Oclaw takeover: legacy runner switches are disconnected (kept in DB for later).
turn_runner_impl = "oclaw"
@ -2057,7 +2057,7 @@ def build_admin_router() -> APIRouter:
sm = True
sig_budget_n = 2
tmw = payload.get("turn_max_tool_workers", 8)
tmr = payload.get("turn_max_tool_rounds", 30)
tmr = payload.get("turn_max_tool_rounds", 100)
tmc = payload.get("turn_max_context_messages", 80)
tri = "oclaw"
try:
@ -2065,9 +2065,9 @@ def build_admin_router() -> APIRouter:
except Exception:
tmw_n = 8
try:
tmr_n = max(1, min(int(tmr), 100))
tmr_n = max(1, min(int(tmr), 300))
except Exception:
tmr_n = 30
tmr_n = 100
try:
tmc_n = max(10, min(int(tmc), 400))
except Exception:

View file

@ -4381,7 +4381,7 @@ async function renderPlugins() {
tool_loop_state_machine: true,
tool_signature_budget: 2,
turn_max_tool_workers: 8,
turn_max_tool_rounds: 30,
turn_max_tool_rounds: 100,
turn_max_context_messages: 80,
turn_runner_impl: "oclaw",
manager_decision_mode: "",
@ -4635,8 +4635,8 @@ async function renderPlugins() {
class: "input",
type: "number",
min: "1",
max: "100",
value: String(Number(toolPolicy.turn_max_tool_rounds || 30)),
max: "300",
value: String(Number(toolPolicy.turn_max_tool_rounds || 100)),
style: "max-width:120px",
});
const turnMaxCtxInput = el("input", {
@ -4728,7 +4728,7 @@ async function renderPlugins() {
onclick: async () => {
const r = await apiPost("/admin/api/tool-policy", {
turn_max_tool_workers: Number(turnMaxWorkersInput.value || 8),
turn_max_tool_rounds: Number(turnMaxRoundsInput.value || 30),
turn_max_tool_rounds: Number(turnMaxRoundsInput.value || 100),
turn_max_context_messages: Number(turnMaxCtxInput.value || 80),
// manager_decision_mode is legacy-only; no longer submitted.
sse_queue_maxsize: Number(sseQueueMaxsizeInput.value || 2000),
@ -6069,7 +6069,7 @@ async function renderPlugins() {
turnMaxWorkersInput,
]),
el("div", { class: "row" }, [
el("label", { text: "Turn max tool rounds (1-100)" }),
el("label", { text: "Turn max tool rounds (1-300)" }),
turnMaxRoundsInput,
]),
el("div", { class: "row" }, [