Skip to content

Conversation

@agamm
Copy link
Owner

@agamm agamm commented Aug 11, 2025

Fixes Citation objects not being JSON serializable, which caused truncated output files and application crashes.

Problem: JobResult.to_dict() used asdict() on Citation objects, causing JSON serialization to fail mid-write.

Solution: Replace asdict() with manual dict conversion for citations and citation_mappings.

✅ Complete job output files
✅ No more truncated JSON
✅ All tests pass

agamm added 2 commits August 11, 2025 15:34
- Replace asdict() with manual dict conversion in JobResult.to_dict()
- Fix both citations and citation_mappings serialization
- Resolves TypeError: Object of type Citation is not JSON serializable
- Ensures complete job output files instead of truncated ones
- Tested with comprehensive verification script
- Test specifically verifies the fix for Citation serialization issue
- Covers to_dict() and json.dumps/loads round-trip serialization
- Ensures citation_mappings are properly converted to dicts, not Citation objects
- Prevents regression of truncated JSON file issue
@agamm agamm merged commit 5031649 into main Aug 11, 2025
1 check passed
@agamm agamm deleted the bug/fix-citations-serializable branch August 11, 2025 22:26
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.

2 participants