Hotfix for AI plan summary failing with "Summariser failed: model response was not JSON" on real production plans. The underlying cause was Bedrock cutting the JSON response short because the default max_output_tokens=1024 was undersized for any plan touching more than a handful of resources.
Bug Fixes
- Detect truncation explicitly — when the model stops on
finish_reason=length, the summariser now raises a clear "raiseai_summary.max_output_tokens" error that surfaces in the run UI, instead of the misleading "model response was not JSON". - Fence-aware JSON parser — handles
\``json ... ```` responses (and the same with trailing prose) cleanly. The previous balanced-brace fallback would slurp chatter into the parse. - Diagnostic snippet on parse failure — logs
finish_reason, response length, and a head+tail snippet of the actual model response so future failures are diagnosable from API pod logs without re-running. - Bump default
max_output_tokens1024 → 16384 — the cap is an upper bound, not a target; the model only emits what it needs. 16384 covers very large plans (100+ resource changes with detailed risk listings) while staying well under Opus's 32K output limit.
Status
Stable — fixes a regression on the v0.30.x AI summary feature. Deployments running v0.30.0–v0.30.2 with ai_summary.enabled=true should upgrade.
Full Changelog: v0.30.2...v0.30.3