Skip to content

fix: eliminate double-summarization in conversations_to_string (#4655)#4663

Closed
beastoin wants to merge 3 commits intomainfrom
fix/conversations-to-string-double-summary-4655
Closed

fix: eliminate double-summarization in conversations_to_string (#4655)#4663
beastoin wants to merge 3 commits intomainfrom
fix/conversations-to-string-double-summary-4655

Conversation

@beastoin
Copy link
Collaborator

@beastoin beastoin commented Feb 7, 2026

Summary

  • conversations_to_string() previously included both structured.overview AND apps_results[0].content, feeding redundant content to all 12 downstream LLM callers
  • Fix: when apps_results[0] has non-empty content, use it instead of overview — never both
  • Empty/whitespace app results fall back to overview (existing behavior preserved)

Changes

  • backend/models/conversation.py: Prefer app_result as summary, remove duplicate "Summarization:" block
  • backend/tests/unit/test_conversations_to_string.py: 7 unit tests covering selection logic
  • backend/test.sh: Register new test file

Test plan

  • 7 unit tests pass (overview-only, app_result replacement, empty/whitespace fallback, no-double-summary, title-always-present, multiple-app-results)
  • Full backend test suite passes
  • Verify downstream LLM output quality improvement (shorter, non-redundant context)

Closes #4655

🤖 Generated with Claude Code

beastoin and others added 3 commits February 7, 2026 15:20
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>
@beastoin
Copy link
Collaborator Author

beastoin commented Feb 7, 2026

Review: APPROVED

Reviewed the diff for correctness, safety, and test coverage.

Correctness: Fix is clean — when apps_results[0].content is non-empty, it replaces overview (never both). Empty/whitespace falls back to overview. Old "Summarization:" block removed.

Safety: AppResult.content is str (non-optional), so .strip() is safe. Index [0] is guarded by the truthy + len check.

Minor nit (non-blocking): conversation.apps_results and len(conversation.apps_results) > 0 — the len() check is redundant since an empty list is already falsy. Fine to leave for readability.

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 \n after app content; new code adds it consistently. This is actually a fix for downstream formatting.

No issues found. Ship it.


Reviewer: AI for @beastoin

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@beastoin beastoin closed this Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

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:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

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! 💜

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.

Fix double-summarization in conversations_to_string for daily summaries

1 participant