feat(core,server,docs): default max_turns to -1 (unlimited) to avoid unexpected run cutoffs (#232)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-08-07 18:53:03 +08:00
committed by GitHub
parent 4a899a265f
commit 6e1c7cc28e
12 changed files with 80 additions and 22 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ This page shows the context_engine's overall flow first, then breaks down each s
session.run(newMessages, { approve, signal })
│ carry-over from a previous interrupt? → prepend to this run's input
▼
┌── turn loop (≤ max_turns, default 100) ───────────────────────┐
┌── turn loop (≤ max_turns; default -1 = no cap) ───────────────┐
│ │
│ request_begin │
│ LLM.streamGenerate(newMessages) │
+1 -1
View File
@@ -13,7 +13,7 @@ SDK 的唯一执行入口是 `session.run(newMessages, opts?)`:输入本次新
session.run(newMessages, { approve, signal })
│ 存在上次中断的补发内容?→ 前置到本轮输入
▼
┌── 轮循环(≤ max_turns,默认 100)──────────────────────────────┐
┌── 轮循环(≤ max_turns,默认 -1 不限制)────────────────────────┐
│ │
│ request_begin │
│ LLM.streamGenerate(newMessages) │
+3 -2
View File
@@ -98,7 +98,7 @@ Edit this file via the CLI (`penguin config model …`) or the Web Models page
| `description` | — | Agent description |
| `version` | `1` | Agent State version (a natural number), incremented on each successful optimization |
| `system_prompt` | built-in template | Required; the only template with placeholder substitution |
| `max_turns` | `100` | Maximum LLM turns per Task (-1 removes the cap) |
| `max_turns` | `-1` | Maximum LLM turns per Task (`-1` = unlimited; a positive integer caps the Task) |
| `model.max_tokens` | `32000` | Output Token limit per Request (-1 = no cap, provider default) |
| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh`; the session default, overridable per-Task |
| `model.timeoutMs` | `120000` | Per-Request timeout (milliseconds) |
@@ -122,7 +122,8 @@ version: 3
system_prompt: |
…
max_turns: 100
# -1 (the default) = unlimited; set a positive integer to cap the turns of a single Task.
max_turns: -1
model:
max_tokens: 32000
+3 -2
View File
@@ -98,7 +98,7 @@ output = 0.857143
| `description` | — | Agent 描述 |
| `version` | `1` | Agent State 版本号(自然数),每次成功优化自增 |
| `system_prompt` | 内置模板 | 必填;唯一进行占位符替换的模板 |
| `max_turns` | `100` | 单个 Task 的最大 LLM 轮数(-1 不限制) |
| `max_turns` | `-1` | 单个 Task 的最大 LLM 轮数(`-1` 不限制,正整数为上限) |
| `model.max_tokens` | `32000` | 单次输出 Token 上限(-1 不设上限,用服务商默认) |
| `model.thinking_level` | `medium` | `none` / `low` / `medium` / `high` / `xhigh`;作为会话默认档位,可被逐轮 Task 参数覆盖 |
| `model.timeoutMs` | `120000` | 单次 Request 超时(毫秒) |
@@ -122,7 +122,8 @@ version: 3
system_prompt: |
…
max_turns: 100
# -1(缺省)不限制轮数;设为正整数则限制单个 Task 的轮数。
max_turns: -1
model:
max_tokens: 32000