Repository navigation
feat(app): find spoken moments in search + play on open - #11400
undivisible merged 20 commits into
Conversation
…play-moment-clean # Conflicts: # backend/database/vector_db.py # backend/tests/unit/test_mcp_transcript_search.py # backend/utils/conversations/mcp_transcript_search.py # backend/utils/conversations/render.py # docs/api-reference/app-client-openapi.json
💡 Codex Reviewomi/backend/routers/conversations.py Line 1362 in 33514cd When page 1 has transcript hits, this final slice returns only the first This new AGENTS.md reference: AGENTS.md:L90-L90 omi/backend/routers/conversations.py Line 1321 in 33514cd For clients that request When a matched transcript segment or its neighbor is very long, this appends the entire segment text into every search snippet rather than a bounded excerpt around the match. For imported transcripts or long speaker turns, a search page can return megabytes of transcript text and make the list UI sluggish; trim each snippet to a fixed character budget around the hit before adding it. omi/backend/routers/conversations.py Lines 1330 to 1335 in 33514cd This merge builds a transcript-first result order, but the mobile search path immediately sorts the returned conversations by ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
2 issues found and verified against the latest diff
Confidence score: 3/5
- In
backend/utils/conversations/mcp_transcript_search.py, transcript-only phrase matching remains effectively inactive because this resolver is not wired intorouters/mcp.py, so MCP search can silently miss relevant results for users — call this resolver in the MCP endpoint before hydration. - In
app/lib/pages/conversation_detail/page.dart,seekToTranscriptSegmentconsumes the initial seek before confirming audio can start, which can leave users with an unavailable-playback message and no applied seek when dense audio is missing — gate seek consumption on confirmed playback (or retry once audio becomes available).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/utils/conversations/mcp_transcript_search.py">
<violation number="1" location="backend/utils/conversations/mcp_transcript_search.py:196">
P1: MCP conversation search still misses transcript-only phrases because this resolver is never wired into `routers/mcp.py`; use it in the MCP endpoint before hydration.</violation>
</file>
<file name="app/lib/pages/conversation_detail/page.dart">
<violation number="1" location="app/lib/pages/conversation_detail/page.dart:291">
P3: The initial seek is fully consumed before we know playback will actually begin. When the dense audio artifact isn't available (offline, or indexing still in flight), seekToTranscriptSegment shows the 'audioPlaybackUnavailable' snackbar and returns without throwing, so _maybePlayInitialSeek swallows nothing and never retries once the artifact becomes ready. Consider only marking _didInitialSeek = true after a successful play, or retrying on the next frame, so a transiently-unavailable artifact doesn't permanently drop the requested moment.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return merge_summary_and_transcript_ids(transcript_ids, [], limit) | ||
|
|
||
|
|
||
| def resolve_mcp_conversation_search_ids( |
There was a problem hiding this comment.
P1: MCP conversation search still misses transcript-only phrases because this resolver is never wired into routers/mcp.py; use it in the MCP endpoint before hydration.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/utils/conversations/mcp_transcript_search.py, line 196:
<comment>MCP conversation search still misses transcript-only phrases because this resolver is never wired into `routers/mcp.py`; use it in the MCP endpoint before hydration.</comment>
<file context>
@@ -0,0 +1,253 @@
+ return merge_summary_and_transcript_ids(transcript_ids, [], limit)
+
+
+def resolve_mcp_conversation_search_ids(
+ uid: str,
+ query: str,
</file context>
| if (_didInitialSeek || !mounted) return; | ||
| final start = widget.initialSeekStart; | ||
| if (start == null || _seekToSegmentCallback == null) return; | ||
| _didInitialSeek = true; |
There was a problem hiding this comment.
P3: The initial seek is fully consumed before we know playback will actually begin. When the dense audio artifact isn't available (offline, or indexing still in flight), seekToTranscriptSegment shows the 'audioPlaybackUnavailable' snackbar and returns without throwing, so _maybePlayInitialSeek swallows nothing and never retries once the artifact becomes ready. Consider only marking _didInitialSeek = true after a successful play, or retrying on the next frame, so a transiently-unavailable artifact doesn't permanently drop the requested moment.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/conversation_detail/page.dart, line 291:
<comment>The initial seek is fully consumed before we know playback will actually begin. When the dense audio artifact isn't available (offline, or indexing still in flight), seekToTranscriptSegment shows the 'audioPlaybackUnavailable' snackbar and returns without throwing, so _maybePlayInitialSeek swallows nothing and never retries once the artifact becomes ready. Consider only marking _didInitialSeek = true after a successful play, or retrying on the next frame, so a transiently-unavailable artifact doesn't permanently drop the requested moment.</comment>
<file context>
@@ -272,6 +284,26 @@ class _ConversationDetailPageState extends State<ConversationDetailPage> with Ti
+ if (_didInitialSeek || !mounted) return;
+ final start = widget.initialSeekStart;
+ if (start == null || _seekToSegmentCallback == null) return;
+ _didInitialSeek = true;
+ final end = widget.initialSeekEnd ?? start;
+ if (selectedTab != ConversationTab.transcript) {
</file context>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@kodjima33 @beastoin review/merge ping: replacement for stale #11205 is now MERGEABLE with the current-main conflicts resolved. Latest head |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the careful rebased cleanup here. The overall direction is cohesive: backend/routers/conversations.py now merges page-1 transcript-chunk hits into normal conversation search, backend/models/conversation.py / docs/api-reference/app-client-openapi.json expose a search-only ConversationSearchItem, and the generated Dart/TS clients track that contract. I also verified the focused backend tests for the search/redaction paths pass locally: 62 passed.
I’m requesting changes for two concrete issues before this is merge-ready:
-
app/lib/backend/schema/conversation.dartonly considerssnippets.firstinsearchMomentSeekFromSnippets. If the first matching snippet has text evidence but nostart, and a later snippet is timed, the search result opens without find-and-play even though the backend supplied a usable timed hit. Please select the first snippet with a non-nullstart(falling backendto that same snippet’s start), and add a unit test covering “first snippet untimed, later snippet timed.”app/test/unit/search_moment_seek_test.dartcurrently covers the all-untimed case but not this ordering edge. -
backend/utils/conversations/mcp_transcript_search.pylogs raw exception text in both transcript-index fail-open branches (conversation search: ... %sandmcp conversation search: ... %s). Those exceptions can come from vector/search infrastructure and may include upstream request details. Omi’s backend logging guidance requires sanitization for user/search-related data; please sanitize or omit exception detail while preserving the fail-open behavior. The surrounding privacy/redaction path inbackend/utils/conversations/render.pylooks correct for locked conversations, so this is specifically about log exposure rather than API response leakage.
Additional observations from the sampled files:
backend/routers/conversations.pycorrectly re-hydrates by owner, filters locked rows before attaching snippets, reapplies speaker/date filtering, and trims back to the effective page size after the transcript over-fetch.backend/routers/mcp.pyandbackend/routers/mcp_sse.pyare already wired throughresolve_mcp_conversation_search_ids, so I do not see the current head as missing MCP transcript-search integration.app/lib/backend/http/api/conversations.dartpreservesmatch_snippetsby round-tripping the generatedConversationSearchItemJSON intoServerConversation; that is a reasonable bridge for this generated-client shape.app/lib/pages/conversations/widgets/conversation_list_item.dartthreads the computed seek intoConversationDetailPage; once the snippet selection edge above is fixed, this should avoid opening a playable later match as a plain overview.desktop/windows/src/renderer/src/lib/omiApi.generated.ts, the three web generated clients, anddocs/api-reference/app-client-openapi.jsonconsistently switch/v1/conversations/searchitems toConversationSearchItem.
Validation note: I could not run the Flutter focused test locally because flutter is not installed in this review environment; please rely on CI or run flutter test test/unit/search_moment_seek_test.dart after adding the ordering regression test.
Leaving this for human maintainer review after the concrete fixes because this changes the app search/playback product path and a transcript-search logging surface.
— Automated maintainer review
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@Git-on-my-level @kodjima33 @beastoin re-review requested on head Addressed the requested blockers:
Also fixed verified in-scope findings:
Verification: 76 focused backend tests passed; 7 Flutter search-seek tests passed; Black and Dart formatting passed. Please dismiss the stale changes-requested review and re-check the new head. |
…play-moment-clean
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up. I verified the two blockers from the previous automation review on the current head are addressed: app/lib/backend/schema/conversation.dart now uses the first timed TranscriptMatchSnippet rather than blindly using snippets.first, app/test/unit/search_moment_seek_test.dart covers the untimed-then-timed ordering case, and backend/utils/conversations/mcp_transcript_search.py sanitizes the transcript-index fail-open exception text.
I’m still requesting changes for two current-head issues:
-
app/lib/providers/conversation_provider.dartstill loses the server’s search ranking before the user sees results. The initial search path preservessearchedConversations = convos, butgroupSearchConvosByDate()immediately calls_buildGroupedByDate(), which sorts every displayed bucket by(startedAt ?? createdAt)(lines 659-689 on this head).searchMoreConversations()also explicitly sorts the appended search list by recency. That means an older transcript-only spoken match returned first bybackend/routers/conversations.py/merge_typesense_page_with_transcript_hits()can still be buried in the rendered list, so the “find spoken moments” behavior is not reliably visible. Please keep server order for active search results, or add a separate grouping path/rank that preserves the backend order while still handling the normal non-search conversation list. -
The current
Dart Analyze & Testscheck is failing. The failing job is the analyzer ratchet (app/scripts/analyze_ratchet.sh), which reportsavoid_print: 30 found, baseline 29and exits 1. Please either remove the new analyzer finding or update the analyzer baseline in the same PR if this is an intentional acceptance.
Other sampled file notes:
.github/scripts/product_file_line_count_ratchet_baseline/backend-routers.jsondocuments thebackend/routers/conversations.pyroute-size increase; that looks consistent with the new route-owned search merge/redaction work.app/lib/backend/http/api/conversations.dartkeepsmatch_snippetsby converting the generatedConversationSearchItemJSON intoServerConversation; that bridge looks reasonable for this generated-client shape.app/lib/pages/conversation_detail/page.dartopens the transcript tab and invokes the initial seek callback once the transcript widget registers it; even if playback is unavailable, it still lands the user on the transcript tab.app/lib/pages/conversations/widgets/conversation_list_item.dartthreads the computed seek intoConversationDetailPageand the prior purple snippet icon is now neutral (Colors.white70).backend/routers/conversations.pyover-fetches transcript candidates on page 1, preserves the merged id order after Firestore hydration, filters locked rows before attaching snippets, and re-applies speaker/date filters.backend/utils/conversations/render.pyclearsmatch_snippetsfor locked list and integration redaction paths, which is the right privacy boundary.backend/models/conversation.py,docs/api-reference/app-client-openapi.json,app/lib/backend/schema/gen/conversation_wire.g.dart, and the generated TypeScript clients consistently exposeConversationSearchItem/TranscriptMatchSnippetfor/v1/conversations/search.- The backend unit coverage in
backend/tests/unit/test_conversation_search_date_validation.py,backend/tests/unit/test_mcp_transcript_search.py,backend/tests/unit/test_conversation_redact_enrich.py, and generated-client contract tests covers the important search merge, snippet, redaction, and schema paths.
Leaving this for human maintainer review because it changes a user-facing app search/playback path and a transcript-search data surface.
— Automated maintainer review
by AI on behalf of David — please have a human maintainer review the search-ranking/product behavior before merge.
Resolved on current head: timed snippet selection now skips untimed snippets and transcript-index fail-open logs sanitize exception text.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Additional CI fix pushed on head
The earlier focused backend/Flutter checks remain green. @Git-on-my-level please re-check/dismiss the stale changes-requested review when the new CI completes. |
…play-moment-clean # Conflicts: # .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json # app/lib/pages/conversations/widgets/conversation_list_item.dart
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Take main's diff-scoped line-count ratchet (no shared ledger). Spoken-moment search + rank preservation stay on this branch. Co-authored-by: Cursor <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@Git-on-my-level re-review / dismiss on Conflicts: GitHub was DIRTY on
Both remaining blockers from the 2026-08-12 review are still on this tip:
Local: Flutter search-rank + seek 8 passed; backend search/redaction/MCP 62 passed. Honest gap: no device/audio seek smoke. @kodjima33 rebase you asked for is done. After David dismisses the stale CHANGES_REQUESTED, this is a merge. |
|
@Git-on-my-level re-review / dismiss (>1d): tip |
Resolved OpenAPI schema merge (keep transcript match snippets + main screen-activity schemas) and regenerated TypeScript clients.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
refreshed onto current |
Main refresh left SearchConversationsResponse pointing at Conversation; re-export the app-client contract and regenerate TS clients so spoken-moment match_snippets stay on the search response. Co-authored-by: Cursor <[email protected]>
|
tip after
Ranking/seek blockers from your prior CR remain on tip ( |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@Git-on-my-level re-review / dismiss CHANGES_REQUESTED — tip Verified your 2026-08-12 blockers against this tip:
Earlier blockers (first timed snippet + sanitized transcript-index logs) remain in place from the prior round. Author-side clear — please dismiss CR / re-approve when you have a moment. |
kodjima33
left a comment
There was a problem hiding this comment.
feat(app) spoken-moment search — feature, approve-only per policy
|
Nik (@kodjima33) has approved this head with write-access ( All prior blockers from David’s review have been verified resolved on tip
@Git-on-my-level Please dismiss the stale |
…play-moment-clean # Conflicts: # backend/tests/unit/test_conversation_events_bounds.py # backend/tests/unit/test_conversation_search_date_validation.py
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…r the main refresh Merging current main brought new Conversation fields (imported, meeting_dedup_speech_s and siblings) that the committed app-client contract did not carry, so the Public Developer API contract check failed on a stale spec rather than on anything this PR changed. Re-exported the spec and regenerated the clients that track it. The Swift generator was already in sync. Verification: - backend/scripts/export_openapi.py --surface app-client --write - generate_ts_openapi_types.py / generate_dart_models.py regenerated; generate_swift_openapi_types.py --check already clean
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ca89d05 raised avoid_print 29 -> 30 to clear a red ratchet. That occurrence came from main at the time, not from this branch: no file this PR touches contains a print( call. main has since gone back to 29, so the bump was leaving this PR carrying accepted lint debt it never created, and a genuinely new print in a later commit would have ratcheted in unnoticed under the raised ceiling. Reverting to 29 makes analysis_baseline.json identical to main, so the file drops out of this PR's diff entirely (git diff origin/main on it is now empty). The ratchet treats current < baseline as advisory, not a failure, so this was green either way -- it is the ceiling that was wrong, not the check.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@Git-on-my-level both blocking items from your review are resolved. Flagging because the request-changes is still on file and predates the fixes. 1. Server search ranking lost before render — fixed with the separate grouping path you suggested rather than by changing the shared one.
Covered by 2. So in To be precise about the CI signal: the ratchet treats Everything is green on this head with nothing failing or pending. Human maintainer review on the user-facing search/playback path is still the right gate — please dismiss the stale request-changes when you next pass. Updated for the current head
All 29 checks pass, 5 skipped, nothing failing or pending, no conflicts. At this point the 2026-08-12 request-changes is the only thing blocking merge — GitHub reports "Requested changes must be addressed to merge this pull request", with your review as the one change requested against @kodjima33's approval. Both of its items are resolved above, and you dismissed an earlier review on this same PR once the underlying items were fixed, so I think this is just waiting on your next pass rather than on anything outstanding from me. No rush, and no action needed on my side — flagging only because the block is now purely the stale review rather than the code. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (spoken-moment search + play-on-open), mobile/app area — approve-only per policy (not a bug fix). New commits since last review; re-approved on latest head.
Addressed review (David CR 2026-08-12)
groupSearchResultsPreservingRank+ tests)avoid_printbaseline aligned (30)Summary
In-app conversation search now finds transcript-only spoken phrases when the optional transcript-chunk index is available, attaches bounded timed match snippets, and opens the transcript at the matching moment for playback.
The API keeps the search-only
ConversationSearchItemcontract, preserves locked-conversation redaction, and fails open when indexing or playback is unavailable.Verification
Honest gaps
Failure-Class: none
Line-Count-Exception: backend/routers/conversations.py | 1819 -> 1865 | Owns bounded transcript-match hydration and privacy redaction for spoken-moment search; page/date filters stay at the route so transcript-only hits cannot starve summary results (#11400).
Supersedes stale conflicted PR #11205; same verified final tree, rebased onto current
mainwithout merge.