Architecture: Which model to use for code generation in the module generat...
Documentation for Sessions
🏗️ Architecture: Which model to use for code generation in the module generat...
Date: 2026-02-24
Time: 18:41:30 UTC
Session: gspace1-138.17
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Which model to use for code generation in the module generation pipeline?
Task: Upgrade AI models to Sonnet 4.6 / Opus 4.6 for generation pipeline
🎯 Decision Made
Chosen:
Sonnet 4.6 (claude-sonnet-4-6). Also upgraded default to Sonnet 4.6 and reasoning/maxQuality to Opus 4.6 across the entire AI config. Increased per-module code gen timeout from 90s to 180s. Added per-module error boundary so single-module failure doesn't kill the pipeline.
Options Considered:
- Haiku 4.5 (fast but 8K output cap, files: null)
- Sonnet 4 old (May 2025, crashed backend in Test 7)
- Sonnet 4.5 (Sep 2025, not tested)
- Sonnet 4.6 (Feb 17 2026, latest, 1M context, improved coding)
💭 Reasoning
Haiku 4.5 has an 8K output token cap — 14+ Angular files per module easily exceeds this, causing truncated JSON that parseLlmJson can't repair. Old Sonnet 4 (May 2025) crashed the backend in Test 7 (though root cause may be coincidental, not model-related — memory was only 133MB at restart). Sonnet 4.6 was released Feb 17 2026 with significant improvements in coding, agent planning, and 1M token context. Same price as Sonnet 4 ($3/$15 per 1M). No reason not to use the latest.
📁 Files Involved
libs/libs-api/backend-core/src/lib/config/ai-models.config.tsapis/backend-vitto-api/src/app/module-generation/phases/execute.phase.ts
🔗 Related
- Decision ID:
dev_1771958490683_0kcysy4 - Session: 138
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation