Skip to content

feat(mcp): outline-first, offset and lines reads, and conversation state on cards - #25497

Merged
Git-on-my-level merged 9 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/mcp-progressive-reads
Nov 16, 2026
Merged

Git-on-my-level merged 9 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/mcp-progressive-reads

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Builds on #25491 (transcript paging), now merged; this branch merges main after it. The changes are three commits: bf8f679b866 (the feature), b98bc11b33f (panel review follow-ups and a CPU fix) and 18f5b6476d4 (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:

  • see what a conversation covers;
  • jump to the part it needs;
  • read that part compactly;
  • know what kind of talk it is.

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=outline returns the card and up to 100 stored note sections (with sections_truncated), with no transcript, inside the same 120k serialized budget. Each section carries first_segment, segment_count, start and end (the earliest start and latest end over every cited segment), taken from the source_segment_ids the notes writer already stores. Sections are read through a detail-only field path, never through the list card mask.
  • offset starts a transcript read at a segment index, such as a section's first_segment. fix(mcp): page complete long conversation transcripts #25491's cursor then continues the read; an offset sent 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=lines renders a page as one [h:mm:ss] Speaker: text line per speaker turn, plus transcript_range (the first and last segment index on the page, null on an empty page). Turns join on speaker_key, so two people sharing a name stay apart, and lines page over the text they render, never original_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_ids accepts format=lines. Its item cursors continue through the detail tool in the same format.

Card fields, additive, on lists, search and detail reads:

  • status and duration_seconds on every card. duration_seconds is 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_home and summary_covers_through only where the document stores them, which means v3 conversations. summary_covers_through is localized like the other card timestamps;
  • a v3 kind lets 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=first means 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:

  • outline anchors, including uncited and unknown ids, and that transcript reads skip the sections field;
  • the bounded outline with sections_truncated;
  • the offset-then-cursor path, offsets at and past the end, and rejected negative or malformed offsets;
  • the unchanged cursor fingerprint for the default format;
  • the size of lines against JSON, and joined turns;
  • lines cursors bound to the format, and batch lines continuation;
  • locked conversations refused on every view;
  • invalid arguments;
  • the page counter;
  • card state on legacy and v3 documents, null duration on list cards, and localized summary_covers_through.

Every backend/tests/unit/test_mcp_*.py file 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 through omi-heavy, with Google credentials unset. make preflight passes, and scripts/generate_mcp_tools_doc.py --check is 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:

  • how ChatGPT and Claude choose between lines and segments;
  • live connector behaviour.

The page counter is the measurement.

Note for lane/conversations-v3: it adds recording to the same card mask tuple, which is a trivial merge. A new v3 kind value must also be added to helpers.CONVERSATION_KINDS (and so the registry enum); until then the card leaves kind out rather than emitting a value outside the schema.

Failure-Class: none

🤖 Generated with Claude Code

…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]>
@mintlify

mintlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 3b8145a.

Approve preview

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T19:12:23.059783Z 3b8145a New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread backend/utils/mcp_server/helpers.py Resolved
Git-on-my-level and others added 2 commits November 16, 2026 22:14
…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]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Git-on-my-level and others added 2 commits November 17, 2026 00:12
…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]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Git-on-my-level and others added 3 commits November 17, 2026 00:42
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]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread backend/utils/mcp_server/helpers.py Resolved
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]>
@Git-on-my-level
Git-on-my-level merged commit e7d582e into BasedHardware:main Nov 16, 2026
58 checks passed
Git-on-my-level added a commit to Git-on-my-level/omi that referenced this pull request Nov 16, 2026
…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]>
Git-on-my-level added a commit that referenced this pull request Nov 16, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant