fix(grouping): skip LLM grouping for large changesets (>100 files)

- Add early bailout when changed_files > 100 to prevent context overflow
- Prevents "request exceeds available context size" errors in Ministral-14B (4096 tokens)
- Falls back to single-group strategy for massive changesets
- Fixes "All commit groups failed" for repos with thousands of changed files

Resolves failures in @egirl/egirl-platform (10,042 changed files)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Lilith 2026-01-10 23:38:38 -08:00
parent 7349aa2bea
commit 7f9d9c0e65
2 changed files with 8 additions and 0 deletions

View file

@ -65,6 +65,14 @@ class FileGroupingStrategy:
logger.debug(f"Only {len(changed_files)} files, skipping grouping")
return self._fallback_single_group(changed_files, diff)
# If too many files, skip LLM grouping to avoid context overflow
# Context size for Ministral-14B is 4096 tokens, ~100 files is safe limit
if len(changed_files) > 100:
logger.warning(
f"Too many files ({len(changed_files)} > 100), skipping LLM grouping to avoid context overflow"
)
return self._fallback_single_group(changed_files, diff)
try:
# Get grouping from Mistral 3 14B
logger.info(f"Grouping {len(changed_files)} files with Mistral 3 14B for {repo.name}")