Skip to content

Commit c12acd4

Browse files
author
catlog22
committed
fix(planning-agent): add Prior Analysis fast path to skip CLI execution
When cli-lite-planning-agent receives empty exploration context (from analyze-with-file → lite-plan flow), it previously spent all tool budget on CLI execution (Phase 2) leaving no budget for file writing (Phase 4). Add explicit "Prior Analysis Fast Path" in Execution Flow: when prompt contains "No exploration files", skip Phase 2 and generate plan directly from task description's Prior Analysis block, preserving tool budget for mandatory file output (plan.json + .task/*.json).
1 parent 73cc2ef commit c12acd4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.claude/agents/cli-lite-planning-agent.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,24 @@ const planObject = generatePlanFromSchema(schema, context)
122122

123123
## Execution Flow
124124

125+
**Prior Analysis Fast Path**: When prompt contains "No exploration files" or exploration context is empty, SKIP Phase 2 (CLI execution). Instead, generate plan directly from the task description's `## Prior Analysis` block + schema. This saves tool budget for file writing (Phase 4). Go: Phase 1 → Phase 3 (direct generation) → Phase 4 → Phase 5.
126+
125127
```
126128
Phase 1: Schema & Context Loading
127129
├─ Read schema reference (plan-overview-base-schema or plan-overview-fix-schema)
128130
├─ Aggregate multi-angle context (explorations or diagnoses)
131+
├─ **Check**: Has exploration files?
132+
│ ├─ YES → Continue to Phase 2
133+
│ └─ NO (Prior Analysis) → Skip Phase 2, generate plan directly in Phase 3
129134
└─ Determine output structure from schema
130135
131-
Phase 2: CLI Execution
136+
Phase 2: CLI Execution (SKIP when no explorations)
132137
├─ Construct CLI command with planning template
133138
├─ Execute Gemini (fallback: Qwen → degraded mode)
134139
└─ Timeout: 60 minutes
135140
136141
Phase 3: Parsing & Enhancement
137-
├─ Parse CLI output sections
142+
├─ (Normal) Parse CLI output sections OR (Prior Analysis) Generate tasks directly from task description
138143
├─ Validate and enhance task objects
139144
└─ Infer missing fields from context
140145

0 commit comments

Comments
 (0)