t1184: Harden AI pipeline JSON parser against whitespace responses and improve failure logging#1797
t1184: Harden AI pipeline JSON parser against whitespace responses and improve failure logging#1797marcusquinn merged 1 commit intomainfrom
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…improve failure logging (t1184) - extract_action_plan: add whitespace-only response check (model returning only newlines/spaces now treated as empty, not a parse failure) - extract_action_plan Try 3: verify extracted generic code block is a JSON array before returning (prevents returning non-JSON content when outer fences wrap the response) - extract_action_plan Try 4: handle indented arrays (not just column-0 brackets) and verify extracted content is a JSON array - run_ai_reasoning: log full raw LLM response to reason log on parse failure (previously only first/last 100 bytes; now full response + expanded to 200 bytes for diagnostics) so intermittent failures can be fully diagnosed - run_ai_reasoning: log warning with response length and json block count when parse fails, making failures visible in supervisor log without reading log file - run_ai_actions_pipeline: add whitespace-only check alongside empty check (belt-and-suspenders against whitespace-only output from reasoning) - run_ai_actions_pipeline: improve 'expected array' error message to include JSON type and first 100 chars of content for faster diagnosis Root causes of the 15:53-19:15 errors were already fixed by t1157 (concurrency guard) and t1123 (multi-block parser). This PR adds defensive hardening and better observability for any future parse failures. ref:GH#1789
bd16844 to
1d979c7
Compare
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Feb 18 21:44:46 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
extract_action_plan(model returning only newlines/spaces now treated as empty)expected arrayerror message to include JSON type and content previewrun_ai_actions_pipeline(belt-and-suspenders)Root Cause Analysis
The 7+ consecutive
expected array, goterrors from 15:53-19:15 on 2026-02-18 had two root causes:extract_action_planfailed to parse valid responses — fixed by t1123 (multi-block parser, t1123: Fix JSON parser — handle multiple code blocks and unclosed blocks #1675) and cc28d02 (Try 5 file-based extraction, feat: supervisor self-healing for stuck tasks, dispatch stalls, and action robustness #1683)This PR adds defensive hardening for edge cases not covered by the previous fixes, and better observability so future parse failures can be diagnosed from logs without guessing.
Changes
ai-reason.sh
extract_action_plan: whitespace-only check before parsing attemptsextract_action_planTry 3: verify extracted content is JSON array (not just valid JSON)extract_action_planTry 4: handle indented arrays, verify array typerun_ai_reasoning: log full raw response on parse failure + warning with byte countai-actions.sh
run_ai_actions_pipeline: whitespace-only check alongside empty checkrun_ai_actions_pipeline: improve error message with type and content previewRef #1789