fix: eliminate double-summarization in conversations_to_string (#4655)#4663
fix: eliminate double-summarization in conversations_to_string (#4655)#4663
Conversation
When apps_results[0] has non-empty content, use it as the summary instead of structured.overview, preventing duplicate content from being fed to downstream LLM calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…4655) 7 tests covering: overview-only, app_result replacement, empty/whitespace fallback, no-double-summary assertion, title always present, and multiple app_results uses-first behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Review: APPROVED Reviewed the diff for correctness, safety, and test coverage. Correctness: Fix is clean — when Safety: Minor nit (non-blocking): Tests: 7 tests cover all branches (overview-only, app_result replacement, empty fallback, whitespace fallback, no-double-summary, title-always-present, multiple-app-results). Good coverage. One subtle improvement: Old code omitted No issues found. Ship it. Reviewer: AI for @beastoin |
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the issue of double summarization in conversations_to_string. The change correctly prioritizes the apps_results summary over the structured.overview, with a proper fallback mechanism for empty or missing app summaries. The implementation is clean and is supported by a thorough new test suite that covers all relevant edge cases. The changes improve data quality for downstream consumers by removing redundant information. Overall, this is a high-quality contribution, and I did not find any high or critical severity issues.
|
Hey @beastoin 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
conversations_to_string()previously included bothstructured.overviewANDapps_results[0].content, feeding redundant content to all 12 downstream LLM callersapps_results[0]has non-empty content, use it instead of overview — never bothChanges
backend/models/conversation.py: Prefer app_result as summary, remove duplicate "Summarization:" blockbackend/tests/unit/test_conversations_to_string.py: 7 unit tests covering selection logicbackend/test.sh: Register new test fileTest plan
Closes #4655
🤖 Generated with Claude Code