diff --git a/admin/ai_config_template_test.go b/admin/ai_config_template_test.go index 4aaf708..2435f55 100644 --- a/admin/ai_config_template_test.go +++ b/admin/ai_config_template_test.go @@ -15,7 +15,8 @@ func TestAIConfigTemplate_密钥不回显且表单语义完整(t *testing.T) { for _, want := range []string{ `action="/settings/ai/save"`, `action="/settings/ai/secret"`, `action="/settings/ai/test"`, `action="/settings/ai/enable"`, - `type="password"`, `autocomplete="new-password"`, "连接测试", "置信度%", + `type="password"`, `autocomplete="new-password"`, `name="timeout_seconds"`, + `min="1" max="120" value="66"`, "连接测试", "置信度%", } { if !strings.Contains(source, want) { t.Errorf("AI 配置模板缺少 %q", want) diff --git a/admin/service/purchase_spec_resolution.go b/admin/service/purchase_spec_resolution.go index ce70180..f67650b 100644 --- a/admin/service/purchase_spec_resolution.go +++ b/admin/service/purchase_spec_resolution.go @@ -26,7 +26,7 @@ const ( MaxPurchaseSpecResolutionBodyBytes = 64 << 10 PurchaseSpecRulesVersion = "purchase_rules_v1" purchaseSpecSchemaVersion = 1 - purchaseSpecResolutionAITimeout = 30 * time.Second + purchaseSpecResolutionAITimeout = 66 * time.Second ) var ( diff --git a/admin/service/purchase_spec_resolution_test.go b/admin/service/purchase_spec_resolution_test.go index 5f04d33..63cbc67 100644 --- a/admin/service/purchase_spec_resolution_test.go +++ b/admin/service/purchase_spec_resolution_test.go @@ -132,7 +132,7 @@ func (client *stubAIModelClient) Match(ctx context.Context, _ model.AIProviderCo return client.response, client.err } -func TestMatchPurchaseSpecWithRuntimeAI_限制30秒并继承更早取消(t *testing.T) { +func TestMatchPurchaseSpecWithRuntimeAI_限制66秒并继承更早取消(t *testing.T) { req, _, _ := validRuntimeSpecRequest(t, "cg257-timeout", "L码", "M码", "XL码") client := &runtimeDeadlineAIClient{} loader := func(context.Context, *sql.DB, AISecretStore, AIEndpointPolicy) (AIMatchSnapshot, error) { @@ -151,7 +151,7 @@ func TestMatchPurchaseSpecWithRuntimeAI_限制30秒并继承更早取消(t *test t.Fatal("运行时 AI 上下文缺少截止时间") } budget := client.deadline.Sub(startedAt) - if budget < 29*time.Second || budget > purchaseSpecResolutionAITimeout { + if budget < 65*time.Second || budget > purchaseSpecResolutionAITimeout { t.Fatalf("运行时 AI 时间预算=%s,期望不超过 %s", budget, purchaseSpecResolutionAITimeout) } diff --git a/admin/templates/ai/list.html b/admin/templates/ai/list.html index 88d329b..5804572 100644 --- a/admin/templates/ai/list.html +++ b/admin/templates/ai/list.html @@ -11,7 +11,7 @@ - + diff --git a/client/src/http_admin_gateway.py b/client/src/http_admin_gateway.py index f137200..aca4265 100644 --- a/client/src/http_admin_gateway.py +++ b/client/src/http_admin_gateway.py @@ -26,7 +26,7 @@ from .task_models import TaskType DEFAULT_ADMIN_BASE_URL = "https://buy.833729.com" -PURCHASE_SPEC_RESOLUTION_TIMEOUT_SECONDS = 60.0 +PURCHASE_SPEC_RESOLUTION_TIMEOUT_SECONDS = 132.0 class HttpAdminGateway(AdminGateway): diff --git a/client/test/test_http_admin_gateway.py b/client/test/test_http_admin_gateway.py index b9b3ee3..430547e 100644 --- a/client/test/test_http_admin_gateway.py +++ b/client/test/test_http_admin_gateway.py @@ -250,7 +250,7 @@ class HttpAdminGatewayTest(unittest.TestCase): self.assertEqual( opener.timeout, PURCHASE_SPEC_RESOLUTION_TIMEOUT_SECONDS ) - self.assertEqual(PURCHASE_SPEC_RESOLUTION_TIMEOUT_SECONDS, 60.0) + self.assertEqual(PURCHASE_SPEC_RESOLUTION_TIMEOUT_SECONDS, 132.0) def test_resolve_purchase_spec_accepts_all_nonmatched_business_outcomes(self): for outcome in ("uncertain", "rejected", "failed"):