You've already forked agentic-coding-workflow
bugfix
This commit is contained in:
@@ -112,6 +112,13 @@ type Conversation struct {
|
||||
DeletedAt *time.Time
|
||||
}
|
||||
|
||||
// HasFKMount 报告会话是否挂载了任一 PM/工作区 FK(project/workspace/issue/requirement)。
|
||||
// composeHistory 据此决定是否调用 ContextReader 组装 FK 上下文简报。
|
||||
func (c *Conversation) HasFKMount() bool {
|
||||
return c.ProjectID != nil || c.WorkspaceID != nil ||
|
||||
c.IssueID != nil || c.RequirementID != nil
|
||||
}
|
||||
|
||||
// Attachment 是 message 的附件(user_id 必填,message_id 上传后未关联时为 nil)。
|
||||
type Attachment struct {
|
||||
ID uuid.UUID
|
||||
@@ -169,6 +176,14 @@ type ConversationReader interface {
|
||||
ListConversationsByUser(ctx context.Context, userID uuid.UUID, limit int) ([]Conversation, error)
|
||||
}
|
||||
|
||||
// ContextReader 是 chat 模块对 FK 上下文组装器的窄接口(adapter 在 app.go 实现,
|
||||
// 内部委托 internal/brief.Composer)。给定一个挂载了 project/workspace/issue/requirement
|
||||
// 的会话,返回组装好的 FK 上下文简报;无任何挂载时返回空串。messageService 在
|
||||
// composeHistory 注入它的输出到有效 system prompt。chat 不直接依赖 project/brief。
|
||||
type ContextReader interface {
|
||||
BriefForConversation(ctx context.Context, conv *Conversation) (string, error)
|
||||
}
|
||||
|
||||
// ===== Service 接口(在 service_*.go 实现) =====
|
||||
|
||||
// ConversationService — 会话 CRUD + 标题生成 hook。
|
||||
|
||||
Reference in New Issue
Block a user