- Notifications
You must be signed in to change notification settings - Fork 0
Ensure streaming JSON repair propagates validation errors #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughUpdated strict-mode error handling in JsonRepairProcessor to re-raise ValidationError alongside JSONParsingError. Added a unit test with a raising validation service to assert propagation of ValidationError in strict mode. Changes
Sequence Diagram(s)sequenceDiagram autonumber actor Caller participant Processor as JsonRepairProcessor participant Service as JsonRepairService Caller->>Processor: process_chunk(json_chunk, strict_mode) Processor->>Service: repair_and_validate_json(...) alt Success Service-->>Processor: repaired_json Processor-->>Caller: result else ValidationError Service--x Processor: ValidationError alt strict_mode = True note right of Processor: Re-raise ValidationError (no wrapping) Processor--x Caller: ValidationError else strict_mode = False note right of Processor: Wrap as JSONParsingError Processor--x Caller: JSONParsingError end else Other Exception Service--x Processor: Exception note right of Processor: Log, wrap as JSONParsingError Processor--x Caller: JSONParsingError end Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (2)src/core/services/streaming/json_repair_processor.py (1)
tests/unit/json_repair_processor_test.py (3)
🪛 Ruff (0.13.3)tests/unit/json_repair_processor_test.py30-30: Unused method argument: (ARG002) 31-31: Unused method argument: (ARG002) 32-32: Unused method argument: (ARG002) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (5)
Comment |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ec26ffb7448333ace9a74c4ba180a1
Summary by CodeRabbit
Bug Fixes
Tests