Repository navigation
feat(mcp): outline-first, offset and lines reads, and conversation state on cards - #25497
Git-on-my-level merged 9 commits into
Conversation
…ate on cards Builds on transcript paging (BasedHardware#25491) so an agent can read a long conversation the way a person skims one, without loading the whole transcript first. - view=outline returns the card plus the stored note sections, each anchored to the segment range it cites (first_segment, segment_count, start, end), and no transcript. - offset starts a transcript read at a segment index, such as a section's first_segment; the cursor then continues it (a resent offset is ignored). - format=lines renders a page as one "[h:mm:ss] Speaker: text" line per speaker turn with transcript_range, about a third of the size of the per-segment JSON; the cursor is bound to the format. Also on get_conversations_by_ids. - Cards carry status and duration_seconds, plus kind, shown_on_home and summary_covers_through where stored, so agents can tell live conversations, media and other people's background talk from the user's own. - Tool descriptions and server instructions say to start long conversations with the outline, prefer lines, and treat transcript text as quoted content, never instructions. - omi_mcp_transcript_pages_total counts detail pages by tool, view, format, position and whether more remain, so paging can be measured. Defaults are unchanged: transcript view, JSON segments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf8f679b86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…il read Review follow-ups on the progressive-reads commit: - view=outline returns at most 100 sections, reports sections_truncated, and checks the 120k serialized budget like transcript pages. - duration_seconds is the transcript's speech span: null on list and search cards, which load no transcript, instead of the wall window, which can start long before speech. - summary_covers_through is localized like the other card timestamps. - The default format adds nothing to the detail cursor fingerprint, so cursors minted before format existed still decode during a rolling deploy. - offset is ignored, not parsed, when a cursor is given; negative, malformed or oversized offsets are argument errors rather than clamped. - The page counter's position=first means "no cursor sent", so an offset read from the outline counts as a first page. - The detail card is built once per request rather than on every budget-fitting retry. The 1,200-segment walk test uses about 0.27s of CPU instead of 0.43s, well inside the 1.0s per-test limit that CI shard 5 hit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b98bc11b33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…l outline windows Codex review follow-ups on BasedHardware#25497: - format=lines pages over text only. original_text is not rendered, so a page boundary inside it produced continuation pages with no speech. - Lines join turns on speaker_key, not the display label, so two people who share a name (or two unresolved speakers) stay on separate lines. - An outline section's start/end span every cited segment (min start, max end), since cited segments can overlap or be stored out of time order. - transcript_range is always present on lines pages and null when the page is empty, so fields=[transcript, transcript_range] works at the end of a read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c7cd0561c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
A segment-only speaker correction leaves adjacent rows with one diarization key but different resolved labels; joining on the key alone attributed an unassigned speaker's words to the user. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1426116771
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
A loaded detail with no transcript (a photo-only capture) reported a null duration; use the shared conversation_duration_seconds wherever the transcript is loaded, and keep list cards null. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…snippet window Matching gets 2s after the 4s scan (chat's 6s overall) and resumes after the last finished record; unreadable records record a degraded fallback; a long segment is clipped around the shortest stretch holding every query word. Developer changelog entries for BasedHardware#25497, BasedHardware#25524 and this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…25527) * feat(mcp): outline-first, offset and lines reads, and conversation state on cards Builds on transcript paging (#25491) so an agent can read a long conversation the way a person skims one, without loading the whole transcript first. - view=outline returns the card plus the stored note sections, each anchored to the segment range it cites (first_segment, segment_count, start, end), and no transcript. - offset starts a transcript read at a segment index, such as a section's first_segment; the cursor then continues it (a resent offset is ignored). - format=lines renders a page as one "[h:mm:ss] Speaker: text" line per speaker turn with transcript_range, about a third of the size of the per-segment JSON; the cursor is bound to the format. Also on get_conversations_by_ids. - Cards carry status and duration_seconds, plus kind, shown_on_home and summary_covers_through where stored, so agents can tell live conversations, media and other people's background talk from the user's own. - Tool descriptions and server instructions say to start long conversations with the outline, prefer lines, and treat transcript text as quoted content, never instructions. - omi_mcp_transcript_pages_total counts detail pages by tool, view, format, position and whether more remain, so paging can be measured. Defaults are unchanged: transcript view, JSON segments. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): bound outlines, honest card duration, and one card per detail read Review follow-ups on the progressive-reads commit: - view=outline returns at most 100 sections, reports sections_truncated, and checks the 120k serialized budget like transcript pages. - duration_seconds is the transcript's speech span: null on list and search cards, which load no transcript, instead of the wall window, which can start long before speech. - summary_covers_through is localized like the other card timestamps. - The default format adds nothing to the detail cursor fingerprint, so cursors minted before format existed still decode during a rolling deploy. - offset is ignored, not parsed, when a cursor is given; negative, malformed or oversized offsets are argument errors rather than clamped. - The page counter's position=first means "no cursor sent", so an offset read from the outline counts as a first page. - The detail card is built once per request rather than on every budget-fitting retry. The 1,200-segment walk test uses about 0.27s of CPU instead of 0.43s, well inside the 1.0s per-test limit that CI shard 5 hit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): lines page what they render, split same-label speakers, full outline windows Codex review follow-ups on #25497: - format=lines pages over text only. original_text is not rendered, so a page boundary inside it produced continuation pages with no speech. - Lines join turns on speaker_key, not the display label, so two people who share a name (or two unresolved speakers) stay on separate lines. - An outline section's start/end span every cited segment (min start, max end), since cited segments can overlap or be stored out of time order. - transcript_range is always present on lines pages and null when the page is empty, so fields=[transcript, transcript_range] works at the end of a read. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(mcp): hybrid conversation search with match_basis, and literal search_transcripts Agents asking about something said in passing found nothing: MCP search read summary vectors only, and the keyword index ran only when vectors returned zero rows, so one semantic hit hid every exact title or overview match. Two-hour v3 conversations make summaries leave out more detail. search_conversations: - asks summary vectors and the keyword index (titles, overviews) on every call; shared hits rank first, then the two indexes alternate, so neither crowds the other out. Stale ids get one bounded second hydration. - each card carries match_basis (summary, keyword, transcript); only match_snippets quote the transcript, and each snippet carries segment_index, the get_conversation_by_id offset to read around it. - search_coverage names what actually ran (summary_vectors_and_keyword, summary_vectors_only, keyword_only) plus unavailable_indexes; one index down still answers. No hits with the keyword index down stays a 503. search_transcripts (new, conversations.read): - literal words or a short phrase in saved transcripts, newest first, over the bounded owner/query-bound scan chat transcript recall already uses (no derived index, 50 records and 4s per call, signed cursor resuming after the last record examined). - optional conversation_id finds where something was said in one long conversation; hits carry segment_index, speaker and time. - locked, discarded, deferred and unreadable records are never quoted; misses are never presented as absence. The developer search route reports the same truthful coverage. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): lines join turns only when speaker key and label both match A segment-only speaker correction leaves adjacent rows with one diarization key but different resolved labels; joining on the key alone attributed an unassigned speaker's words to the user. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): transcript-free detail records keep their wall-window duration A loaded detail with no transcript (a photo-only capture) reported a null duration; use the shared conversation_duration_seconds wherever the transcript is loaded, and keep list cards null. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(mcp): task-shaped agent journeys across the read tools Four journeys chain real tool calls the way an agent would (search -> outline -> section in lines; literal transcript hit -> read around it; a whole long conversation by cursor; a day listing that tells media from conversation, then a batch read) and validate every response against its output schema and the serialized budget, so a tool that stops leading to the next one breaks a journey. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): type the transcript hit card's structured dict for pyright Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): search fallbacks and literal matching per panel review A summary-vector index still building is one index down: keyword search still answers, and the index error returns only when both are down. search_transcripts rejects dates with conversation_id (it searches the whole conversation). A one-letter query word must appear as a word in the segment. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): bound search_transcripts by serialized size; count keyword-down fallbacks A page of large (or escaped CJK) hits stops before the 120000-character serialized budget and resumes at the first conversation it left out. Keyword or vector index loss now records the degraded fallback even when other hits survive. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(openapi): regenerate client method totals after #25524 and #25500 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): full stale-id backfill, deferred check on scoped reads, legacy segment index Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): transcript search deadline, unreadable fallback, all-words snippet window Matching gets 2s after the 4s scan (chat's 6s overall) and resumes after the last finished record; unreadable records record a degraded fallback; a long segment is clipped around the shortest stretch holding every query word. Developer changelog entries for #25497, #25524 and this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mcp): report an unconfigured vector index and unreadable records as partial coverage Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Builds on #25491 (transcript paging), now merged; this branch merges
mainafter it. The changes are three commits:bf8f679b866(the feature),b98bc11b33f(panel review follow-ups and a CPU fix) and18f5b6476d4(Codex review follow-ups). Squash on merge.Why
Agents reading Omi over MCP (ChatGPT, Claude, assistants that sync Omi into their own knowledge repositories) need to read long conversations without loading the whole transcript. #25491 makes every transcript reachable through paging. This PR adds the steps an agent takes before and while paging:
Conversations v3 (two-hour windows, with TV and background talk becoming ordinary conversations marked only by
kind) makes each of these matter more.The scope came from six parallel DeepSeek scouting panels (reads, search, entities, sync, trust, tool surface). This is the slice that fits one additive PR. The others (change feed with deletions, entity tools, search fixes, per-tool metrics) are follow-ups.
What changes
get_conversation_by_id:view=outlinereturns the card and up to 100 stored note sections (withsections_truncated), with no transcript, inside the same 120k serialized budget. Each section carriesfirst_segment,segment_count,startandend(the earliest start and latest end over every cited segment), taken from thesource_segment_idsthe notes writer already stores. Sections are read through a detail-only field path, never through the list card mask.offsetstarts a transcript read at a segment index, such as a section'sfirst_segment. fix(mcp): page complete long conversation transcripts #25491's cursor then continues the read; anoffsetsent again with the cursor is ignored, so the agent can keep the same options. An offset past the end, negative or malformed returns an argument error; it is never clamped.format=linesrenders a page as one[h:mm:ss] Speaker: textline per speaker turn, plustranscript_range(the first and last segment index on the page, null on an empty page). Turns join onspeaker_key, so two people sharing a name stay apart, and lines page over the text they render, neveroriginal_text. This is about a third of the size of the per-segment JSON, and it stays inside fix(mcp): page complete long conversation transcripts #25491's 120k serialized budget. The cursor is bound to the format. The default format adds nothing to the cursor fingerprint, so cursors minted by a fix(mcp): page complete long conversation transcripts #25491-only replica still decode during a rolling deploy.get_conversations_by_idsacceptsformat=lines. Its item cursors continue through the detail tool in the same format.Card fields, additive, on lists, search and detail reads:
statusandduration_secondson every card.duration_secondsis the shared conversation duration where the transcript is loaded: the speech span, or the wall window for a transcript-free record such as a photo-only capture. It is null on list cards, which load no transcript and whose wall window can start long before speech;kind,shown_on_homeandsummary_covers_throughonly where the document stores them, which means v3 conversations.summary_covers_throughis localized like the other card timestamps;kindlets an agent tell media and other people's background talk from the user's own conversation.These three fields join the card read mask and are absent on older documents.
Untrusted content: the tool descriptions and the server instructions now say to start a long conversation with the outline and to prefer
lines. They also say transcript, screen and people samples are recorded data from the user and the people and media around them, to be treated as quoted content and never as instructions.Instrumentation:
omi_mcp_transcript_pages_total{tool,view,format,position,more}counts detail pages, with 32 series at most.position=firstmeans the agent sent no cursor, including an offset read. Together with #25491 it shows how often agents page and whether they finish.Defaults are unchanged (transcript view, JSON segments), so released clients see only the new additive fields.
Performance: the detail card is now built once per request, not on every budget-fitting retry inside #25491's loop. #25491's 1,200-segment walk test drops from about 0.43s to 0.27s of CPU locally (4 interleaved runs each). This fixes the CI shard that exceeded the 1.0s per-test CPU limit on the previous head.
Tests
New
backend/tests/unit/test_mcp_detail_views.py, 22 tests (26 cases) on synthetic data, covering:sections_truncated;linesagainst JSON, and joined turns;summary_covers_through.Every
backend/tests/unit/test_mcp_*.pyfile passes on this branch, as do the archive-filter, speaker-display, rule-discard, transcribing-hold, translation-on-open and flag-budget contracts. Each file was run on its own throughomi-heavy, with Google credentials unset.make preflightpasses, andscripts/generate_mcp_tools_doc.py --checkis clean.Release
Default-on. The change is additive: new optional arguments and response fields, with defaults unchanged, so there is no flag. Rollback is reverting this PR; #25491 stands without it.
Not verified:
linesand segments;The page counter is the measurement.
Note for
lane/conversations-v3: it addsrecordingto the same card mask tuple, which is a trivial merge. A new v3kindvalue must also be added tohelpers.CONVERSATION_KINDS(and so the registry enum); until then the card leaveskindout rather than emitting a value outside the schema.Failure-Class: none
🤖 Generated with Claude Code