t1201: Fix AI supervisor pipeline 'expected array' parsing errors#1829
t1201: Fix AI supervisor pipeline 'expected array' parsing errors#1829marcusquinn merged 1 commit intomainfrom
Conversation
…rrors (t1201)
- ai-actions.sh: make new_priority required in adjust_priority validation (t1126, t1201)
Previously the field was optional with executor inference from reasoning text.
Tests added in t1126 expected it to be required — this fixes the regression
introduced when t1187 made it optional again. Now: missing new_priority is
rejected with a clear error; invalid values (e.g. 'urgent') are also rejected.
- ai-reason.sh: replace full-prompt retry with simplified JSON-only prompt (t1201)
When the first AI call returns empty or unparseable output, retry with a
stripped-down prompt that explicitly reinforces 'respond with ONLY a JSON array,
no markdown fencing'. This is more likely to recover from model confusion caused
by large context (15KB+) than repeating the same prompt.
- ai-reason.sh: fix single-line array extraction in Try 4 (t1201)
The bracket-based fallback parser (Try 4) failed to extract single-line JSON
arrays like [{...}] embedded in preamble text. Added Try 4a using grep to
find lines starting with [ and parse them directly before the multi-line awk
fallback (Try 4b).
- tests/test-ai-actions.sh: add tests 18 and 19 (t1201)
Test 18: extract_action_plan edge cases (empty, whitespace, fenced, embedded)
Test 19: adjust_priority new_priority required and validated
All 19 tests pass, ShellCheck zero violations.
|
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 |
🔍 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 22:57:21 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Fix AI supervisor pipeline 'expected array' parsing errors.
Changes
ai-actions.sh: Make
new_priorityrequired inadjust_priorityvalidation (t1126, t1201). Previously optional with executor inference — tests from t1126 expected it required. Fixes regression from t1187. Invalid values (e.g. 'urgent') are also rejected.ai-reason.sh: Replace full-prompt retry with simplified JSON-only prompt (t1201). When first AI call returns empty/unparseable output, retry with stripped-down prompt explicitly reinforcing 'respond with ONLY a JSON array, no markdown fencing'.
ai-reason.sh: Fix single-line array extraction in Try 4 (t1201). Bracket-based fallback parser failed to extract single-line JSON arrays like
[{...}]embedded in preamble text. Added Try 4a using grep before multi-line awk fallback.tests/test-ai-actions.sh: Add tests 18 and 19. All 19 tests pass, ShellCheck zero violations.
Root Cause
The 8 consecutive 'expected array, got ' errors (15:53-19:15) were caused by the AI model returning empty responses. The existing retry logic repeated the same 15KB+ prompt that caused the failure. The simplified retry prompt is more likely to recover from model confusion.
Verification
Ref #1821