Skip to content

fix: adapt _safe_repair_json to json-repair 0.60 semantics#6613

Merged
theCyberTech merged 1 commit into
fix/vulnerability-scan-updatesfrom
fix/json-repair-0.60-compat
Jul 22, 2026
Merged

fix: adapt _safe_repair_json to json-repair 0.60 semantics#6613
theCyberTech merged 1 commit into
fix/vulnerability-scan-updatesfrom
fix/json-repair-0.60-compat

Conversation

@theCyberTech

Copy link
Copy Markdown
Member

Summary

Stacked on #6612 (json-repair 0.60.1 bump).

json-repair 0.60.x changed how it handles non-JSON input:

  • plain text now repairs to '' (previously '""'/'{}' sentinels)
  • brace-enclosed junk like {temperature in SF} now repairs to a single-element list ["temperature in SF}"]

Both cases broke _safe_repair_json's unrepairable-detection in lib/crewai/src/crewai/agents/parser.py, mangling plain-text tool inputs. This treats empty results and list results (for non-array input) as unrepairable, preserving the original input.

Tests

  • test_crew_agent_parser.py (15 previously failing) and test_tool_usage.py now pass.
  • Remaining local failures are environmental only (missing optional extras: litellm, anthropic, google-genai, a2a) and unrelated to this change.

json-repair >= 0.60 returns an empty string for plain-text input and
wraps brace-enclosed junk in a single-element list instead of the old
""/{} sentinel values. Treat both as unrepairable so the original
tool input is preserved.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ab7c2e4-60dc-4682-a81e-26058d4f3865

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/json-repair-0.60-compat

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.

@theCyberTech
theCyberTech merged commit 9543340 into fix/vulnerability-scan-updates Jul 22, 2026
41 of 47 checks passed
@theCyberTech
theCyberTech deleted the fix/json-repair-0.60-compat branch July 22, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant