Skip to content

chore: flag review batches 1–2 — graduate 6, reclassify 5, delete 3 never-run flags - #20959

Merged
Git-on-my-level merged 15 commits into
mainfrom
lane/flag-review-b12
Oct 8, 2026
Merged

Git-on-my-level merged 15 commits into
mainfrom
lane/flag-review-b12

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

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 commit e6402b74d7.

Flag Ruling Change
STT_CONNECT_ORDER_FROM_CONFIG graduate Always use configured STT_SERVICE_MODELS order; remove the fixed-order branch and declarations, update validator, soak manifest, and hermetic STT provider fake.
MEETING_NOTES_RICH_CONTEXT_ENABLED graduate Always gather rich meeting context; remove the off branch and declarations.
MEETING_NOTES_SCREEN_TEXT_CONTEXT_ENABLED graduate Always include permitted screen text context; remove the off branch and declarations.
OMI_LLM_GPT56_EXPLICIT_CACHE_ENABLED graduate Keep explicit cache behavior unconditionally and remove the switch.
MENTOR_GATE_DEBOUNCE_ENABLED graduate Always apply mentor gate debounce and remove the switch.
MENTOR_GATE_PROMPT_CACHE_ENABLED graduate Remove the env gate while retaining gate_cache_supported() capability check.
MEMORY_CANONICAL_CONSOLIDATION_ENABLED ops_kill Keep the runtime read/default; document pulling it for corrupt or mass-rewritten memories.
VAD_GATE_MODE config_switch Preserve off/shadow/active and per-session override; reclassify the registry entry.
OMI_GEMINI_OVERFLOW_ENABLED ops_kill Keep the default-on cost stop; record backend and llm-gateway surfaces.
RATE_LIMIT_SHADOW_MODE ops_kill Keep the misfiring-limit escape hatch and document when to use it.
MEETING_RECEIPT_RECONCILER_ENABLED kill Remove historical receipt seeding and startup/shutdown calls; leave durable receipt projection intact.
MEMORY_CANONICAL_GRAPH_BACKFILL_ENABLED kill Remove the disabled canonical graph backfill step.
TRANSCRIPT_CHUNK_INDEXING_ENABLED kill Remove disabled indexing; remove the dead /v1/dev/user/ask transcript fallback and stale test contracts; preserve snippet extraction.
SYNC_BACKFILL_ROUTING_ENABLED ops_kill Keep the flag and routing branch; document setting false to send backfill jobs to the main sync queue if the backfill service misbehaves.

Transcript search review

backend/database/vector_db.py defines TRANSCRIPT_CHUNKS_NAMESPACE = "ns_tchunks" (line 1115), uses it for search_transcript_chunks (line 1184), and writes it only through upsert_transcript_chunk_vectors (line 1147). Repository-wide production-code search found no other ns_tchunks writer. On origin/main, the sole production call to that upsert was save_transcript_chunk_vectors in backend/utils/conversations/process_conversation.py, submitted only behind TRANSCRIPT_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) selects SYNC_BACKFILL_TASKS_QUEUE and SYNC_BACKFILL_TASKS_HANDLER_URL only when SYNC_BACKFILL_ROUTING_ENABLED is true and the payload lane is backfill; otherwise it enqueues to SYNC_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 live backend-sync environment into backend-sync-backfill. David confirms the flag is true on both prod services. The checked-in action does not explicitly assign that literal value, and runtime_env does 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.py and backend/scripts/check_runtime_env_compose.sh: pass.

  • python3 scripts/check_feature_flag_registry.py and python3 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 with E2E_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 head 44c1334317.

  • Backend scripts/typecheck.sh after unused-import cleanup: 0 errors (warnings remain).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T12:40:13.087114Z 44c1334 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: 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Git-on-my-level Git-on-my-level changed the title chore: flag review batches 1–2 — graduate 6, reclassify 4, delete 4 never-run flags chore: flag review batches 1–2 — graduate 6, reclassify 5, delete 3 never-run flags Oct 8, 2026

@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: 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

# Conflicts:
#	backend/docs/feature-flag-registry.md
#	config/feature-flags.yaml
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level
Git-on-my-level merged commit fc4c195 into main Oct 8, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/flag-review-b12 branch October 8, 2026 17:24
aryanorastar added a commit that referenced this pull request Oct 27, 2026
## 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.
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