refactor(core): 任务与模型协议治理 - 拆分服务职责并禁止已发起任务取消

This commit is contained in:
ddCat committed 2026-08-22 09:52:09 +08:00
1 parent 7418ddfa9c
commit 633560a5d8
91 files changed
+6380 -4247

No files matched your search

+2 -2
View File
@@ -343,7 +343,7 @@ func (s *Service) TestAdminChannelModel(ctx context.Context, actor *model.User,
testCtx, cancel := context.WithTimeout(ctx, 10*time.Minute)
defer cancel()
testCtx = context.WithValue(testCtx, providerAnalyticsKey{}, providerAnalyticsContext{
Service: s, UserID: actor.ID, ChannelID: channel.ID, Capability: capability,
Service: s, Billing: s.taskBilling(), UserID: actor.ID, ChannelID: channel.ID, Capability: capability,
Operation: "admin_model_test", Model: modelKey, VideoSeconds: videoSecondsValue,
})
testCtx = withProviderOutboundPolicy(testCtx, input.Config)
@@ -363,7 +363,7 @@ func (s *Service) TestAdminChannelModel(ctx context.Context, actor *model.User,
if errors.Is(err, context.DeadlineExceeded) {
status = http.StatusGatewayTimeout
}
return nil, &AuthError{Status: status, Message: "模型测试失败:" + truncateRunes(err.Error(), 1000)}
return nil, WrapAppError(status, "模型测试失败:"+providerUserFacingErrorMessage(err), err)
}
return &AdminChannelModelTestResult{DurationMs: time.Since(startedAt).Milliseconds()}, nil
}