fix(chat): 用本地任务键判断调研前置,避免越界依赖
chat 不能引用 workflowdef。调研报告只认 research 与 bd_research 两个现用键。
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"chat-agent-system/internal/coordinator"
|
||||
"chat-agent-system/internal/docgov"
|
||||
"chat-agent-system/internal/intent"
|
||||
"chat-agent-system/internal/workflowdef"
|
||||
)
|
||||
|
||||
const stageAdvanceGuidance = "该文档所属阶段尚未激活。请先完成当前阶段并推进后再编制。"
|
||||
@@ -36,9 +35,18 @@ func workflowPrerequisiteHint(userInput string, docs []docgov.WorkflowDocumentSu
|
||||
return researchFirstHint, key
|
||||
}
|
||||
|
||||
func isResearchTaskKey(key string) bool {
|
||||
switch strings.TrimSpace(key) {
|
||||
case "research", "bd_research":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func researchMaterialReady(docs []docgov.WorkflowDocumentSummary) (ready bool, taskKey string) {
|
||||
for _, doc := range docs {
|
||||
if !workflowdef.SameTaskKey(doc.TaskKey, "research") {
|
||||
if !isResearchTaskKey(doc.TaskKey) {
|
||||
continue
|
||||
}
|
||||
taskKey = doc.TaskKey
|
||||
|
||||
Reference in New Issue
Block a user