feat: Enhance issue loading with intelligent grouping for batch processing

This commit is contained in:
catlog22
2026-01-23 17:03:27 +08:00
parent 61e3747768
commit f363c635f5

View File

@@ -55,11 +55,11 @@ Unified planning command using **issue-plan-agent** that combines exploration an
## Execution Process ## Execution Process
``` ```
Phase 1: Issue Loading Phase 1: Issue Loading & Intelligent Grouping
├─ Parse input (single, comma-separated, or --all-pending) ├─ Parse input (single, comma-separated, or --all-pending)
├─ Fetch issue metadata (ID, title, tags) ├─ Fetch issue metadata (ID, title, tags)
├─ Validate issues exist (create if needed) ├─ Validate issues exist (create if needed)
└─ Create batches by size (max 3 per batch by default) └─ Intelligent grouping via Gemini (semantic similarity, max 3 per batch)
Phase 2: Unified Explore + Plan (issue-plan-agent) Phase 2: Unified Explore + Plan (issue-plan-agent)
├─ Launch issue-plan-agent per batch ├─ Launch issue-plan-agent per batch
@@ -119,17 +119,11 @@ if (useAllPending) {
} }
// Note: Agent fetches full issue content via `ccw issue status <id> --json` // Note: Agent fetches full issue content via `ccw issue status <id> --json`
// Simple size-based batching (max batchSize issues per group) // Intelligent grouping: Analyze issues by title/tags, group semantically similar ones
function createBatches(issues, batchSize) { // Strategy: Same module/component, related bugs, feature clusters
const batches = []; // Constraint: Max ${batchSize} issues per batch
for (let i = 0; i < issues.length; i += batchSize) {
batches.push(issues.slice(i, i + batchSize));
}
return batches;
}
const batches = createBatches(issues, batchSize); console.log(`Processing ${issues.length} issues in ${batches.length} batch(es)`);
console.log(`Processing ${issues.length} issues in ${batches.length} batch(es) (max ${batchSize} issues/agent)`);
TodoWrite({ TodoWrite({
todos: batches.map((_, i) => ({ todos: batches.map((_, i) => ({