From a6f1be8f07bd8b7f025ef681df1c61e3988da905 Mon Sep 17 00:00:00 2001 From: wangbo Date: Fri, 29 May 2026 20:22:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=BB=98=E8=AE=A4=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=AD=96=E7=95=A5=E4=B8=8D=E9=99=90=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/migrations/0012_runtime_policy_sets.sql | 4 ++-- apps/api/migrations/0026_runner_policies.sql | 2 +- .../api/migrations/0043_default_runtime_policy_unlimited.sql | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 apps/api/migrations/0043_default_runtime_policy_unlimited.sql diff --git a/apps/api/migrations/0012_runtime_policy_sets.sql b/apps/api/migrations/0012_runtime_policy_sets.sql index 9d01664..afaed12 100644 --- a/apps/api/migrations/0012_runtime_policy_sets.sql +++ b/apps/api/migrations/0012_runtime_policy_sets.sql @@ -19,8 +19,8 @@ INSERT INTO model_runtime_policy_sets ( VALUES ( 'default-runtime-v1', '默认运行策略', - '默认包含 TPM/RPM/并发、失败重试、自动禁用和优先级降级关键词。', - '{"rules":[{"metric":"rpm","limit":120,"windowSeconds":60},{"metric":"tpm_total","limit":240000,"windowSeconds":60},{"metric":"concurrent","limit":6,"leaseTtlSeconds":120}]}'::jsonb, + '默认 TPM/RPM/并发均不限制,仅保留失败重试、自动禁用和优先级降级策略。', + '{"rules":[]}'::jsonb, '{"enabled":true,"maxAttempts":2,"allowKeywords":["rate_limit","timeout","server_error","network","429","5xx"],"denyKeywords":["invalid_api_key","insufficient_quota","billing_not_active","permission_denied"]}'::jsonb, '{"enabled":false,"threshold":3,"windowSeconds":300,"keywords":["invalid_api_key","account_deactivated","permission_denied","billing_not_active"]}'::jsonb, '{"enabled":true,"cooldownSeconds":300,"keywords":["rate_limit","quota","timeout","temporarily_unavailable","overloaded"]}'::jsonb, diff --git a/apps/api/migrations/0026_runner_policies.sql b/apps/api/migrations/0026_runner_policies.sql index 11fd9a2..3be3623 100644 --- a/apps/api/migrations/0026_runner_policies.sql +++ b/apps/api/migrations/0026_runner_policies.sql @@ -67,6 +67,6 @@ SET name = EXCLUDED.name, updated_at = now(); UPDATE model_runtime_policy_sets -SET description = '默认包含 TPM/RPM/并发、平台内调用重试、自动禁用和优先级降级关键词。' +SET description = '默认 TPM/RPM/并发均不限制,仅保留平台内调用重试、自动禁用和优先级降级策略。' WHERE policy_key = 'default-runtime-v1' AND description = '默认包含 TPM/RPM/并发、失败重试、自动禁用和优先级降级关键词。'; diff --git a/apps/api/migrations/0043_default_runtime_policy_unlimited.sql b/apps/api/migrations/0043_default_runtime_policy_unlimited.sql new file mode 100644 index 0000000..f2db538 --- /dev/null +++ b/apps/api/migrations/0043_default_runtime_policy_unlimited.sql @@ -0,0 +1,5 @@ +UPDATE model_runtime_policy_sets +SET rate_limit_policy = '{"rules":[]}'::jsonb, + description = '默认 TPM/RPM/并发均不限制,仅保留失败重试、自动禁用和优先级降级策略。', + updated_at = now() +WHERE policy_key = 'default-runtime-v1';