mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-03 15:43:11 +08:00
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).
This commit is contained in:
@@ -122,19 +122,24 @@ const planObject = generatePlanFromSchema(schema, context)
|
|||||||
|
|
||||||
## Execution Flow
|
## Execution Flow
|
||||||
|
|
||||||
|
**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.
|
||||||
|
|
||||||
```
|
```
|
||||||
Phase 1: Schema & Context Loading
|
Phase 1: Schema & Context Loading
|
||||||
├─ Read schema reference (plan-overview-base-schema or plan-overview-fix-schema)
|
├─ Read schema reference (plan-overview-base-schema or plan-overview-fix-schema)
|
||||||
├─ Aggregate multi-angle context (explorations or diagnoses)
|
├─ Aggregate multi-angle context (explorations or diagnoses)
|
||||||
|
├─ **Check**: Has exploration files?
|
||||||
|
│ ├─ YES → Continue to Phase 2
|
||||||
|
│ └─ NO (Prior Analysis) → Skip Phase 2, generate plan directly in Phase 3
|
||||||
└─ Determine output structure from schema
|
└─ Determine output structure from schema
|
||||||
|
|
||||||
Phase 2: CLI Execution
|
Phase 2: CLI Execution (SKIP when no explorations)
|
||||||
├─ Construct CLI command with planning template
|
├─ Construct CLI command with planning template
|
||||||
├─ Execute Gemini (fallback: Qwen → degraded mode)
|
├─ Execute Gemini (fallback: Qwen → degraded mode)
|
||||||
└─ Timeout: 60 minutes
|
└─ Timeout: 60 minutes
|
||||||
|
|
||||||
Phase 3: Parsing & Enhancement
|
Phase 3: Parsing & Enhancement
|
||||||
├─ Parse CLI output sections
|
├─ (Normal) Parse CLI output sections OR (Prior Analysis) Generate tasks directly from task description
|
||||||
├─ Validate and enhance task objects
|
├─ Validate and enhance task objects
|
||||||
└─ Infer missing fields from context
|
└─ Infer missing fields from context
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user