Repository navigation
fix(conversations): keep filler and unsettled fragments off Home - #24403
Conversation
The short-clip floor returned a kept row before the relevance rules ran, so a 1s "Thank you" stood up as its own Home row. Occasion retention also ran ahead of the rules. Text the rules prove content-free now discards on both paths, outranked only by keep triggers, user curation and calendar overlap. Short batch-owned rows now wait off Home until batch text lands, for at most 2 hours, and the episode list also hides rows with a stored below-floor decision. The backfill can re-judge floor and occasion keeps; dry run stays the default. Katakana acknowledgements join the CJK filler list. Failure-Class: FC-rule-discard-left-visible Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
5 issues found across 15 files
Confidence score: 3/5
fragment_visibility.pycan show a short batch-live capture after a long socket, and mixed naive/aware timestamps can make Home reads return 500. Use the canonical UTC-normalized conversation duration.relevance_rules.pycan discard substantive Katakana words likeハエandエアas filler. Match exact filler sequences with a separate Katakana lexicon.conversations.pycounts settling rows that the list hides, so conversation, search, and folder counts can overstate what users see. Apply the hidden-row calculation to those counts.relevance_io.pycan treat a detected wake-word invocation in a short clip as filler because it hard-codestrusted_wake_word=False. Pass whether a wake word was found.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/utils/conversations/relevance_rules.py">
<violation number="1" location="backend/utils/conversations/relevance_rules.py:119">
P2: This character-level expansion discards substantive Katakana words such as `ハエ` and `エア`, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.</violation>
</file>
<file name="backend/database/conversations.py">
<violation number="1" location="backend/database/conversations.py:886">
P2: Default conversation counts include settling rows that the list now hides, so `/v1/conversations/count` and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.</violation>
</file>
<file name="backend/scripts/conversation_relevance_backfill.py">
<violation number="1" location="backend/scripts/conversation_relevance_backfill.py:103">
P2: This guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-`None` decision to be a mapping with `verdict == 'keep'` before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.</violation>
</file>
<file name="backend/utils/conversations/fragment_visibility.py">
<violation number="1" location="backend/utils/conversations/fragment_visibility.py:173">
P1: This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.</violation>
</file>
<file name="backend/utils/conversations/relevance_io.py">
<violation number="1" location="backend/utils/conversations/relevance_io.py:220">
P2: This hard-codes `trusted_wake_word=False`, so a short clip admitted by `quiet_minimum` can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass `bool(find_wake_word_matches(segments))` here.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| return False | ||
| structured = data.get('structured') | ||
| server_minimum = isinstance(structured, Mapping) and structured.get('title_provenance') == 'server_minimum' | ||
| return server_minimum or (finished - started).total_seconds() < SETTLING_ROW_MAX_SECONDS |
There was a problem hiding this comment.
P1: This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/utils/conversations/fragment_visibility.py, line 173:
<comment>This raw wall-window calculation can show a short batch-live capture after a long socket, and mixed naive/aware timestamps can turn a Home read into a 500. Use the canonical UTC-normalized conversation duration or an equivalent capture-span value for the settling threshold.</comment>
<file context>
@@ -129,3 +141,33 @@ def is_low_signal_sync_fragment(data: Mapping[str, Any] | None) -> bool:
+ return False
+ structured = data.get('structured')
+ server_minimum = isinstance(structured, Mapping) and structured.get('title_provenance') == 'server_minimum'
+ return server_minimum or (finished - started).total_seconds() < SETTLING_ROW_MAX_SECONDS
</file context>
| # characters are all in this set is a backchannel ("嗯嗯", "好的", "对对对"). | ||
| CJK_FILLER_CHARS: FrozenSet[str] = frozenset( | ||
| '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね' | ||
| '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね' 'ハイエウンアソネ' |
There was a problem hiding this comment.
P2: This character-level expansion discards substantive Katakana words such as ハエ and エア, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/utils/conversations/relevance_rules.py, line 119:
<comment>This character-level expansion discards substantive Katakana words such as `ハエ` and `エア`, not just acknowledgements. Match exact filler sequences with a separate Katakana lexicon instead of treating each added code point as filler.</comment>
<file context>
@@ -116,7 +116,7 @@
# characters are all in this set is a backchannel ("嗯嗯", "好的", "对对对").
CJK_FILLER_CHARS: FrozenSet[str] = frozenset(
- '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね'
+ '嗯啊哦噢喔呃额恩唉哎诶欸嘿喂哈呵呀吧嘛呢啦了的对好是行' 'はいええうんあそうね' 'ハイエウンアソネ'
)
</file context>
| if ( | ||
| conversation.get('dream_duplicate_of') | ||
| or bridge_pending.hidden(conversation) | ||
| or is_settling_fragment(conversation) |
There was a problem hiding this comment.
P2: Default conversation counts include settling rows that the list now hides, so /v1/conversations/count and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/database/conversations.py, line 886:
<comment>Default conversation counts include settling rows that the list now hides, so `/v1/conversations/count` and search/folder counts overstate visible conversations. Extend the count’s hidden-row calculation to apply the same settling predicate.</comment>
<file context>
@@ -882,6 +883,7 @@ def is_visible_conversation(conversation: Optional[Mapping[str, Any]], *, includ
if (
conversation.get('dream_duplicate_of')
or bridge_pending.hidden(conversation)
+ or is_settling_fragment(conversation)
or conversation.get('discarded')
or is_completed_rule_discard(conversation)
</file context>
| if is_user_curated(conversation): | ||
| return None | ||
| decision = conversation.get('relevance_decision') | ||
| if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS): |
There was a problem hiding this comment.
P2: This guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-None decision to be a mapping with verdict == 'keep' before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/scripts/conversation_relevance_backfill.py, line 103:
<comment>This guard can rejudge a present-but-invalid or non-keep relevance receipt. Require a non-`None` decision to be a mapping with `verdict == 'keep'` before allowing these keep reasons through; otherwise the backfill can hide rows whose stored receipt is malformed or contradictory.</comment>
<file context>
@@ -93,7 +97,10 @@ def verdict_for(conversation: Mapping[str, Any]) -> Optional[str]:
+ if is_user_curated(conversation):
+ return None
+ decision = conversation.get('relevance_decision')
+ if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS):
return None
if _has_calendar_evidence(conversation):
</file context>
| if decision and not (isinstance(decision, Mapping) and decision.get('reason') in REJUDGED_KEEP_REASONS): | |
| if decision is not None and not ( | |
| isinstance(decision, Mapping) | |
| and decision.get('verdict') == 'keep' | |
| and decision.get('reason') in REJUDGED_KEEP_REASONS | |
| ): |
| return keep | ||
| segments = getattr(conversation, 'transcript_segments', None) or [] | ||
| texts = [segment.text for segment in segments] or [getattr(conversation, 'text', None) or ''] | ||
| rule = content_free_rule(texts, has_photos=False, trusted_wake_word=False) |
There was a problem hiding this comment.
P2: This hard-codes trusted_wake_word=False, so a short clip admitted by quiet_minimum can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass bool(find_wake_word_matches(segments)) here.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/utils/conversations/relevance_io.py, line 220:
<comment>This hard-codes `trusted_wake_word=False`, so a short clip admitted by `quiet_minimum` can discard a detected wake-word invocation as filler before the normal wake-word/model protection runs. Pass `bool(find_wake_word_matches(segments))` here.</comment>
<file context>
@@ -204,6 +205,26 @@ def rules_only_relevance(
+ return keep
+ segments = getattr(conversation, 'transcript_segments', None) or []
+ texts = [segment.text for segment in segments] or [getattr(conversation, 'text', None) or '']
+ rule = content_free_rule(texts, has_photos=False, trusted_wake_word=False)
+ if not rule or calendar_retains(
+ uid, getattr(conversation, 'started_at', None), getattr(conversation, 'finished_at', None)
</file context>
| rule = content_free_rule(texts, has_photos=False, trusted_wake_word=False) | |
| rule = content_free_rule( | |
| texts, has_photos=False, trusted_wake_word=bool(find_wake_word_matches(segments)) | |
| ) |
…ler rules Hide live episodes whose only rows are still settling, keep starred and foldered short clips through finalize, and narrow the katakana filler set to laughter and "hai" so names such as アイ stay out of the rules' discard. Failure-Class: FC-rule-discard-left-visible Co-Authored-By: Claude Opus 5.5 <[email protected]>
Requested by David
What changed and why
David's Home showed three 1s "Thank you" rows for about 12 hours, plus "Yeah." (5m44s), "I don't know" (2m12s) and "ハハハハ" fragments that later vanished. David asked that users never see these rows.
quiet_minimumreturned a kept row before relevance ran. Text the rules prove content-free (filler_only,no_content_words,mic_check) now discards on that path. User curation, keep triggers such as first open, and calendar overlap still keep it.c3863b3e9203a, on content-free text only; any text with content still stays until absorption.CJK_FILLER_CHARShad hiraganaはonly.ハandイare added, soハハハハandハイare filler whileアイstill goes to the model.RULES_VERSIONmoves to 2.finished_at. It's presentation only: nothing is stored. A live episode whose only rows are settling stays off/v1/episodes/livetoo. It uses the existingHOME_HIDE_BELOW_FLOOR_ROWSkill switch.record_audio_closedis deliberately not a release signal, because the live text is still provisional then.summary_blocked_reason.conversation_relevance_backfill.pycan re-judge floor and occasion keeps. Dry run stays the default and nothing has been applied.The upload half of the report needs no change here: reading the code, the open row and the "processing on Omi" label behave as designed, and held-audio release belongs to #24382.
Product invariants affected
How it was verified
Repo
BasedHardware/omi,lane/offlinesync-noise. Layer measured: unit tests only.pytestfile by file over 24 affected test files, Google credentials stripped: all passed. This includes the relevance, short-clip, occasion, recovery, episode Home, sync visibility and archive filter contract suites.relevance_rules.pyrun directly on the reported strings returns discard for "Thank you", "Yeah." and "I don't know".Not verified:
relevance_decision.reasonon those rows after deploy;content_below_floorconfirms it.Risks
is_visible_conversationis shared, so the hold also applies to other default readers and to direct reads withoutinclude_discarded, matchingbridge_pending. Rollback: setHOME_HIDE_BELOW_FLOOR_ROWS=false."Brief Conversation Fragment"-style rows of 60s or longer with model notes aren't held.Review
Luna review of the first head had 5 findings. Fixed: live episode bypass, starred or foldered short clips discarded at finalize, katakana set too broad. Not fixed: MCP and agent previews can return a held row, because they aren't Home; and the list count can exceed the list by the held rows for up to 2 hours, because an exact count needs an extra query on every count call.
Luna's re-check confirmed the curated and katakana fixes and added one known limit, also not fixed: a live episode with another visible row still shows the held row's moments on
/v1/episodes/live. They appear inside that episode, not as a standalone Home row, and hiding them needs moment-level filtering.Tests
Regression tests:
test_a_content_free_short_clip_is_hidden_not_stood_up_as_a_row,test_content_free_text_is_no_evidence_of_an_occasion,test_katakana_laughter_and_acknowledgement_are_filler,test_record_settling.py,test_a_stored_floor_decision_without_a_blocked_reason_leaves_the_list,test_keeps_that_never_ran_the_rules_are_rejudged.UI evidence
UI-Evidence: none -- backend only
Line count
Line-Count-Exception: backend/database/conversations.py | 4649 -> 4652 | Shared visibility predicate and its list field mask must sit beside the other holds in this file.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3411 -> 3412 | One import for the short-clip decision; the logic itself lives in relevance_io.py.
Failure class (fixes)
Failure-Class: FC-rule-discard-left-visible
🤖 Generated with Claude Code