Skip to content

fix(chat): search saved transcripts and gate unverified recall - #23792

Merged
aryanorastar merged 8 commits into
mainfrom
codex/transcript-recall-20629
Oct 27, 2026
Merged

aryanorastar merged 8 commits into
mainfrom
codex/transcript-recall-20629

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and behavior

Closes #20629. Chat could miss a fact present only in saved speech, then produce a precise unsupported answer after a request to check again. Semantic retrieval queries summaries and an optional transcript index; automatic transcript indexing was retired by #20959, and the old backfill covers only existing history.

Explicit transcript recall now reads current saved transcripts through search_conversations_tool(transcript_query=...) and the shared REST service. It finds unindexed old and new recordings without restoring indexing, copying speech to another store or requiring a per-account backfill.

  • Bound each page to at most 50 raw documents and six seconds overall, reserving a four-second IO budget. Signed cursors bind owner, literal query and exact date bounds, preserve ordering/deleted-bookmark progress and resume before unreturned matches. Locked, deleted, discarded, Dream-folded and processing-deferred records supply no excerpts.
  • Reuse current conversation decryption and correction projection. Both scan and exact-record paths pass the remaining IO timeout and disabled retries through correction lookups. Correction deadline exhaustion stops the read instead of citing uncorrected fallback speech. Existing unbudgeted reads and transaction ownership retain their contracts.
  • Anchor bounded verbatim cropping to the actual matching segment, preferring its complete phrase over partial words in context. A crop that loses the match supplies no evidence. Mobile citations stay stable; REST previews contain the actual quote. Spoken UUIDs remain literal queries on continuation.
  • Both legacy OpenAI and shaped chat runners share a turn-local evidence gate. After an explicit transcript read with no source, withhold the model's follow-on text and stream/persist the same honest unverified reply. Tool continuations can still obtain evidence on a later page. This is deterministic boundary enforcement, not a live-model quality benchmark or universal fact checker.
  • Correct the hermetic Firestore fake's reversed multi-field ordering, independently checked with the real SDK/emulator. The timeout guard's test-only scanner optimization retains its rules, one-second CPU limit and Python fallback; nested/decorator/default calls and hidden/untracked/ignored-file regressions remain covered.

Verification

Revision: 09a20f4dab2710660cf758437f44750721598bd4.

  • 531 focused backend tests passed across 24 files, including 19 review-fix regressions, scripted hostile provider output on initial/check-again turns, positive evidence, both serving runners, privacy, cursor, failure and compatibility coverage.
  • Seven Firestore query/index guard files: 791 passed, one existing deselection. No new index is required.
  • Full hermetic HTTP suite: 140 passed, three skipped, two expected failures. Routes/auth, saved reads/decryption, pagination, correction timeout, quoted previews and scoped mobile citations execute production code; storage and external providers use documented harness fakes.
  • Actual Firestore SDK against a loopback-only emulator: five tests passed, covering tied ordering/deleted bookmarks/new arrivals and both compressed/encrypted correction projections through scan and exact reads. Synthetic data only.
  • Both reported review regressions fail on the prior green head 74952c7a49 and pass after these fixes. No timeout, assertion or allowlist was relaxed.
  • Mandatory normal push gate passed: all 39 preflight checks, zero backend typecheck errors (existing warnings remain), selected units, API compatibility and runtime-image closure. The local history ratchet's documented shallow-history skip is not claimed as enforcement; remote full-history CI is authoritative.
  • Current-commit CI: green on this exact commit: all six backend shards and overall unit suite, guardrails, HTTP E2E, emulator proofs, both stack gauntlets, public API contracts, hygiene, formatting, CodeQL and Dart Analyze & Tests passed. Snapshot: 39 successful checks and 25 scoped skips; skips are not claimed as executed.

Delivery

Keep this PR draft for review. Merge and backend deployment remain separate steps. No mobile store release, retired indexing flag, schema/index provisioning or customer backfill is needed for the direct path. Existing semantic requests, MCP and native desktop local tool manifests retain their contracts. Historical account/customer confirmation remains separate Support work. No merge, deployment, production-data mutation, backfill or assignment change was performed.

Product invariants affected

none

Failure-Class: FC-chat-search-skips-transcript-evidence

UI-Evidence: none -- backend retrieval and streaming policy only; no client layout or styling changed.

Line-Count-Exception: backend/utils/retrieval/agentic.py | 1916 -> 1937 | Keep the two serving-loop integration points beside existing stream ownership; shared instructions and turn-local policy live in transcript_recall.py.

Line-Count-Exception: backend/database/conversations.py | 4550 -> 4561 | Thread the optional read budget through the existing exact-conversation no-photo reader and both correction projection codecs; existing unbudgeted callers keep their default behavior.

Read bounded, owner/query/date-bound transcript pages directly, preserve
verbatim source citations, and suppress model follow-on facts when an
explicit transcript read supplies no evidence in either serving runner.

Verified: 291 focused backend tests; 791 Firestore guard tests; full hermetic
E2E 137 pass / 3 skip / 2 xfail; final two HTTP journeys pass; actual SDK
Firestore-emulator cursor/date test passes; backend typecheck zero errors.
Both new HTTP regressions fail on unchanged main 90c2a97.

Refs #20629
Failure-Class: FC-chat-search-skips-transcript-evidence
Reserve read headroom and bound matching/rendering before publishing a source;
resume before the unreturned match on deadline. Verify both streamed and
persisted answers against the no-evidence guard and align legacy backfill docs.

Verified 292 focused backend tests, including the rendering-deadline regression.
Failure-Class: FC-chat-search-skips-transcript-evidence
@mintlify

mintlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 27, 2026, 6:46 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@aryanorastar
aryanorastar marked this pull request as ready for review October 27, 2026 10:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T10:18:40.226045Z 09a20f4 Draft marked ready
ℹ️ 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.

@aryanorastar
aryanorastar merged commit 6b7fbc2 into main Oct 27, 2026
69 checks passed
@aryanorastar
aryanorastar deleted the codex/transcript-recall-20629 branch October 27, 2026 10:15
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.

Chat transcript search can say no match, then give an unsourced answer after pushback

1 participant