Repository navigation
chore: flag review batches 1–2 — graduate 6, reclassify 5, delete 3 never-run flags - #20959
Conversation
This reverts commit d7096c2.
Codex Review SummaryThis 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: d5aa934a6c
ℹ️ 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".
| upsert_transcript_chunk_vectors(uid, conversation.id, chunks) | ||
|
|
||
|
|
||
| def save_structured_vector(uid: str, conversation: Conversation, update_only: bool = False) -> None: |
There was a problem hiding this comment.
Remove the deleted dump site from the exact-set test
Deleting save_transcript_chunk_vectors leaves its DumpSite entry in backend/tests/unit/test_client_processing_trust_boundary.py. That suite computes the current serialization sites and asserts exact equality with PINNED_CONVERSATION_DUMPS, so the full backend unit run now fails with this entry reported as gone; remove the stale pin together with the function.
Useful? React with 👍 / 👎.
| except Exception as e: # noqa: BLE001 - transcript index is optional / best-effort | ||
| logger.warning("mcp conversation search: transcript chunk search failed uid=%s: %s", uid, sanitize(str(e))) | ||
| return merge_summary_and_transcript_ids(transcript_ids, summary_ids, limit) | ||
| return query_vectors(query, uid, starts_at=starts_at, ends_at=ends_at, k=limit, **vector_kw) or [] |
There was a problem hiding this comment.
Update tests that still require MCP chunk searches
After this resolver stops calling search_transcript_chunks, the existing backend suite still requires that call: the REST/SSE cases in test_mcp_search_date_utc.py assert that the chunk callback receives the date bounds, and test_mcp_search_conversations_poison.py::test_transcript_chunk_hit_included_when_summary_misses expects a chunk-only result. Those tests now fail deterministically because their capture dictionaries remain empty and the transcript-only search returns no IDs, so migrate or remove these obsolete assertions with the production branch.
AGENTS.md reference: backend/AGENTS.md:L203-L211
Useful? React with 👍 / 👎.
|
|
||
| def configured_chain_enabled() -> bool: | ||
| return os.getenv('STT_CONNECT_ORDER_FROM_CONFIG', 'false').lower() == 'true' | ||
| return True |
There was a problem hiding this comment.
Migrate legacy fallback tests before enabling the chain globally
Making configured_chain_enabled() unconditional routes every default connect_stt_socket_with_fallback invocation through live_chain, but the unmodified fallback suites still assert legacy-only behavior. For example, test_parakeet_connection_fallback.py::test_capacity_rejection_falls_back_to_modulate_without_poisoning_circuit requires circuit.record_rejection('capacity_full'), while the configured-chain implementation contains no record_rejection call, so this test now fails on every run; update the legacy helper tests to opt out explicitly or assert the graduated chain contract.
AGENTS.md reference: backend/AGENTS.md:L203-L211
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44c1334317
ℹ️ 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".
| # The route half stays local so this module's gateway seam remains patchable; | ||
| # the kill-switch half is owned once, in prompt_cache, for every caller. | ||
| return should_route_features_through_gateway() and explicit_cache_switch_enabled() | ||
| return should_route_features_through_gateway() |
There was a problem hiding this comment.
Update remaining tests after removing the cache switch seam
Removing explicit_cache_switch_enabled from this module leaves test_episode_evidence.py::test_episode_static_prefix_keeps_explicit_cache_breakpoint and two paths in test_llm_feature_prompt_cache_prefix.py calling monkeypatch.setattr(..., 'explicit_cache_switch_enabled', ...). Because monkeypatch.setattr raises when the attribute is absent, the full backend suite now fails before those cache assertions run; migrate these remaining tests to the graduated always-on contract as part of retiring the seam.
AGENTS.md reference: AGENTS.md:L34-L34
Useful? React with 👍 / 👎.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # backend/docs/feature-flag-registry.md # config/feature-flags.yaml
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
## 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.
Summary
Graduate six backend flags whose on behavior is already deployed in dev and prod; reclassify five retained operational/configuration switches; remove three never-run paths. This branch now includes current
origin/main(7df9927972) through merge commite6402b74d7.STT_CONNECT_ORDER_FROM_CONFIGSTT_SERVICE_MODELSorder; remove the fixed-order branch and declarations, update validator, soak manifest, and hermetic STT provider fake.MEETING_NOTES_RICH_CONTEXT_ENABLEDMEETING_NOTES_SCREEN_TEXT_CONTEXT_ENABLEDOMI_LLM_GPT56_EXPLICIT_CACHE_ENABLEDMENTOR_GATE_DEBOUNCE_ENABLEDMENTOR_GATE_PROMPT_CACHE_ENABLEDgate_cache_supported()capability check.MEMORY_CANONICAL_CONSOLIDATION_ENABLEDVAD_GATE_MODEOMI_GEMINI_OVERFLOW_ENABLEDRATE_LIMIT_SHADOW_MODEMEETING_RECEIPT_RECONCILER_ENABLEDMEMORY_CANONICAL_GRAPH_BACKFILL_ENABLEDTRANSCRIPT_CHUNK_INDEXING_ENABLED/v1/dev/user/asktranscript fallback and stale test contracts; preserve snippet extraction.SYNC_BACKFILL_ROUTING_ENABLEDTranscript search review
backend/database/vector_db.pydefinesTRANSCRIPT_CHUNKS_NAMESPACE = "ns_tchunks"(line 1115), uses it forsearch_transcript_chunks(line 1184), and writes it only throughupsert_transcript_chunk_vectors(line 1147). Repository-wide production-code search found no otherns_tchunkswriter. Onorigin/main, the sole production call to that upsert wassave_transcript_chunk_vectorsinbackend/utils/conversations/process_conversation.py, submitted only behindTRANSCRIPT_CHUNK_INDEXING_ENABLED(old lines 2323–2334 and 3337–3340). That flag defaulted false and was never enabled in the checked-in deployment declarations. The remaining direct upsert call is a fake-backed E2E test, not a production writer. Thus the developer ask fallback could not return a transcript hit in prod; the route now uses its Typesense results directly and its transcript-only-hit test contract is removed. Other optional legacy chunk readers remain outside this route.Sync backfill routing decision
backend/utils/cloud_tasks.py(enqueue_sync_job, lines 291–327) selectsSYNC_BACKFILL_TASKS_QUEUEandSYNC_BACKFILL_TASKS_HANDLER_URLonly whenSYNC_BACKFILL_ROUTING_ENABLEDis true and the payload lane is backfill; otherwise it enqueues toSYNC_TASKS_QUEUE. Both direct admission (backend/routers/sync.py, near line 1337) and the UID sequencer (backend/utils/sync/uid_sequencer.py,_dispatch) call that function. The deploy action (.github/actions/sync-backfill-lifecycle/action.yml, lines 83–105) supplies the dedicated queue and handler URL and (lines 98–133) clones the livebackend-syncenvironment intobackend-sync-backfill. David confirms the flag is true on both prod services. The checked-in action does not explicitly assign that literal value, andruntime_envdoes not declare it; no live GCP state was queried for this PR. The ops kill setting therefore preserves the branch and records the rollback route.Invariants
INV-MEM-4: canonical promotion remains the sole Long-term admission authority; only the disabled graph-backfill step is removed, and the consolidation incident switch remains.INV-MEM-1: the three memory tiers and default access policy remain unchanged.INV-TASK-2: capture task authority remains suggestion only; meeting-note context changes do not add task writes.Failure-Class: none
Verification
python3 backend/deploy/compose_runtime_env.pyandbackend/scripts/check_runtime_env_compose.sh: pass.python3 scripts/check_feature_flag_registry.pyandpython3 scripts/render_feature_flag_registry.py --as-of 2026-10-06: pass; rendered doc current.python3 scripts/test_check_feature_flag_registry.py: 21 pass.python3 backend/scripts/verify_pusher_cohost_env_diff.py: pass in dev and prod.BACKEND_UNIT_TEST_FILE_LIST=.local/agent-tasks/backend-test-files.txt bash backend/test.sh: all 20 touched backend test files passed after stabilizing pusher mutation fixtures (28 pusher tests passed).Fix round 1 after merging current main:
BACKEND_UNIT_TEST_FILE_LIST=<absolute path to .local/agent-tasks/fix-round1-tests.txt> bash backend/test.sh: 8 developer ask, 106 sync routing, and 51 trust-boundary tests passed. The seven prior websocket CI failures pass in the targeted hermetic E2E run. Full hermetic E2E passed 124, skipped 3, xfailed 2 withE2E_PYTEST_TIMEOUT=240s(101.63s of pytest work); two default-120s runs on this loaded Mac timed out with no test failures reported. An exploratory nine-file unit run passed assertions but tripped the 0.30s timing guard on an unrelated memory import test; those vector API stubs remain outside this diff.PATH=/opt/homebrew/bin:$PATH OMI_PR_BODY_FILE=.local/agent-tasks/pr-body.md scripts/pr-preflight: 45 checks passed against merged head44c1334317.Backend
scripts/typecheck.shafter unused-import cleanup: 0 errors (warnings remain).