MCPcopy Create free account
hub / github.com/diillson/chatcli / ShouldPlanFirst

Function ShouldPlanFirst

cli/agent/quality/plan_complexity.go:113–122  ·  view source on GitHub ↗

ShouldPlanFirst decides whether the orchestrator should synthesize a structured plan before dispatching, given the user-configured mode and the live task complexity. - "off" → never - "always" → always - "auto" → ComplexityScore(task) >= cfg.ComplexityThreshold Unknown modes fall through to "

(cfg PlanFirstConfig, task string)

Source from the content-addressed store, hash-verified

111// Unknown modes fall through to "auto" so a misconfigured env doesn't
112// silently disable planning.
113func ShouldPlanFirst(cfg PlanFirstConfig, task string) bool {
114 switch strings.ToLower(strings.TrimSpace(cfg.Mode)) {
115 case "off":
116 return false
117 case "always":
118 return true
119 default: // "auto" or unknown → conservative auto behavior
120 return ComplexityScore(task) >= cfg.ComplexityThreshold
121 }
122}
123
124// countDistinctVerbs counts unique action verbs in lower (already
125// lower-cased), up to cap. Word boundaries are enforced via Fields,

Callers 2

TestShouldPlanFirstFunction · 0.85

Calls 1

ComplexityScoreFunction · 0.85

Tested by 1

TestShouldPlanFirstFunction · 0.68