Skip to content

feat(app): find spoken moments in search + play on open - #11205

Closed
aryanorastar wants to merge 12 commits into
BasedHardware:mainfrom
aryanorastar:feat/app-search-find-play-moment
Closed

aryanorastar wants to merge 12 commits into
BasedHardware:mainfrom
aryanorastar:feat/app-search-find-play-moment

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • In-app conversation search could only match title + overview (Typesense). Spoken phrases that live only in the transcript were invisible — the Client #1 retention gap vs Limitless-style “play what they said.”
  • POST /v1/conversations/search now merges optional transcript-chunk vector hits (page 1), attaches match_snippets (text + start/end), and the Flutter list shows the hit then opens the transcript tab seeking/playing that moment.
  • Reuses the same transcript-match helpers as MCP #11198 / MCP: search_conversations should search transcripts (and return match snippets) #6621 (shared module). Does not duplicate Ratnam lexical #7421.

Honest gaps

  • Transcript-chunk indexing is optional (TRANSCRIPT_CHUNK_INDEXING_ENABLED). When off, Typesense-only hits still get snippets if the phrase appears in hydrated segments; pure spoken-word recall needs the chunk index (same as MCP).
  • Audio seek needs the dense conversation artifact; if playback is unavailable we still open the transcript tab.
  • Physical device smoke of seek-from-search not run in this PR (no kit).

Test plan

  • pytest tests/unit/test_mcp_transcript_search.py (+ existing search speaker/date/pagination suites green)
  • OpenAPI app-client + TS/Dart/Swift clients regenerated
  • Automated: transcript-only phrase → timed match_snippets (API + helpers); Flutter searchMomentSeekFromSnippets opens transcript tab with start/end
  • Automated: locked conversations filtered from search + list/integration redaction clears match_snippets
  • Optional maintainer smoke (needs kit + chunk index on): search spoken-only phrase → tap → audio seeks that segment

Review in cubic

Failure class (fixes)

Failure-Class: none

Wire POST /v1/conversations/search to merge optional transcript-chunk hits,
attach grep-style match_snippets with start/end, and open the transcript tab
seeking that moment so in-app search finds words Typesense title/overview miss.

Co-authored-by: Cursor <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 16 files

Confidence score: 4/5

  • In backend/utils/conversations/mcp_transcript_search.py, the new combined transcript+summary resolver is not called in production, so MCP recall likely stays summary-vector-only and can miss relevant transcript-only matches for users; wire both MCP search routes to this resolver (and add a route-level test) to de-risk the behavior gap.
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:189">
P2: MCP transcript recall remains summary-vector-only because this newly added resolver has no production caller, despite its docstring promising combined transcript and summary search. Wire both MCP search routes to the resolver or remove the unused MCP path to avoid presenting this as shared functionality.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/routers/conversations.py Resolved
Comment thread backend/routers/conversations.py Resolved
return merge_summary_and_transcript_ids(transcript_ids, [], limit)


def resolve_mcp_conversation_search_ids(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: MCP transcript recall remains summary-vector-only because this newly added resolver has no production caller, despite its docstring promising combined transcript and summary search. Wire both MCP search routes to the resolver or remove the unused MCP path to avoid presenting this as shared functionality.

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 189:

<comment>MCP transcript recall remains summary-vector-only because this newly added resolver has no production caller, despite its docstring promising combined transcript and summary search. Wire both MCP search routes to the resolver or remove the unused MCP path to avoid presenting this as shared functionality.</comment>

<file context>
@@ -0,0 +1,246 @@
+    return merge_summary_and_transcript_ids(transcript_ids, [], limit)
+
+
+def resolve_mcp_conversation_search_ids(
+    uid: str,
+    query: str,
</file context>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Kept for shared helpers with #11198 (MCP wiring lands there). This PR production path is POST /v1/conversations/search.

Comment thread backend/routers/conversations.py Resolved
Comment thread backend/models/conversation.py Resolved
Gate transcript merge to page 1 with over-fetch + post-hydrate date/speaker
filters, one-sided chunk date bounds, Unicode snippet tokens, and a
search-only ConversationSearchItem so unit stubs and Dart format stay green.

Co-authored-by: Cursor <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Update @2406558738

Why “Skip” / unchecked looked scary: CI Skipped jobs are path-filtered (Detect Changes → skip unused workflows). Unchecked test-plan boxes are reviewer smokes, not CI skips. The real blockers were Backend Unit Tests + Dart Formatting + cubic P1s.

CI root cause: router unit tests stub utils.conversations with empty __path__, so the new mcp_transcript_search submodule 404’d at import (ModuleNotFoundError). Stubbed it in the affected tests; also stubbed transcript_for_llm in KG isolation.

Cubic:

Local: previously-failed unit files + test_mcp_transcript_search.py green; Dart format fixed.

Automate transcript-only snippet + seek times, locked drop/redaction of
match_snippets, and Flutter searchMomentSeekFromSnippets; fix search client
parsing for ConversationSearchItem after the schema split.

Co-authored-by: Cursor <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Test plan completed (automated) @deb654b693

  • test_mcp_transcript_search.py + search speaker/date suites
  • OpenAPI clients (prior)
  • Transcript-only phrase → timed match_snippets (API + helpers)
  • Locked never leak snippets (search filter + list/integration redaction)
  • Flutter searchMomentSeekFromSnippets unit tests (tap → transcript tab + start/end)

Left unchecked on purpose: physical audio seek smoke (needs kit + chunk index on).

Record the conversation search router baseline and apply the repository
Dart formatter to the seek-from-search page changes.

Failure-Class: none

Co-authored-by: CommandCodeBot <[email protected]>
@Git-on-my-level Git-on-my-level added needs-tests PR introduces logic that should be covered by tests needs-maintainer-review Needs a human maintainer to sign off before merge security-review Touches auth, provider routing, secrets, or security-sensitive surfaces flutter flutter work labels Aug 7, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the thoughtful work here — the feature direction is promising, and I like that the PR explicitly preserves locked-conversation redaction for match_snippets.

I can't mark this ready yet because the current head still has merge-blocking validation failures:

  • Formatting reports app/lib/pages/conversation_detail/page.dart would be changed by dart format --line-length 120.
  • Backend unit suite reports failures in tests/unit/test_app_client_dart_generator.py and tests/unit/test_desktop_rest_inventory.py. From the diff, the search response now intentionally exposes ConversationSearchItem, but the existing app-client/desktop contract tests still assert SearchConversationsResponse.items is Conversation. Please update the generator/desktop contract expectations (or the API shape, if the generated clients are not supposed to see a distinct search item model) so the OpenAPI-generated clients and first-party desktop decoder contract agree.

Because this exposes transcript-derived snippets and seek times through the app-client search API, I'd also like a maintainer/product pass before merge on the privacy/UX boundary: locked rows must continue to suppress snippets, and the app behavior should be acceptable when audio playback is unavailable or the transcript-chunk index is disabled.

Once formatting and the generated-client/desktop contract tests are green, this looks much closer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

Dart format conversation detail page; update app-client Dart generator
and desktop REST inventory expectations for SearchConversationsResponse
items as ConversationSearchItem (not bare Conversation).

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Thanks @Git-on-my-level — merge-blocking items fixed in 33d42436f1:

  1. Dart format — app/lib/pages/conversation_detail/page.dart formatted (dart format --line-length 120).
  2. Contract tests — updated expectations to ConversationSearchItem for SearchConversationsResponse.items in test_app_client_dart_generator.py + test_desktop_rest_inventory.py (intentional search-only shape with optional match_snippets).

Local: those two previously-failing assertions now pass.

Privacy / UX boundary (for product pass):

  • Locked conversations are filtered out of search results; list/integration redaction clears match_snippets (covered by automated tests).
  • Chunk index off → Typesense/title-overview hits still work; snippets only when the phrase appears in hydrated segments (honest gap in PR body).
  • Audio unavailable → still opens transcript tab at the snippet seek window (no hard fail).

Physical seek-from-search smoke still not run (no kit). Ready for re-pass + privacy/UX glance when you have a moment.

Repo Formatting check requires black 26.5.1 at line-length 120.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
@aryanorastar

aryanorastar commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

one remaining CI miss after 33d42436f1: Formatting wanted black on backend/tests/unit/test_conversation_search_date_validation.py (line-length 120). Pushed that reformatting.

Backend unit + Dart format + ConversationSearchItem contracts remain green from the prior tip. Ready for re-pass + privacy/UX glance when CI is green.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Spoken-moment search + play-on-open — feature, approve only.

aryanorastar and others added 2 commits August 8, 2026 21:40
Keep find-and-play search tip current for CR dismiss after APPROVE.
Main overwrite reset search item expectations to bare Conversation;
restore SearchItem + snippet assertions matching the OpenAPI shape.

Co-authored-by: Cursor <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

@Git-on-my-level need human response — please dismiss the stale CHANGES_REQUESTED on #11205.

Author-clear on your blockers:

  • Dart format + ConversationSearchItem / desktop contract expectations were fixed on 78847a4f9f
  • @kodjima33 APPROVED
  • Tip @c12ce90a2f1f = merge of current main + restore of SearchItem contracts (main overwrite had reset the test expectations to bare Conversation)
  • CI was fully green before the refresh; focused contracts + test_mcp_transcript_search re-checked locally

Privacy/UX (for the product glance you asked for):

  • Locked conversations filtered from search; redaction clears match_snippets (automated)
  • Chunk index off → Typesense path still works; snippets only when phrase is in hydrated segments
  • Audio unavailable → opens transcript tab at seek window (no hard fail)
  • Honest gap: no physical seek-from-search smoke (no kit)

Please dismiss CR / re-pass when you can so the APPROVE can clear the merge gate.

Keep find-and-play search tip current for CR dismiss after APPROVE.
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Follow-up: tip now correctly on @b1ac42ca423e (previous ping referenced a detached rebuild that had not pushed).

Contains: merge of current main + ConversationSearchItem contract restore if main overwrote the tests. Focused generator/desktop contracts green locally.

@Git-on-my-level
Git-on-my-level dismissed their stale review August 8, 2026 22:38

Resolved on current head: formatting is green and the SearchConversationsResponse generated-client/desktop contract expectations now use ConversationSearchItem.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution and removed needs-tests PR introduces logic that should be covered by tests security-review Touches auth, provider routing, secrets, or security-sensitive surfaces needs-maintainer-review Needs a human maintainer to sign off before merge labels Aug 8, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for the follow-up fixes. I re-checked the current head and I’m leaving this as a positive signal rather than a formal automation approval.

What I verified:

  • backend/routers/conversations.py now merges transcript-chunk hits only on page 1, preserves result ordering after hydration, re-applies locked/speaker/date filters before snippets are attached, and trims back to the effective page size.
  • backend/utils/conversations/mcp_transcript_search.py is fail-open around optional transcript chunk search and builds bounded snippet evidence with segment timing for seek-to-moment behavior.
  • backend/utils/conversations/render.py clears match_snippets for locked list/integration rows, which addresses the privacy boundary from the earlier review.
  • app/lib/backend/http/api/conversations.dart and app/lib/backend/schema/conversation.dart now keep match_snippets through the generated search-item shape without widening the base generated conversation model.
  • app/lib/pages/conversation_detail/page.dart and app/lib/pages/conversations/widgets/conversation_list_item.dart wire the first timed snippet into the transcript tab and tolerate unavailable playback by still opening the transcript.
  • backend/tests/unit/test_app_client_dart_generator.py, backend/tests/unit/test_desktop_rest_inventory.py, and the generated OpenAPI/TS/Dart client files now reflect ConversationSearchItem, so the earlier generated-client/desktop contract blocker is resolved.

The current GitHub checks are green, and I also smoke-checked the new pure transcript-search helper behavior locally. I did not find a new blocking issue in the sampled code paths. Because this touches transcript-derived user data and app search UX, I’m relying on the existing human maintainer sign-off for the product/privacy boundary rather than issuing a formal automation approval.


by AI on behalf of David — positive signal only; transcript-search privacy/UX has human maintainer sign-off on this head.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

@kodjima33 @beastoin need human response — merge call for #11205 (spoken-moment search + play-on-open).

Head @b1ac42ca42 · APPROVED · MERGEABLE CLEAN · CI green · David dismissed formatting/contract CR · positive-signal (no remaining production-code blocker; left privacy/UX for human maintainer).

Author-clear privacy/UX for that glance:

  • Locked conversations filtered from search; list/integration redaction clears match_snippets
  • Chunk index off → Typesense path still works; snippets only when phrase is in hydrated segments
  • Audio unavailable → opens transcript tab at seek window (no hard fail)
  • Honest gap: no physical seek-from-search smoke (no kit)

Please merge (or state hold) when ready — retention wow lane.

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

@kodjima33 @beastoin need human response — merge call for #11205 (spoken-moment search + play-on-open).

Author-clear on b1ac42ca42:

  • APPROVED (kodjima33) + MERGEABLE CLEAN + all checks green (24 success)
  • David dismissed formatting/contract CR; positive-signal; no remaining production-code blocker
  • Privacy/UX for the glance: locked rows filtered + match_snippets redacted; chunk index optional; audio unavailable → transcript tab at seek window
  • Honest gap: no physical seek-from-search smoke (no kit)

Please merge when ready (or state an explicit hold) — retention wow lane.

@undivisible undivisible added human Human-authored pull request backend Backend Task (python) app mobile desktop web javascript JavaScript or TypeScript implementation work workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior labels Aug 10, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up review on the current head/check state:

The implementation still looks directionally sound to me, and I’m not adding a blocking review over the existing maintainer approval. I did re-check the main code paths:

  • backend/routers/conversations.py merges transcript-chunk hits only into page 1, preserves hydrated result order, then re-applies locked/speaker/date filtering before match_snippets are attached.
  • backend/utils/conversations/mcp_transcript_search.py keeps transcript index lookup best-effort/fail-open and bounds snippet construction to a small set of timed segments.
  • backend/utils/conversations/render.py clears match_snippets for locked list/integration redaction, so the new search evidence does not bypass the locked-conversation privacy boundary.
  • app/lib/backend/http/api/conversations.dart plus app/lib/backend/schema/conversation.dart preserve the generated ConversationSearchItem.match_snippets through to ServerConversation without changing the base generated conversation shape.
  • app/lib/pages/conversations/widgets/conversation_list_item.dart and app/lib/pages/conversation_detail/page.dart wire the first timed snippet into transcript-tab open/seek behavior and tolerate unavailable playback.
  • The generated OpenAPI/TS/Dart clients and focused tests (backend/tests/unit/test_mcp_transcript_search.py, backend/tests/unit/test_conversation_search_date_validation.py, app/test/unit/search_moment_seek_test.dart) cover the new contract and privacy edge cases.

Current merge blocker I see is CI, not a new product-code blocker: PR Metadata Preflight is now failing the product-file line-count ratchet for backend/routers/conversations.py against the current origin/main baseline, and GitHub also shows the Formatting check failing. Please fix/rerun those before merge; the transcript-search privacy/UX boundary still deserves human maintainer sign-off because this feature exposes transcript-derived search evidence and seek behavior.


by AI on behalf of David — follow-up comment only; not a formal approval or merge decision.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @aryanorastar 👋

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 product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

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!

@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Superseded by clean replacement PR #11400. The implementation was rebased onto current main as a single-parent commit to remove the stale GitHub conflict state; the verified final tree and focused tests are unchanged.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @aryanorastar 👋

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 product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

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

app backend Backend Task (python) desktop flutter flutter work human Human-authored pull request javascript JavaScript or TypeScript implementation work mobile positive-signal Automation verified a genuine fix/quality contribution web workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants