Repository navigation
fix(backend): MCP search_conversations includes transcript hits + snippets (#6621) - #11198
Conversation
…ppets Summary vectors miss transcript-only phrases. Merge Pinecone transcript-chunk hits into MCP REST/SSE search and return grep-style match_snippets (BasedHardware#6621). 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. |
Narrow Sequence[Any] typing on transcript search helpers and regenerate app-client OpenAPI + TS clients so unit/contract CI match the new match_snippets field. Co-authored-by: Cursor <[email protected]>
|
Pushed CI fix @
Local: |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
CI is green on the CI-fix tip (Backend unit + OpenAPI + hermetic gates). Author-side clear — ready for write-access review when you have a moment. @Git-on-my-level — retrieval / MCP |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for taking on the MCP transcript-search gap — the overall direction makes sense and the locked-row snippet handling is appreciated.
I need to request one fix before this is merge-ready:
search_conversationsnow forwardsstart_date/end_datebounds into transcript chunk search, butdatabase.vector_db.search_transcript_chunksonly appliescreated_atfiltering when both bounds are present. For start-only or end-only MCP searches, transcript-chunk hits can therefore come from outside the requested date range, while summary-vector hits are still filtered correctly. This is a user-visible correctness/privacy-boundary issue for date-scoped conversation search.
Please update the transcript chunk filter to match query_vectors / _created_at_filter semantics for one-sided ranges as well, and add regression coverage that captures search_transcript_chunks kwargs for start-only, end-only, and both-bounds paths (REST and/or SSE as appropriate).
I also noticed the new path embeds the same query once for summary vectors and once for transcript chunks. That is worth tightening if the vector helper can share a query vector across namespaces, but the date-bound mismatch above is the blocking item.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
search_transcript_chunks only applied created_at when both bounds were set, so start-only/end-only MCP searches could return out-of-range transcript hits. Align with query_vectors via _created_at_filter, share one query embedding across summary + chunk lookups, and add regression coverage. Failure-Class: none Co-authored-by: Cursor <[email protected]>
|
Thanks @Git-on-my-level — blocking date-bound mismatch fixed in Fix: Also tightened (your non-blocking note + cubic):
Local (file-isolated): Ready for re-pass when you have a moment. |
Black-format action-item date-filter tests; bump mcp_sse line-count baseline 1988→1989 for the transcript-search description; stub resolve_mcp_conversation_search_ids in the SSE limit clamp test so the shared-embed path does not hit live OpenAI encodings. Failure-Class: none Co-authored-by: Cursor <[email protected]>
|
CI was red on
Per-file local: pagination 7 · date_utc 10 · transcript_search 10 · poison 4 · action_item_dedup 17 — all pass. Ready for re-pass on the one-sided date-bound fix when CI is green. |
kodjima33
left a comment
There was a problem hiding this comment.
MCP search_conversations transcript hits + snippets — reasonable fix; needs a rebase (conflicts with main).
…lict Keep main's mcp_sse/sync cutover baselines and append the BasedHardware#6621 transcript-search justification; set mcp_sse line count to post-merge 2013. Co-authored-by: Cursor <[email protected]>
|
@Git-on-my-level @kodjima33 conflicts with
Local: Prior David CR (one-sided |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the follow-up fixes here — the previous date-bound blocker looks resolved on this head.
Review notes:
backend/database/vector_db.pynow routessearch_transcript_chunksthrough_created_at_filter, so start-only, end-only, both-bound, and invalid date ranges match the existing summary-vector behavior. The optionalquery_vectorparameter also lets summary and transcript namespace searches share one embedding.backend/utils/conversations/mcp_transcript_search.pykeeps the search merge fail-open around transcript chunk lookup, dedupes transcript/summary conversation ids stably, and caps snippet output. The grep-style snippet builder is intentionally lexical evidence over already-hydrated segments, which is a good fit for explaining semantic hits without storing transcript text in Pinecone metadata.backend/routers/mcp.pywires RESTsearch_conversationsthrough the merged resolver and attaches snippets only after list redaction, so locked rows keepmatch_snippetsempty viabackend/utils/conversations/render.py.backend/routers/mcp_sse.pymirrors the resolver in the SSE tool path, updates the tool description, and explicitly skips snippet extraction for locked conversations before returning the simplified tool result.- The new/updated tests cover the important regression surfaces: chunk date filters in
backend/tests/unit/test_action_item_dedup.py, REST/SSE UTC forwarding inbackend/tests/unit/test_mcp_search_date_utc.py, transcript-only hits inbackend/tests/unit/test_mcp_search_conversations_poison.py, and helper behavior inbackend/tests/unit/test_mcp_transcript_search.py. The generated OpenAPI/types files (docs/api-reference/app-client-openapi.json,desktop/windows/src/renderer/src/lib/omiApi.generated.ts, and the web generated clients) consistently exposeTranscriptMatchSnippet.
Validation I ran locally:
python -m pytest tests/unit/test_mcp_transcript_search.py tests/unit/test_mcp_search_conversations_poison.py tests/unit/test_mcp_search_date_utc.py tests/unit/test_action_item_dedup.py tests/unit/test_mcp_sse_pagination_bounds.py→ 41 passed, then 7 failures intest_mcp_sse_pagination_bounds.pycaused by test-harness module pollution fromtest_mcp_search_conversations_poison.pyleaving broadsys.modulesstubs behind.python -m pytest tests/unit/test_mcp_sse_pagination_bounds.py -q→ 7 passed.python -m pytest tests/unit/test_mcp_search_date_utc.py tests/unit/test_mcp_sse_pagination_bounds.py -q→ 17 passed.python -m pytest tests/unit/test_action_item_dedup.py tests/unit/test_mcp_sse_pagination_bounds.py -q→ 24 passed.
Given the code review, CI, and focused local validation, I do not see a remaining production-code blocker. I removed the stale needs-tests label and am leaving this for human maintainer review because it changes the conversation transcript evidence returned by the MCP/API search surface and should get maintainer sign-off before merge.
by AI on behalf of David — this PR changes a data-returning backend/API search surface, so maintainer sign-off is the right next step.
Resolved on current head: transcript chunk search now uses the same one-sided/invalid date filtering semantics as summary vector search, with regression coverage.
|
@kodjima33 @beastoin need human response — merge call for #11198 / #6621. Head Author-clear: MCP Please merge (or state hold) when ready — flagship retrieval/MCP surface. |
…lict Co-authored-by: Cursor <[email protected]>
|
@kodjima33 @beastoin need human response — merge call for #11198 / #6621. Conflicts cleared on tip
CI re-running. Please merge when green (or state hold). |
|
Thanks for resolving the conflict-only rebase on this head. I rechecked the current diff and I don’t see a new production-code blocker. Review notes:
I’m leaving this as a positive signal rather than a formal approval because this is contributor code touching MCP conversation-search behavior and user transcript evidence. A human maintainer should make the final merge call for the MCP/user-data search behavior, but from this review the previous date-bound blocker appears resolved. — Reviewed by Omi maintainer automation (gpt-5.5). by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@kodjima33 @beastoin need human response — merge call for #11198 / #6621. Author-clear on
Please merge when ready (or state an explicit hold). |
Summary
search_conversations(REST + SSE) previously searched summary vectors only, so transcript-only phrases were unfindable.search_transcript_chunks) with summary-vector hits (transcript-first), fail-open if chunk index is empty/down.match_snippets(grep-style context,segment_id,start/end+start_ms/end_ms) from hydratedtranscript_segments.match_snippets; SSE skips snippets when locked).Area ownership: retrieval / MCP conversation search (flagship slice; not Ratnam’s open #7421 lexical Typesense work).
Product invariants affected
none
How it was verified
pytest tests/unit/test_mcp_transcript_search.py tests/unit/test_mcp_search_conversations_poison.py tests/unit/test_mcp_search_date_utc.py→ 19 passedTRANSCRIPT_CHUNK_INDEXING_ENABLEDhaving indexed chunks; when the index is empty, summary hits still get lexical snippets when the phrase appears in hydrated segments.Failure-Class
Failure-Class: none
Test plan