feat(runtime): IM 主人私聊补历史转录(与 Web 主会话同源:抽共享 transcript 包 + OwnerEnvFor 单入口)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

This commit is contained in:
AskaEth committed 2026-10-05 11:36:18 +08:00
1 parent df8fc660c0
commit 9b903a89bc
14 files changed
+676 -181

No files matched your search

@@ -27,15 +27,19 @@ func (p *personaHistory) SessionPersona(_ context.Context, sessionID string) (st
return p.personas[sessionID], nil
}
// envChatter 是一个 Chatter,记录桥接器为该轮解析出的 SessionEnv,
// 角色正是经由它传递(循环从 ctx 读取它)。
// envChatter 是一个 Chatter,记录桥接器为该轮解析出的 SessionEnv(角色正是经由它传递,
// 循环从 ctx 读取它)、目标会话 id 与模型可见的消息列表。
type envChatter struct {
env loop.SessionEnv
got bool
env loop.SessionEnv
got bool
sessionID string
msgs []model.Message
}
func (e *envChatter) Run(ctx context.Context, _ string, _ []model.Message) (*loop.Result, error) {
func (e *envChatter) Run(ctx context.Context, sessionID string, msgs []model.Message) (*loop.Result, error) {
e.env = loop.SessionEnvFrom(ctx)
e.sessionID = sessionID
e.msgs = msgs
e.got = true
return &loop.Result{Text: "在呢"}, nil
}