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:

  1. Increase maxTokens
  2. Fix per-module scaffold fallback
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation