diff --git a/CHANGELOG.md b/CHANGELOG.md index 71fdab683e..d791c5af13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Only write entries that are worth mentioning to users. - Auth: Fix managed model list refresh silently failing for OAuth users with expired tokens — the background `/models` sync now detects 401 responses, forces an OAuth token refresh, and retries with the refreshed token; if the refresh fails or the refreshed token is still rejected, it falls back to the originally configured static API key instead of skipping the provider - Core: Fix connection recovery not triggering OAuth refresh when the retry returns 401 — after recreating the HTTP client on `APIConnectionError` or `APITimeoutError`, the retry now re-enters the full recovery path so a subsequent 401 correctly refreshes the OAuth token instead of bubbling to the user as an unrecoverable error - Shell: Echo `/skill:*` and `/flow:*` inputs in the transcript so workflow commands stay visible after enter; operational slash commands like `/usage` and `/model` remain hidden +- Core: Raise default `max_steps_per_turn` from 500 to 1000 so long-running agents are less likely to hit the per-turn limit ## 1.39.0 (2026-04-24) diff --git a/docs/en/configuration/config-files.md b/docs/en/configuration/config-files.md index e989f7cb85..4e2167028e 100644 --- a/docs/en/configuration/config-files.md +++ b/docs/en/configuration/config-files.md @@ -62,7 +62,7 @@ model = "kimi-for-coding" max_context_size = 262144 [loop_control] -max_steps_per_turn = 500 +max_steps_per_turn = 1000 max_retries_per_step = 3 max_ralph_iterations = 0 reserved_context_size = 50000 @@ -149,7 +149,7 @@ capabilities = ["thinking"] | Field | Type | Default | Description | | --- | --- | --- | --- | -| `max_steps_per_turn` | `integer` | `500` | Maximum steps per turn (alias: `max_steps_per_run`) | +| `max_steps_per_turn` | `integer` | `1000` | Maximum steps per turn (alias: `max_steps_per_run`) | | `max_retries_per_step` | `integer` | `3` | Maximum retries per step | | `max_ralph_iterations` | `integer` | `0` | Extra iterations after each user message; `0` disables; `-1` is unlimited | | `reserved_context_size` | `integer` | `50000` | Reserved token count for LLM response generation; auto-compaction triggers when `context_tokens + reserved_context_size >= max_context_size` | diff --git a/docs/en/release-notes/changelog.md b/docs/en/release-notes/changelog.md index 837888fbc6..fb24dc0936 100644 --- a/docs/en/release-notes/changelog.md +++ b/docs/en/release-notes/changelog.md @@ -10,6 +10,7 @@ This page documents the changes in each Kimi Code CLI release. - Auth: Fix managed model list refresh silently failing for OAuth users with expired tokens — the background `/models` sync now detects 401 responses, forces an OAuth token refresh, and retries with the refreshed token; if the refresh fails or the refreshed token is still rejected, it falls back to the originally configured static API key instead of skipping the provider - Core: Fix connection recovery not triggering OAuth refresh when the retry returns 401 — after recreating the HTTP client on `APIConnectionError` or `APITimeoutError`, the retry now re-enters the full recovery path so a subsequent 401 correctly refreshes the OAuth token instead of bubbling to the user as an unrecoverable error - Shell: Echo `/skill:*` and `/flow:*` inputs in the transcript so workflow commands stay visible after enter; operational slash commands like `/usage` and `/model` remain hidden +- Core: Raise default `max_steps_per_turn` from 500 to 1000 so long-running agents are less likely to hit the per-turn limit ## 1.39.0 (2026-04-24) diff --git a/docs/zh/configuration/config-files.md b/docs/zh/configuration/config-files.md index c428f8d49a..c86818fbbf 100644 --- a/docs/zh/configuration/config-files.md +++ b/docs/zh/configuration/config-files.md @@ -62,7 +62,7 @@ model = "kimi-for-coding" max_context_size = 262144 [loop_control] -max_steps_per_turn = 500 +max_steps_per_turn = 1000 max_retries_per_step = 3 max_ralph_iterations = 0 reserved_context_size = 50000 @@ -149,7 +149,7 @@ capabilities = ["thinking"] | 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| `max_steps_per_turn` | `integer` | `500` | 单轮最大步数(别名:`max_steps_per_run`) | +| `max_steps_per_turn` | `integer` | `1000` | 单轮最大步数(别名:`max_steps_per_run`) | | `max_retries_per_step` | `integer` | `3` | 单步最大重试次数 | | `max_ralph_iterations` | `integer` | `0` | 每个 User 消息后额外自动迭代次数;`0` 表示关闭;`-1` 表示无限 | | `reserved_context_size` | `integer` | `50000` | 预留给 LLM 响应生成的 token 数量;当 `context_tokens + reserved_context_size >= max_context_size` 时自动触发压缩 | diff --git a/docs/zh/release-notes/changelog.md b/docs/zh/release-notes/changelog.md index 3eafe76384..910dde6a55 100644 --- a/docs/zh/release-notes/changelog.md +++ b/docs/zh/release-notes/changelog.md @@ -10,6 +10,7 @@ - Auth:修复 OAuth 用户 access token 过期时托管模型列表刷新静默失败的问题——后台 `/models` 同步任务现在会检测 401 响应,强制进行 OAuth token 刷新并用刷新后的 token 重试;如果刷新本身失败或刷新后的 token 仍被拒绝,则回退到最初配置的静态 API 密钥,而不是跳过该 provider - Core:修复连接恢复后重试返回 401 时未能触发 OAuth 刷新的问题——在 `APIConnectionError` 或 `APITimeoutError` 后重建 HTTP 客户端时,重试现在会重新进入完整恢复路径,使得后续的 401 能正确刷新 OAuth token,而不是作为不可恢复的错误直接抛给用户 - Shell:在 transcript 中回显 `/skill:*` 和 `/flow:*` 输入,工作流命令按下回车后不再消失;`/usage`、`/model` 等操作类斜杠命令仍然保持隐藏 +- Core:将默认 `max_steps_per_turn` 从 500 提升到 1000,长任务更不容易撞到单轮步数上限 ## 1.39.0 (2026-04-24) diff --git a/src/kimi_cli/config.py b/src/kimi_cli/config.py index 16fec25098..61a507e171 100644 --- a/src/kimi_cli/config.py +++ b/src/kimi_cli/config.py @@ -76,7 +76,7 @@ class LoopControl(BaseModel): """Agent loop control configuration.""" max_steps_per_turn: int = Field( - default=500, + default=1000, ge=1, validation_alias=AliasChoices("max_steps_per_turn", "max_steps_per_run"), ) diff --git a/tests/core/test_config.py b/tests/core/test_config.py index 6f7c264076..f7c0832e97 100644 --- a/tests/core/test_config.py +++ b/tests/core/test_config.py @@ -31,7 +31,7 @@ def test_default_config_dump(): "models": {}, "providers": {}, "loop_control": { - "max_steps_per_turn": 500, + "max_steps_per_turn": 1000, "max_retries_per_step": 3, "max_ralph_iterations": 0, "reserved_context_size": 50000,