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
feat(gateway): no default limits on the hidden OpenViking tool loop (#5811)
t0saki5b5121c54679
diff --git a/docs/en/guides/22-gateway-operations.md b/docs/en/guides/22-gateway-operations.mdindex de31baa11..55c592d5e 100644--- a/docs/en/guides/22-gateway-operations.md+++ b/docs/en/guides/22-gateway-operations.md@@ -532,11 +532,13 @@ The limits sit under **Advanced settings** in the profile's **OpenViking tools**| Setting | API name | Default | Range | At the limit || --- | --- | --- | --- | --- |-| Rounds per request | `tool_max_rounds` | 5 | 1–20 | Further OpenViking calls are refused; the model continues with the results it has and the client's own tools. |+| Rounds per request | `tool_max_rounds` | No limit | 1 or more | Further OpenViking calls are refused; the model continues with the results it has and the client's own tools. || Time limit per call | `tool_timeout_seconds` | 30 s | up to 120 s | The call returns an error to the model. || Result size | `tool_result_bytes` | 65,536 bytes | 1,024–1,048,576 | The result is truncated. |-| Total time | `tool_total_seconds` | 120 s | up to 600 s | The request fails with 504 "Hidden tool request timed out". |-| Token budget | `tool_total_tokens` | 100,000 | 1,024–1,000,000 | Further OpenViking calls are refused; the model continues with the results it has and the client's own tools. This is not a billing cap; the final answer can exceed it. |+| Total time | `tool_total_seconds` | No limit | more than 0 s | The request fails with 504 "Hidden tool request timed out". |+| Token budget | `tool_total_tokens` | No limit | 1,024 or more | Further OpenViking calls are refused; the model continues with the results it has and the client's own tools. This is not a billing cap; the final answer can exceed it. |++Rounds, total time and the token budget are unlimited by default, as in an agent's own tool loop: the model keeps using OpenViking tools until it finishes. In a streaming request, the user can stop the reply at any time, and the gateway stops when the client disconnects. A non-streaming request keeps running after the client disconnects, so set **Total time** if your clients send non-streaming requests. Leave a field empty for no limit. Profiles saved before this default changed keep their earlier values (5 rounds, 120 s, 100,000 tokens); clear the fields to remove the limits.The token budget covers the extra calls, results and subsequent model output from using OpenViking tools. Existing conversation history, tool definitions and images do not count. The gateway preserves the client's answer-length limit (`max_tokens`, `max_completion_tokens` or `max_output_tokens`). Once the budget is spent, the gateway refuses further OpenViking calls, and the model continues with the results already available and the client's own tools.@@ -758,11 +760,11 @@ URL settings must be plain `http` or `https` addresses without credentials, quer| OpenViking tools | `gateway_tools` | `true` | | Offer OpenViking tools for Chat, full-history Responses and Anthropic Messages. || Unselected tools | `disabled_tools` | The 8 tools that change data: `remember`, `write`, `edit`, `add_resource`, `add_skill`, `forget`, `set_acl` and `cancel_watch` | Tool names from OpenViking, without `openviking_` | Tools unavailable to new conversations; every other available tool is offered, including ones added later. API requests that omit the field get the default list; an empty list enables every available tool when the main switch is on. || Show tool calls | `show_tool_calls` | `true` | | Add a one-line notice to the reply for each OpenViking tool call. |-| Rounds per request | `tool_max_rounds` | `5` | 1–20 | See [OpenViking tools](#openviking-tools). |+| Rounds per request | `tool_max_rounds` | `null` (no limit) | 1 or more | See [OpenViking tools](#openviking-tools). || Time limit per call | `tool_timeout_seconds` | `30` | up to 120 | || Result size | `tool_result_bytes` | `65536` | 1,024–1,048,576 | |-| Total time | `tool_total_seconds` | `120` | up to 600 | |-| Token budget | `tool_total_tokens` | `100000` | 1,024–1,000,000 | |+| Total time | `tool_total_seconds` | `null` (no limit) | more than 0 | |+| Token budget | `tool_total_tokens` | `null` (no limit) | 1,024 or more | |**Upstream settings:**@@ -858,7 +860,7 @@ These rejections happen before a request reaches a provider, so they do not appe| 426 | A WebSocket connection to the Responses API. Expected: Codex falls back to HTTP. || 502 "Model upstream is unavailable" | The gateway could not reach the provider, or the call exceeded `upstream_timeout_seconds`. Use **Test connection** on the upstream. || 503 "Dev authentication requires a loopback gateway" | OpenViking runs in dev mode. Switch it to API key mode. |-| 504 "Hidden tool request timed out" | OpenViking tool rounds exceeded the profile's **Total time** for tools. |+| 504 "Hidden tool request timed out" | OpenViking tool rounds exceeded the profile's **Total time** for tools, or, when **Total time** is not set, one model request inside the tool rounds exceeded `upstream_timeout_seconds`. |### No memory is addeddiff --git a/docs/zh/guides/22-gateway-operations.md b/docs/zh/guides/22-gateway-operations.mdindex caed87e6a..1081c222b 100644--- a/docs/zh/guides/22-gateway-operations.md+++ b/docs/zh/guides/22-gateway-operations.md@@ -532,11 +532,13 @@ server {| 设置 | API 名称 | 默认值 | 范围 | 达到上限时 || --- | --- | --- | --- | --- |-| 每次请求的工具轮数 | `tool_max_rounds` | 5 | 1–20 | 拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。 |+| 每次请求的工具轮数 | `tool_max_rounds` | 不限 | 1 及以上 | 拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。 || 单次调用超时 | `tool_timeout_seconds` | 30 秒 | 最多 120 秒 | 这次调用向模型返回错误。 || 结果大小上限 | `tool_result_bytes` | 65,536 字节 | 1,024–1,048,576 | 结果被截断。 |-| 总时长 | `tool_total_seconds` | 120 秒 | 最多 600 秒 | 请求失败,返回 504 "Hidden tool request timed out"。 |-| Token 预算 | `tool_total_tokens` | 100,000 | 1,024–1,000,000 | 拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。这不是计费上限,最终回答可能超出它。 |+| 总时长 | `tool_total_seconds` | 不限 | 大于 0 秒 | 请求失败,返回 504 "Hidden tool request timed out"。 |+| Token 预算 | `tool_total_tokens` | 不限 | 1,024 及以上 | 拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。这不是计费上限,最终回答可能超出它。 |++轮数、总时长和 Token 预算默认都不限,和 Agent 自己的工具循环一样:模型会一直使用 OpenViking 工具直到完成。流式请求中,用户可以随时中断回复,客户端断开后网关也会停止。非流式请求在客户端断开后仍会继续执行,所以如果客户端发送非流式请求,请设置**总时长**。字段留空即表示不限。这项默认值修改之前保存的上下文配置仍保留原来的值(5 轮、120 秒、100,000 Token),清空这几项即可取消限制。Token 预算用于模型使用 OpenViking 工具时新增的调用、结果和后续生成内容,客户端已有的对话、工具定义和图片不计入。网关保留客户端设置的回答长度上限(`max_tokens`、`max_completion_tokens` 或 `max_output_tokens`)。预算用完后,网关会拒绝之后的 OpenViking 调用,模型利用已有结果和客户端自己的工具继续回答。@@ -758,11 +760,11 @@ URL 类设置必须是普通的 `http` 或 `https` 地址,不能包含账号| OpenViking 工具 | `gateway_tools` | `true` | | 为 Chat、完整历史的 Responses 和 Anthropic Messages 提供 OpenViking 工具。 || 取消勾选的工具 | `disabled_tools` | 会修改数据的 8 个工具:`remember`、`write`、`edit`、`add_resource`、`add_skill`、`forget`、`set_acl` 和 `cancel_watch` | OpenViking 工具原名,不带 `openviking_` | 新对话不提供这些工具,其余可用工具都会提供,包括以后新增的。API 请求省略这个字段时使用默认列表;列表为空且总开关开启时,提供全部可用工具。 || 显示工具调用 | `show_tool_calls` | `true` | | 每次 OpenViking 工具调用都在回复里加一行提示。 |-| 每次请求的工具轮数 | `tool_max_rounds` | `5` | 1–20 | 见 [OpenViking 工具](#openviking-工具)。 |+| 每次请求的工具轮数 | `tool_max_rounds` | `null`(不限) | 1 及以上 | 见 [OpenViking 工具](#openviking-工具)。 || 单次调用超时 | `tool_timeout_seconds` | `30` | 最多 120 | || 结果大小上限 | `tool_result_bytes` | `65536` | 1,024–1,048,576 | |-| 总时长 | `tool_total_seconds` | `120` | 最多 600 | |-| Token 预算 | `tool_total_tokens` | `100000` | 1,024–1,000,000 | |+| 总时长 | `tool_total_seconds` | `null`(不限) | 大于 0 | |+| Token 预算 | `tool_total_tokens` | `null`(不限) | 1,024 及以上 | |**上游设置:**@@ -858,7 +860,7 @@ OpenViking Server 无法使用网关时,OpenViking 网关页面会显示一张| 426 | 对 Responses API 发起了 WebSocket 连接。这是预期行为,Codex 会改用 HTTP。 || 502 "Model upstream is unavailable" | 网关连不上服务商,或者调用超过了 `upstream_timeout_seconds`。在上游上运行**测试连接**。 || 503 "Dev authentication requires a loopback gateway" | OpenViking 运行在 dev 模式。把它切换到 API Key 模式。 |-| 504 "Hidden tool request timed out" | OpenViking 工具的往返超过了上下文配置中工具的**总时长**。 |+| 504 "Hidden tool request timed out" | OpenViking 工具的往返超过了上下文配置中工具的**总时长**;未设置**总时长**时,是工具往返中的某次模型请求超过了 `upstream_timeout_seconds`。 |### 没有补充记忆diff --git a/openviking_gateway/models.py b/openviking_gateway/models.pyindex d0b5421b4..3dd745c6a 100644--- a/openviking_gateway/models.py+++ b/openviking_gateway/models.py@@ -52,11 +52,12 @@ class Policy(BaseModel):gateway_tools: bool = True# MCP tool names; tools the server adds later stay enabled.disabled_tools: list[str] = Field(default_factory=lambda: list(WRITE_TOOLS))- tool_max_rounds: int = Field(default=5, ge=1, le=20)+ # None means no limit, as in an agent harness's own tool loop.+ tool_max_rounds: int | None = Field(default=None, ge=1)tool_timeout_seconds: float = Field(default=30, gt=0, le=120)tool_result_bytes: int = Field(default=65536, ge=1024, le=1048576)- tool_total_seconds: float = Field(default=120, gt=0, le=600)- tool_total_tokens: int = Field(default=100000, ge=1024, le=1000000)+ tool_total_seconds: float | None = Field(default=None, gt=0)+ tool_total_tokens: int | None = Field(default=None, ge=1024)show_tool_calls: bool = True# Experimental: the model starts fresh context windows itself (needs gateway tools).agent_windows: bool = Falsediff --git a/openviking_gateway/proxy.py b/openviking_gateway/proxy.pyindex f3cb69278..a9a2536cc 100644--- a/openviking_gateway/proxy.py+++ b/openviking_gateway/proxy.py@@ -344,11 +344,14 @@ class ProxyRequest:}async def send(payload, timeout):+ # Without a total tool deadline each continuation gets the usual upstream timeout.return await self.app.state.http.post(self.target,data=orjson.dumps(payload),headers=self.headers,- timeout=aiohttp.ClientTimeout(total=timeout),+ timeout=aiohttp.ClientTimeout(+ total=timeout or self.config.upstream_timeout_seconds+ ),allow_redirects=False,)diff --git a/openviking_gateway/tool_loop.py b/openviking_gateway/tool_loop.pyindex 2dc8624c8..119574741 100644--- a/openviking_gateway/tool_loop.py+++ b/openviking_gateway/tool_loop.py@@ -39,11 +39,8 @@ class HiddenToolLoop:# A request without gateway tools comes here only to show the recall notice: every# call is the client's, nothing runs, and the reply takes as long as it takes.self.allowed = executor.allowed if prepared.tools_active else set()- self.deadline = (- time.monotonic() + self.policy.get("tool_total_seconds", 120)- if prepared.tools_active- else None- )+ seconds = self.policy.get("tool_total_seconds")+ self.deadline = time.monotonic() + seconds if prepared.tools_active and seconds else Noneself.adapter.lead_with(prepared.reply_lead)self.transcript, self.usage = [], {}self.final, self.hidden, self.window = None, False, None@@ -111,11 +108,12 @@ class HiddenToolLoop:the model goes on with the client's tools; calling again right after a refusedround ends the request."""- budget = self.policy.get("tool_total_tokens", 100000)+ budget = self.policy.get("tool_total_tokens") or float("inf")+ rounds = self.policy.get("tool_max_rounds") or float("inf")closed = (self.prepared.tools_closedor self.adapter.tool_choice(self.body) == "none"- or self.rounds >= self.policy.get("tool_max_rounds", 5)+ or self.rounds >= roundsor self.token_cost >= budget)if closed and self.refused:@@ -260,7 +258,8 @@ class HiddenToolLoop:for event in self.adapter.terminal(self.final):yield self.adapter.encode(event)return- response = await send(self.body, max(0.01, self.deadline - time.monotonic()))+ remaining = self.deadline and max(0.01, self.deadline - time.monotonic())+ response = await send(self.body, remaining)except (ValueError, TypeError, KeyError, IndexError) as error:raise ToolLoopError("Invalid model tool response") from errorexcept asyncio.TimeoutError as error:diff --git a/tests/gateway/test_app.py b/tests/gateway/test_app.pyindex cf3dcf93b..d8d7af87d 100644--- a/tests/gateway/test_app.py+++ b/tests/gateway/test_app.py@@ -527,6 +527,39 @@ async def test_tool_round_limit_refuses_gateway_calls_but_keeps_client_tools(assert message["tool_calls"] == [weather] and "— skipped" in message["content"]+async def test_default_policy_does_not_limit_tool_rounds(running_gateway):+ app, client, admin, key, _, _ = running_gateway+ await enable_tools(client, admin)+ requests, mcp_calls = [], []++ async def backend(request):+ if request.path == "/mcp":+ mcp_calls.append(await request.json())+ return web.json_response({"id": 1, "result": {"content": []}})+ if request.path == "/v1/chat/completions":+ requests.append(await request.json())+ number = len(requests)+ if number > 25:+ return web.json_response(completion({"role": "assistant", "content": "done"}))+ call = tool_call(identifier=f"g-{number}")+ return web.json_response(+ completion(+ {"role": "assistant", "content": None, "tool_calls": [call]}, "tool_calls"+ )+ )+ return None++ app.state.test_backend["handler"] = backend+ response = await client.post(+ "/v1/chat/completions",+ headers={"Authorization": "Bearer " + key["key"], "X-OpenViking-Session": "tools"},+ json={"model": "model", "messages": [{"role": "user", "content": "find blue"}]},+ )+ assert response.status_code == 200, response.text+ assert len(mcp_calls) == 25+ assert all(m.get("content") != REFUSED for r in requests for m in r["messages"])++@pytest.mark.parametrize("header", [{"X-Claude-Code-Agent-Id": "child"}, {"X-OpenViking-Plugin": "1"}])diff --git a/web-studio/src/i18n/locales/en/gateway/common.ts b/web-studio/src/i18n/locales/en/gateway/common.tsindex deb5655f9..18273be16 100644--- a/web-studio/src/i18n/locales/en/gateway/common.ts+++ b/web-studio/src/i18n/locales/en/gateway/common.ts@@ -162,6 +162,7 @@ const common = {field: {default: 'Default: {{value}}',notSet: 'Not set',+ noLimit: 'No limit',advanced: 'Advanced settings',sectionInvalid: 'Fix the highlighted settings in this section to save.',storedSecret: 'Stored — leave blank to keep',diff --git a/web-studio/src/i18n/locales/en/gateway/profiles.ts b/web-studio/src/i18n/locales/en/gateway/profiles.tsindex a1d376d7f..116b6393b 100644--- a/web-studio/src/i18n/locales/en/gateway/profiles.ts+++ b/web-studio/src/i18n/locales/en/gateway/profiles.ts@@ -212,7 +212,7 @@ const profiles = {maxRounds: {label: 'Rounds per request',description:- "After this many tool rounds, further OpenViking calls are refused; the model continues with the results it has and the client's own tools.",+ "After this many tool rounds, further OpenViking calls are refused; the model continues with the results it has and the client's own tools. Leave empty for no limit.",},timeoutSeconds: {label: 'Time limit per call',@@ -225,12 +225,12 @@ const profiles = {totalSeconds: {label: 'Total time',description:- 'If the model is still using tools after this long, the request fails.',+ 'If the model is still using tools after this long, the request fails. Leave empty for no limit.',},totalTokens: {label: 'Token budget',description:- "Estimated tokens that tool calls and results may add to one request. Once used up, further OpenViking calls are refused; the model continues with the results it has and the client's own tools.",+ "Estimated tokens that tool calls and results may add to one request. Once used up, further OpenViking calls are refused; the model continues with the results it has and the client's own tools. Leave empty for no limit.",},},}diff --git a/web-studio/src/i18n/locales/zh-CN/gateway/common.ts b/web-studio/src/i18n/locales/zh-CN/gateway/common.tsindex adcdd8379..81b5517de 100644--- a/web-studio/src/i18n/locales/zh-CN/gateway/common.ts+++ b/web-studio/src/i18n/locales/zh-CN/gateway/common.ts@@ -154,6 +154,7 @@ const common = {field: {default: '默认值:{{value}}',notSet: '未设置',+ noLimit: '不限',advanced: '高级设置',sectionInvalid: '这一部分有设置需要修改,改好后才能保存。',storedSecret: '已保存,留空则保持不变',diff --git a/web-studio/src/i18n/locales/zh-CN/gateway/profiles.ts b/web-studio/src/i18n/locales/zh-CN/gateway/profiles.tsindex 7b86b7717..8bbb1a972 100644--- a/web-studio/src/i18n/locales/zh-CN/gateway/profiles.ts+++ b/web-studio/src/i18n/locales/zh-CN/gateway/profiles.ts@@ -203,7 +203,7 @@ const profiles = {maxRounds: {label: '每次请求的工具轮数',description:- '达到这个轮数后,网关拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。',+ '达到这个轮数后,网关拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。留空表示不限。',},timeoutSeconds: {label: '单次调用超时',@@ -215,12 +215,12 @@ const profiles = {},totalSeconds: {label: '总时长',- description: '模型使用工具超过这个时长,请求就会失败。',+ description: '模型使用工具超过这个时长,请求就会失败。留空表示不限。',},totalTokens: {label: 'Token 预算',description:- '一次请求中,工具调用和结果最多增加的 Token 数(估算值)。用完后,网关拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。',+ '一次请求中,工具调用和结果最多增加的 Token 数(估算值)。用完后,网关拒绝后续的 OpenViking 调用,模型用已有结果和客户端自己的工具继续。留空表示不限。',},},}diff --git a/web-studio/src/routes/gateway/-components/profiles-settings.tsx b/web-studio/src/routes/gateway/-components/profiles-settings.tsxindex 3177f26fb..40be9766c 100644--- a/web-studio/src/routes/gateway/-components/profiles-settings.tsx+++ b/web-studio/src/routes/gateway/-components/profiles-settings.tsx@@ -306,6 +306,8 @@ export function ProfileSettingsForm({const fallback = PROFILE_DEFAULTS[field]const unit = rule.unit ? t(`units.${rule.unit}`) : undefinedconst hint = humanize(rule.unit, current, locale)+ const empty = rule.optional || rule.unlimited+ const emptyLabel = t(rule.unlimited ? 'field.noLimit' : 'field.notSet')return (<SettingFieldlabel={t(`${copy}.label`)}@@ -317,7 +319,7 @@ export function ProfileSettingsForm({: unit}defaultValue={- fallback === null ? t('field.notSet') : formatNumber(fallback, locale)+ fallback === null ? emptyLabel : formatNumber(fallback, locale)}error={message(field)}>@@ -327,11 +329,11 @@ export function ProfileSettingsForm({min={rule.min}max={rule.max}step={rule.step ?? (rule.integer ? 1 : 'any')}- placeholder={rule.optional ? t('field.notSet') : undefined}+ placeholder={empty ? emptyLabel : undefined}aria-invalid={Boolean(errors[field])}onChange={(next) =>onChange({- [field]: rule.optional && Number.isNaN(next) ? null : next,+ [field]: empty && Number.isNaN(next) ? null : next,} as Partial<ProfileSettings>)}/>diff --git a/web-studio/src/routes/gateway/-lib/api.ts b/web-studio/src/routes/gateway/-lib/api.tsindex 810469a19..9d278221a 100644--- a/web-studio/src/routes/gateway/-lib/api.ts+++ b/web-studio/src/routes/gateway/-lib/api.ts@@ -118,11 +118,11 @@ export type ProfileSettings = {gateway_tools: booleanshow_tool_calls: booleandisabled_tools: string[]- tool_max_rounds: number+ tool_max_rounds: number | nulltool_timeout_seconds: numbertool_result_bytes: number- tool_total_seconds: number- tool_total_tokens: number+ tool_total_seconds: number | null+ tool_total_tokens: number | null}export type Profile = ProfileSettings & { id: string; revision: number }diff --git a/web-studio/src/routes/gateway/-lib/profile-schema.ts b/web-studio/src/routes/gateway/-lib/profile-schema.tsindex 240aeddc4..4fded2013 100644--- a/web-studio/src/routes/gateway/-lib/profile-schema.ts+++ b/web-studio/src/routes/gateway/-lib/profile-schema.ts@@ -43,11 +43,11 @@ export const PROFILE_DEFAULTS: ProfileSettings = {gateway_tools: true,show_tool_calls: true,disabled_tools: WRITE_TOOLS,- tool_max_rounds: 5,+ tool_max_rounds: null,tool_timeout_seconds: 30,tool_result_bytes: 65536,- tool_total_seconds: 120,- tool_total_tokens: 100000,+ tool_total_seconds: null,+ tool_total_tokens: null,}type NumericField = {@@ -72,7 +72,7 @@ export const PROFILE_LIMITS: Record<NumericField, NumberRule> = {context_window: { min: 1024, integer: true, optional: true, unit: 'tokens' },window_soft_ratio: { min: 0.3, max: 0.95, step: 0.01 },window_hard_ratio: { min: 0.4, max: 0.97, step: 0.01 },- tool_max_rounds: { min: 1, max: 20, integer: true, unit: 'rounds' },+ tool_max_rounds: { min: 1, integer: true, unlimited: true, unit: 'rounds' },tool_timeout_seconds: {min: 0,max: 120,@@ -80,13 +80,13 @@ export const PROFILE_LIMITS: Record<NumericField, NumberRule> = {unit: 'seconds',},tool_result_bytes: { min: 1024, max: 1048576, integer: true, unit: 'bytes' },- tool_total_seconds: { min: 0, max: 600, exclusiveMin: true, unit: 'seconds' },- tool_total_tokens: {- min: 1024,- max: 1000000,- integer: true,- unit: 'tokens',+ tool_total_seconds: {+ min: 0,+ exclusiveMin: true,+ unlimited: true,+ unit: 'seconds',},+ tool_total_tokens: { min: 1024, integer: true, unlimited: true, unit: 'tokens' },}/** Per-category entry limit used by "Limit by category". */diff --git a/web-studio/src/routes/gateway/-lib/validation.ts b/web-studio/src/routes/gateway/-lib/validation.tsindex fd0ec2903..4fac8fa66 100644--- a/web-studio/src/routes/gateway/-lib/validation.ts+++ b/web-studio/src/routes/gateway/-lib/validation.ts@@ -29,6 +29,8 @@ export type NumberRule = {integer?: boolean/** Empty (`null`) is allowed. */optional?: boolean+ /** Empty (`null`) is allowed and means no limit. */+ unlimited?: booleanstep?: numberunit?: Unit}@@ -39,7 +41,9 @@ export function checkNumber(rule: NumberRule,): FieldIssue | undefined {if (value === null || value === undefined || Number.isNaN(value)) {- return rule.optional ? undefined : { key: 'validation.required' }+ return rule.optional || rule.unlimited+ ? undefined+ : { key: 'validation.required' }}if (!Number.isFinite(value)) return { key: 'validation.number' }if (rule.integer && !Number.isInteger(value)) {