Bugfix: Why did 2/5 modules consistently fail LLM extraction and fal...
Documentation for Sessions
🐛 Bugfix: Why did 2/5 modules consistently fail LLM extraction and fal...
Date: 2026-02-25
Time: 14:47:35 UTC
Session: gspace1-138.8
Agent: architecture
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why did 2/5 modules consistently fail LLM extraction and fall to scaffold?
Task: Fix LLM extraction failure for 2/5 modules
🎯 Decision Made
Chosen:
Fix per-module scaffold fallback (root cause was all-or-nothing logic)
Options Considered:
- Increase maxTokens
- Fix per-module scaffold fallback
- Both: increase tokens AND add per-module fallback
💭 Reasoning
The DEPLOY phase checked executeOutput.files globally — if LLM produced files for 3/5 modules, the scaffold fallback never triggered because the array wasn't empty. The 2 failed modules silently got nothing. Fixed by checking per-module file coverage: if a module has no files in the LLM output, scaffold ONLY that module. Additionally: maxTokens was already increased to 32768 in S138.19, extractCodeFiles() brace-depth parsing was already fixed, and parseLlmJson() fence-stripping was already fixed. The per-module fallback was the missing piece.
📁 Files Involved
apis/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.ts
🔗 Related
- Decision ID:
dev_1772030855589_vh2dw9u - Session: 138
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation