fix(cli): adapt default stage by role and add scanner error checking
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-2
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user