From 4a5fa8aa3b2e6615cf48b5d3ff6404de68b48e30 Mon Sep 17 00:00:00 2001 From: xiezhouwei Date: Sun, 21 Jun 2026 17:26:14 +0800 Subject: [PATCH] debug: add diagnostic logging to getOrCreateVendor and initDefaultVendorMapping for seedance/minimax --- model/pricing_default.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/pricing_default.go b/model/pricing_default.go index f5cf5f1..d40c10c 100644 --- a/model/pricing_default.go +++ b/model/pricing_default.go @@ -1,7 +1,10 @@ package model import ( + "fmt" "strings" + + "github.com/QuantumNous/new-api/common" ) // 简化的供应商映射规则 @@ -93,6 +96,9 @@ func initDefaultVendorMapping(metaMap map[string]*Model, vendorMap map[int]*Vend if vendorID == 0 { // 仍未匹配到供应商 → 跳过(不给未匹配的模型写入 vendor_id=0 覆盖已有记录) + if strings.Contains(modelLower, "seedance") || strings.Contains(modelLower, "minimax") { + common.SysLog(fmt.Sprintf("initDefaultVendorMapping: model %q matched pattern but vendorID=0 (getOrCreateVendor failed)", modelName)) + } continue } @@ -127,9 +133,11 @@ func getOrCreateVendor(vendorName string, vendorMap map[int]*Vendor) int { } if err := newVendor.Insert(); err != nil { + common.SysLog(fmt.Sprintf("getOrCreateVendor: insert vendor %q failed: %v", vendorName, err)) return 0 } + common.SysLog(fmt.Sprintf("getOrCreateVendor: created new vendor %q with id=%d", vendorName, newVendor.Id)) vendorMap[newVendor.Id] = newVendor return newVendor.Id }