Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
docs(gateway): update hidden tool loop limits to no default limit (#5839)
t0saki144033826eb3
diff --git a/docs/en/guides/15-gateway.md b/docs/en/guides/15-gateway.mdindex 3dedb84ca..269987002 100644--- a/docs/en/guides/15-gateway.md+++ b/docs/en/guides/15-gateway.md@@ -140,7 +140,7 @@ The tools come straight from the MCP tool list your OpenViking server provides,### Turning them on, and the limits- **Read-only tools by default.** New context profiles have **OpenViking tools** on, including those made with **Create with recommended settings**. Only the read-only tools are selected: `find`, `search`, `grep`, `glob`, `list`, `tree`, `read`, `list_watches`, `get_acl`, `list_users`, `list_groups` and `health`. The tools that change data are left unchecked: `remember`, `write`, `edit`, `add_resource`, `add_skill`, `forget`, `set_acl` and `cancel_watch`. To let the model save memories, check `remember`; to let it import web pages or attachments, check `add_resource`. Tools that OpenViking adds later are selected automatically. Existing profiles keep their settings. The full set of tool definitions adds about 3,500 input tokens to every request in the conversation, so unchecking tools nobody needs also saves tokens. Changes apply to new conversations only.-- **Limits.** By default each request allows at most 5 rounds of tool calls and 100,000 additional tokens. Once either is used up, the gateway refuses further OpenViking calls and the model answers with the results it already has; if the model keeps calling after being refused, the request fails. A single call that runs longer than 30 seconds returns an error to the model; a request that runs longer than 120 seconds in total fails.+- **Limits.** Rounds, **Total time** and the token budget are unlimited by default: the model keeps using OpenViking tools until it finishes. In a streaming request, the user can stop the reply at any time; a non-streaming request keeps running after the client disconnects, so set **Total time** if your clients send non-streaming requests. If you set a round limit or token budget, once it is used up the gateway refuses further OpenViking calls and the model answers with the results it already has; if the model keeps calling after being refused, the request fails. If you set **Total time**, a request that runs longer than that fails. A single call that runs longer than 30 seconds returns an error to the model.- **Client requirements.** The client must send the full history every turn; with OpenAI Responses it must also set `store: false`. The gateway does not offer OpenViking tools when the client forces a specific tool or asks for structured output, when the upstream has **Allow OpenViking tools** off, or when the upstream is DeepSeek with **Restore reasoning the client drops** off and the request does not turn thinking off. With tools present, DeepSeek requires the reasoning of every earlier reply, which many clients do not send back; DeepSeek upstreams have **Restore reasoning the client drops** on by default, so the gateway puts that reasoning back and tools work with thinking on. See [Upstreams](22-gateway-operations.md#upstreams). Whether a conversation gets tools is decided at its first request.For the full conditions, limit settings, file imports and failure handling, see [OpenViking tools](22-gateway-operations.md#openviking-tools).diff --git a/docs/images/gateway/tool-loop.en.svg b/docs/images/gateway/tool-loop.en.svgindex 18cff9b9f..d097497eb 100644--- a/docs/images/gateway/tool-loop.en.svg+++ b/docs/images/gateway/tool-loop.en.svg@@ -66,8 +66,8 @@<circle cx="584" cy="508" r="13" fill="#7F3BF5"/><text x="584" y="513.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text><text x="540" y="474" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="15" font-weight="700" fill="#7F3BF5" text-anchor="end">Repeats until the model stops calling</text>-<text x="540" y="495" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">5 rounds or 100k new tokens: further calls refused</text>-<text x="540" y="515" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">30 s per call: that call errors · 120 s total: request fails</text>+<text x="540" y="495" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">Optional round/token limits: further calls refused</text>+<text x="540" y="515" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">30 s per call: call errors · set total time: request fails</text><polyline points="1440,508 1456,508 1456,320 1447,320" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round" stroke-dasharray="6 4"/><polygon points="1438,320 1448,316 1448,324" fill="#7F3BF5"/><polyline points="950,566 569,566" fill="none" stroke="#FF8800" stroke-width="2" stroke-linejoin="round"/>diff --git a/docs/images/gateway/tool-loop.zh.svg b/docs/images/gateway/tool-loop.zh.svgindex b5205c6f0..f53d60c21 100644--- a/docs/images/gateway/tool-loop.zh.svg+++ b/docs/images/gateway/tool-loop.zh.svg@@ -66,8 +66,8 @@<circle cx="584" cy="508" r="13" fill="#7F3BF5"/><text x="584" y="513.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text><text x="540" y="474" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="15" font-weight="700" fill="#7F3BF5" text-anchor="end">循环,直到模型不再调用</text>-<text x="540" y="495" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">满 5 轮或新增 10 万 token:拒绝后续调用</text>-<text x="540" y="515" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">单次超 30 秒:该次报错 · 总计超 120 秒:请求失败</text>+<text x="540" y="495" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">设置的轮数或 token 上限用完:拒绝后续调用</text>+<text x="540" y="515" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif" font-size="14" font-weight="400" fill="#646A73" text-anchor="end">单次超 30 秒:该次报错 · 超过所设总时长:请求失败</text><polyline points="1440,508 1456,508 1456,320 1447,320" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round" stroke-dasharray="6 4"/><polygon points="1438,320 1448,316 1448,324" fill="#7F3BF5"/><polyline points="950,566 569,566" fill="none" stroke="#FF8800" stroke-width="2" stroke-linejoin="round"/>diff --git a/docs/zh/guides/15-gateway.md b/docs/zh/guides/15-gateway.mdindex 25998bc10..35e65e057 100644--- a/docs/zh/guides/15-gateway.md+++ b/docs/zh/guides/15-gateway.md@@ -140,7 +140,7 @@ Relevant memory from OpenViking. Use the openviking_read tool to expand URIs.### 怎么开启、有什么上限- **默认只提供只读工具。** 新建的上下文配置默认打开 **OpenViking 工具**,“使用推荐设置创建”也一样。默认勾选的是只读工具:`find`、`search`、`grep`、`glob`、`list`、`tree`、`read`、`list_watches`、`get_acl`、`list_users`、`list_groups` 和 `health`。会修改数据的工具默认不勾选:`remember`、`write`、`edit`、`add_resource`、`add_skill`、`forget`、`set_acl` 和 `cancel_watch`。想让模型保存记忆,就勾选 `remember`;想让它导入网页或附件,就勾选 `add_resource`。OpenViking 以后新增的工具会自动勾选。已有的上下文配置保留原来的设置。全部工具定义约占 3,500 个输入 token,会随对话中的每个请求发送,所以取消用不到的工具也能节省 token。改动只影响新对话。-- **上限。** 默认每个请求最多 5 轮工具调用、新增 100,000 token。用完后网关拒绝之后的 OpenViking 调用,模型用已有结果继续回答;模型被拒后仍坚持调用,这个请求就会报错。单次调用超过 30 秒,这次调用向模型返回错误;整个请求超过 120 秒,请求失败。+- **上限。** 工具轮数、**总时长**和 **Token 预算**默认都不限:模型会一直使用 OpenViking 工具直到完成。流式请求中,用户可以随时中断回复;非流式请求在客户端断开后仍会继续执行,如果客户端发送非流式请求,建议设置**总时长**。设置了工具轮数或 Token 预算的,用完后网关拒绝之后的 OpenViking 调用,模型用已有结果继续回答;模型被拒后仍坚持调用,这个请求就会报错。设置了**总时长**的,请求超过这个时长就会失败。单次调用超过 30 秒,这次调用向模型返回错误。- **客户端要求。** 客户端要每轮回传完整历史;使用 OpenAI Responses 时要设置 `store: false`。客户端强制指定某个工具或要求结构化输出、上游关闭了**允许 OpenViking 工具**,或者上游是 DeepSeek、关闭了**补全推理内容回传**而请求又没有关闭思考模式时,网关不提供 OpenViking 工具。DeepSeek 要求带工具的请求回传之前每条回复的推理内容,而很多客户端不会发回来;DeepSeek 上游默认开启**补全推理内容回传**,由网关补回这部分内容,所以保持思考模式也能使用工具,见[上游](22-gateway-operations.md#上游)。对话是否带工具,在它的第一个请求时就决定了。完整的条件、上限设置、文件导入方式和失败处理,见[OpenViking 工具](22-gateway-operations.md#openviking-工具)。