fix: correct token calculation error caused by ctxcache init (#559)

This commit is contained in:
lvxinyu-1117
2025-08-05 11:26:51 +08:00
committed by GitHub
parent f02c08c58b
commit 5dafd81a3f
4 changed files with 35 additions and 9 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/cloudwego/eino/compose"
"gorm.io/gorm"
"github.com/cloudwego/eino/callbacks"
"github.com/coze-dev/coze-studio/backend/application/internal"
wfdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/database"
wfknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/knowledge"
@@ -43,6 +44,7 @@ import (
crosssearch "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/search"
crossvariable "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/variable"
"github.com/coze-dev/coze-studio/backend/domain/workflow/service"
workflowservice "github.com/coze-dev/coze-studio/backend/domain/workflow/service"
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
"github.com/coze-dev/coze-studio/backend/infra/contract/coderunner"
"github.com/coze-dev/coze-studio/backend/infra/contract/idgen"
@@ -89,6 +91,7 @@ func InitService(ctx context.Context, components *ServiceComponents) (*Applicati
crossmodel.SetManager(wfmodel.NewModelManager(components.ModelManager, nil))
crosscode.SetCodeRunner(components.CodeRunner)
crosssearch.SetNotifier(wfsearch.NewNotify(components.DomainNotifier))
callbacks.AppendGlobalHandlers(workflowservice.GetTokenCallbackHandler())
SVC.DomainSVC = workflowDomainSVC
SVC.ImageX = components.ImageX