Skip to content

Commit 3416ed5

Browse files
committed
fix session, try another way to inject CreateBy
1 parent a6c43ba commit 3416ed5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/modules/evaluation/application/experiment_app.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/bytedance/gg/gptr"
13+
loopsession "github.com/coze-dev/coze-loop/backend/infra/middleware/session"
1314

1415
"github.com/coze-dev/coze-loop/backend/infra/backoff"
1516
"github.com/coze-dev/coze-loop/backend/infra/idgen"
@@ -1113,6 +1114,12 @@ func (e *experimentApplication) InsightAnalysisExperiment(ctx context.Context, r
11131114
session = &entity.Session{
11141115
UserID: strconv.FormatInt(gptr.Indirect(req.Session.UserID), 10),
11151116
}
1117+
} else {
1118+
logs.CtxInfo(ctx, "InsightAnalysisExperiment found empty userID, expt_id: %v, workspace_id: %v", req.GetExptID(), req.GetWorkspaceID())
1119+
userId := loopsession.UserIDInCtxOrEmpty(ctx)
1120+
session = &entity.Session{
1121+
UserID: userId,
1122+
}
11161123
}
11171124
got, err := e.manager.Get(ctx, req.GetExptID(), req.GetWorkspaceID(), session)
11181125
if err != nil {

0 commit comments

Comments
 (0)