fix(cli): adapt default stage by role and add scanner error checking

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WeiCHEN
2026-09-08 19:15:34 +08:00
co-authored by Cursor
parent e1864905c8
commit 3d6df3feb7
+10 -2
View File
@@ -619,6 +619,11 @@ func handleChatMode(
}
}
initStage := bizdev.StageV01_Triage
if u.ProjectRole == "reviewer" || u.ProjectRole == "approver" {
initStage = bizdev.StageV05_Feasibility
}
if userCtx == nil {
userCtx = &coordinator.UserProjectContext{
SnapshotID: fmt.Sprintf("ctx_%d", time.Now().UnixNano()),
@@ -631,10 +636,10 @@ func handleChatMode(
IntendedUse: use,
TargetMarket: market,
CurrentWorkflow: "intake",
CurrentStage: bizdev.StageV05_Feasibility,
CurrentStage: initStage,
},
BlackboardFacts: make(map[string]string),
AvailableActions: coordinator.ComputeAvailableActions(bizdev.StageV05_Feasibility, u.ProjectRole),
AvailableActions: coordinator.ComputeAvailableActions(initStage, u.ProjectRole),
}
if u.Role == "reviewer" {
userCtx.InteractiveCard = &intent.InteractiveCardPayload{
@@ -786,6 +791,9 @@ func handleChatMode(
printAdvisorBrief(resp.AdvisorBrief)
}
}
if err := scanner.Err(); err != nil {
fmt.Fprintf(os.Stderr, "控制台读取异常: %v\n", err)
}
}
// -----------------------------------------------------------------------------