Skip to content

Comments

t1184: Harden AI pipeline JSON parser against whitespace responses and improve failure logging#1797

Merged
marcusquinn merged 1 commit intomainfrom
feature/t1184
Feb 18, 2026
Merged

t1184: Harden AI pipeline JSON parser against whitespace responses and improve failure logging#1797
marcusquinn merged 1 commit intomainfrom
feature/t1184

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Adds whitespace-only response check in extract_action_plan (model returning only newlines/spaces now treated as empty)
  • Fixes Try 3 (generic code block extraction) to verify extracted content is a JSON array before returning
  • Fixes Try 4 (bracket extraction) to handle indented arrays and verify array type
  • Logs full raw LLM response to reason log on parse failure (previously only first/last 100 bytes)
  • Improves expected array error message to include JSON type and content preview
  • Adds whitespace-only check in run_ai_actions_pipeline (belt-and-suspenders)

Root Cause Analysis

The 7+ consecutive expected array, got errors from 15:53-19:15 on 2026-02-18 had two root causes:

  1. JSON parsing failure (3 runs): extract_action_plan failed 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)
  2. Concurrency guard empty output (4+ runs): Two pulse cycles overlapping caused the concurrency guard to return empty stdout — fixed by t1157 (t1157: fix rc=1 pipeline errors from concurrent supervisor pulse cycles #1781)

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 attempts
  • extract_action_plan Try 3: verify extracted content is JSON array (not just valid JSON)
  • extract_action_plan Try 4: handle indented arrays, verify array type
  • run_ai_reasoning: log full raw response on parse failure + warning with byte count

ai-actions.sh

  • run_ai_actions_pipeline: whitespace-only check alongside empty check
  • run_ai_actions_pipeline: improve error message with type and content preview

Ref #1789

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1184

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…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
@marcusquinn marcusquinn merged commit c337e87 into main Feb 18, 2026
8 of 10 checks passed
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 26 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Feb 18 21:44:43 UTC 2026: Code review monitoring started
Wed Feb 18 21:44:44 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 26

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 26
  • VULNERABILITIES: 0

Generated on: Wed Feb 18 21:44:46 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant