fix: 延迟创建 session,只在用户真正对话时才创建
This commit is contained in:
@@ -279,6 +279,11 @@ func runWithStreaming(agentLoop *agent.AgentLoop, input, sessionKey string, temp
|
||||
memoryCfg = internal.GetProjectConfig().Memory
|
||||
if memoryCfg.Enabled {
|
||||
chatCount, saveErr = memory.SaveChat(originalInput, resp, !memory.ShouldSkipSummaryUpdate(originalInput))
|
||||
// 如果需要新 session,提示用户
|
||||
if saveErr == memory.ErrNeedNewSession {
|
||||
fmt.Println("请使用 /new 创建新会话后再对话")
|
||||
saveErr = nil
|
||||
}
|
||||
}
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
|
||||
Reference in New Issue
Block a user