Skip to content

fix(app): migrate #21829 decode site to typed client (unbreak backend unit inventory) - #21925

Merged
Git-on-my-level merged 3 commits into
mainfrom
fix-app-client-inventory-21829
Oct 16, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
fix-app-client-inventory-21829

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

  • Decode the daily summaries response directly with GeneratedDailySummariesResponse so the OpenAPI inventory recognizes the generated response boundary.
  • Keep missing or null summaries as a failed read.
  • Add the required internal-only mobile release fragment.

Verification

  • cd backend && printf '%s\n' tests/unit/test_app_client_schema_inventory.py > /tmp/omi-app-client-inventory-test-list.txt && BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-app-client-inventory-test-list.txt nice -n 19 bash test.sh — 13 passed, including test_inventory_openapi_route_response_decode_migration_complete.
  • nice -n 19 make preflight — 24 checks passed.
  • flutter analyze not run: the app worktree has no .dart_tool/package_config.json, so package resolution is unavailable.

Product invariants affected

none

UI-Evidence: none -- no UI changes
Failure-Class: none

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T19:03:58.831421Z 8fc031f 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.

@Git-on-my-level
Git-on-my-level merged commit bfd3a97 into main Oct 16, 2026
54 of 56 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix-app-client-inventory-21829 branch October 16, 2026 19:39
Git-on-my-level added a commit that referenced this pull request Oct 16, 2026
Overlapping captures can currently group on matching text found anywhere
in their transcripts, while same-source duplicates are excluded. Add a
default-off deterministic rule requiring ordered, time-aligned sentences
and enough matched speech inside the actual overlap. It uses the
existing reversible capture-group writer; transcripts, summaries,
memories, tasks and source records remain independent.

The matcher ignores speaker labels and tolerates isolated bad timing by
excluding that line from evidence and charging its words as unmatched
vocabulary. Hard storage/CPU limits abstain. A single-snapshot reader
bounds decryption/decompression before parsing, excludes mutable
correction overlays, and fences all member fingerprints/windows, group
revision, eligibility and locks at commit. New entrants must
independently match every existing member. See
`backend/docs/operational/capture-shared-speech.md` for the contract,
bounds and full per-class calibration.

`CAPTURE_SHARED_SPEECH_MODE=off|shadow|on` defaults off, with an empty
UID allowlist and 0% cohort. Shadow preserves incumbent grouping and
logs identifiers/numeric verdicts only. On can admit proven same-source
duplicates and reject unsupported automatic folds, but is not qualified
by this evidence. Existing groups remain intact; Separate stays sticky.
Jev and smart merge remain separate.

## Calibration

Original timed transcripts matched all 29 David cards locally. Exclude
10 unsure labels; none folds. Among 19 decisive pairs (13 same/6
different), TP4/FP0: precision100% (95% Wilson51.0–100), recall30.8%
(12.7–57.6). Cross-source TP2/5, FP0/2; same-source/same-device TP2/8,
FP0/4. Both high-bag-overlap negatives remain apart.

September agent benchmark:96 decisive pairs (56 same/40 different),
TP1/FP0: precision100% (20.7–100), recall1.8% (0.3–9.5). Held-out
TP0/20, FP0/14. No folds on its8 excluded pairs. Captures correlate and
the benchmark's older same-scene target differs; do not pool these
cohorts or infer fleet safety from zero observed errors. Concurrent
common broadcast speech remains a semantic limitation. Private data
stays local; only aggregates are published.

## Review and validation

Five agentctl reviews used codex/gpt-6-luna with read_only access.
Boundary evidence, all-member eligibility/lock races, mutable
corrections and pre-matcher unbounded decoding findings were fixed.
Final core review9a90a14 found no feature blockers. Final API-boundary
review98a640e8172 found no blockers and confirmed equivalent
validation/type promotion. Dark/shadow qualified; on unqualified.
Subsequent changes are the documented internal changelog marker and
upstream merges/registry rendering, with no material owned feature
change. Main independently landed the canonical recap decoder fix
(#21925); this branch now takes that upstream file exactly.

- 88 synthetic matcher/grouping/storage cases;70 existing group/call
cases pass.
- Canonical inventory suite13tests and mobile-verify9journeys pass
(clean98a640e,0failures/0skips).
- Repository source preflight43checks, full backend typecheck0errors,
runtime image source closure and formatting passed on11610e3. Repeat
push checks and exact-head terminal CI gate the updated main merge.
- CI197d787 exposed an unrelated inventory association false positive in
`getDailySummaries`. Main subsequently fixed the canonical typed-client
boundary in #21925, and this branch adopts that upstream source
unchanged. The inventory gate remains unchanged. The internal-only
`kind:none` changelog fragment makes no user-facing behavior claim.

## Authorized production qualification

David's coordinator narrowed shipping to the four Cloud Run hosts:
backend, backend-sync, backend-sync-backfill and backend-integration.
After exact-head green CI and merge commit, use workspace
`bin/omi-deploy-prod wait-eligible` / `cloud-run`, approving only this
owner's run. Prepare previous eligible release_sha rollback before
dispatch and watch >=15min for5xx, fixed error signatures and
effectiveoff.

Then a separate runtime_env config PR enables shadow on Cloud Run only,
followed by another Cloud Run deploy/watch and >=3h clean shadow
comparison. Stop at shadow; no account may be enabled on. Pusher/listen
remain off and receive dark code via their regular train owned by
others; no dedicated deployment is dispatched. The documented
context-qualified Pusher Helm fallback is incident-only.

Updated main througha4cce4c3099. Preserved all314 upstream flag entries
unchanged and all3 shared-speech entries, placing ours beside the
existing capture-group flags to avoid recurring independent top-of-file
additions. Rendered with `--as-of 2026-10-16`; no feature predicate
changed. Related:#14835.

## Product invariants affected

none

Failure-Class: FC-same-speech-captured-twice-surfaces-twice

UI-Evidence: none -- Equivalent API payload validation at an existing
generated decoder; no rendered UI changes.
Git-on-my-level added a commit that referenced this pull request Oct 17, 2026
## Demand-driven processing

Add default-off surface leases, immediate dispatch with tier priority
under contention through existing Cloud Tasks workers, open-time
promotion, and coalesced lazy memory/vector/task work. Expose
`process_recent_conversations` to app chat, shared Telegram/Linq chat
and hosted MCP with authenticated owner binding,
six-hour/twenty-obligation bounds and a shared rate limit.

Phone and Mac reporters renew explicit intent independently of audio
sockets. Mac intent measures the main window. The end-of-day hook is
omitted under David's updated 2026-10-16 KB rulings. Daytime merge
decisions and proactive notification priority remain unchanged.

## Product invariants affected

- INV-AUTH-1: lease reporting captures and revalidates the current
authorization generation; it never changes Firebase session state.
- INV-DATA-1: desktop deploy declarations retain the existing customer
identity/data-plane authority; only default-off demand controls are
added.
- INV-CAP-1: capture/intake and durable audio retention are preserved;
only processing dispatch changes.
- INV-MEM-4: lazy work uses the existing canonical memory writer and
privacy fences, without a second promotion authority.
- INV-TASK-2: lazy tasks use the existing suggestion/capture policy and
do not accept suggestions automatically.

Failure-Class: none
UI-Evidence: none -- changes report lifecycle intent; no rendered view
or navigation changes.

## Rollout plan

Config trains are documented in
`backend/docs/runbooks/demand-driven-processing.md`: default-off image
-> explicit owner client reporting and scheduler allowlist (0%) -> lazy
work -> agent tool -> 1% -> 5% with >=30 minutes of clean sentinel
readouts at each step -> 25/50/100 only after acceptance. No production
flag change or deployment is included.

Measure per-tier queue age, existing end-to-end finalization journeys,
retry/dead-letter and outbox repair counts, visible quality, memory/task
completeness and live p95. Qualification requires tier 0 <=1m, tier 1
p95 <=5m, tier 2 <=60m; newest 20m <=2m and newest hour <=4m on
simultaneous opens. Scheduling headroom is not a measured freshness
guarantee. Roll back admission flags while retaining workers/sweeps to
drain durable debt. No GPU/cost saving is claimed.

## Validation

- Targeted backend: **490 passed** across twelve targeted files using
the repository file-list runner, one worker and `nice -n 19`. Includes
tier assignment/promotion/drain/ceiling and idle-capacity dispatch,
shared outbox recovery, visible/lazy split, synthetic-owner ASGI auth,
registration/recovery-read avoidance, tool auth/bounds.
- Flutter `listen_client_state_test.dart`: 8 passed. Focused Mac
`ListenClientStateTests`: 9 passed, including URL normalization; the
final incremental run compiles the regenerated additive API types.
- Local HTTP smoke: real loopback HTTP -> production surface handler ->
fake Redis -> recorded Cloud Tasks; open intent promoted pending work to
tier 0. No live cloud acceptance is claimed.
- Full backend Pyright: 0 errors, 36,017 warnings; async blocker scan: 0
findings; changed production import scan: 0 violations.
- Schema inventory, full MCP transport/output schemas, prompt-cache
inventory and pusher config snapshots pass.
- Runtime fixture/renderer contracts: 219 passed; workflow actionlint:
both changed workflows pass. Runtime compose check and dev/prod
validators pass; source closure passes for all 17 images. OpenAPI and
generated Swift/TypeScript contracts regenerated; Dart model freshness
passes.
- Final-head repository preflight passed 83 selected checks;
final-head/push-hook receipts are recorded in the run handoff. Config
trains, metrics, rollback and load/quality gates are in the runbook.

## Limits

The earlier upstream daily-summary decoder inventory failure is fixed by
#21925, now integrated from main (`bfd3a973ed4`). The Grok fix commits
do not implement that unrelated client migration. Full CI is not claimed
green.

The tool promotes the caller's indexed recent debt and reports
`ready=false`; it does not scan Firestore for pre-rollout historical
work. Existing durable reconciliation owns unindexed debt. Full
peak-load and provider qualification are rollout gates. The newer KB
rulings remove item 5 from this PR; #21836 and lazy speaker refinement
remain separate work.

## Grok fixes

- Preserve production's 600-second trailing-edge sync settle when the
master switch is enabled, including tier 0/open promotion, Redis-loss
enqueue fallback and the durable worker claim. Appends continue to
extend one outbox obligation; invisible effects retain explicit-demand
bypass.
- Retain close/occlusion changes during in-flight Mac and phone reports.
Mac re-reads visibility after asynchronous header preparation; both
clients drain queued state changes after send and retry failed closes on
closed heartbeats without spinning.
- Only explicit boolean `surface_open` counts as listen intent. Released
iOS/Android/mobile/Mac telemetry remains unchanged when server flags
turn on.
- Targeted regression run: 490 backend tests passed across twelve files,
one file worker at a time via `BACKEND_UNIT_TEST_FILE_LIST`, `nice -n
19`. Mac lifecycle/race tests: 9 passed. Phone lifecycle/race tests: 8
passed. Detailed receipts are recorded in the run handoff.
- Merged main's #21923 telemetry (`a4cce4c3099`) while retaining strict
surface intent and both documentation sections; telemetry and demand
policy regression tests pass.
- Merged main's T0 config train (#21887, `acfcd8ed0d4`), regenerated
runtime/registry output, and verified all 96 demand defaults remain
off/empty/zero while every other runtime value exactly matches main.
Sync settle remains 600 seconds; 55 Helm/cohort/parity checks pass.
- Continue from the lead's `fb698130b3e` merge of main, without
rebasing. The two desktop deploy workflows retain only six additive
default-off env lines each; **David approved these exact workflow lines
in the final-main-sync instruction**. No merge, deploy or runtime
configuration change is included.

## Main sync 2026-10-17

Merged `origin/main` at `6e7007e3e35` without rebasing. Resolved eight
conflicts by retaining both additive config/registry/test sets and both
post-persistence processing paths. Demand mode retains its 59-minute
ceiling and 600-second trailing settle; upstream revision reuse alone
retains its 60-minute ceiling. Both enabled use the existing demand
headroom, covered by the four-way flag matrix and Redis/open-state
settle tests. No intentional change to Grok-approved semantics.

Targeted merge validation: **434 passed across nine files**, canonical
`BACKEND_UNIT_TEST_FILE_LIST` runner, `BACKEND_PYTEST_WORKERS=1`, `nice
-n 19`. All 96 demand defaults remain off/empty/zero and every other
runtime value matches main. The two workflow diffs remain exactly six
additive default-off lines each; David has approved these exact workflow
lines. Detailed conflict resolutions and final publication receipts are
appended to the run handoff.

## Final main sync

Merged `origin/main` at `3a4fe148259` without rebasing. The only
conflict was generated `backend/docs/feature-flag-registry.md`;
regenerated it from the merged sources with `--as-of 2026-09-24`, and
recomposed/checked runtime env. Seven key Grok-reviewed production files
are byte-identical to `66bdc353202`; all 96 demand defaults remain
off/empty/zero and every other runtime value matches main. No reviewed
semantic change.

**303 targeted tests passed across four files**, using
`BACKEND_UNIT_TEST_FILE_LIST`, `BACKEND_PYTEST_WORKERS=1` and `nice -n
19`, serially. The workflow edits remain exactly six additive
default-off `DEMAND_PROCESSING_*` lines in each approved file and are
unchanged from the Grok-reviewed head. **David's scoped approval is
recorded.** No PR merge or deployment is included. Final head and
publication receipts are appended under “Final main sync” in the run
handoff.

## Integration size exceptions


Line-Count-Exception: backend/database/conversations.py | 4107 -> 4120 |
Small blind metadata writer; avoids a new hot-path Firestore read and
stays with database ownership.

Line-Count-Exception: backend/routers/listen/receiver.py | 2618 -> 2632
| Small guarded ingestion hook reuses existing client_state; scheduling
lives in its own module.

Line-Count-Exception: backend/routers/users.py | 2576 -> 2598 | Small
typed authenticated lifecycle endpoint; all lease logic lives in the
demand module.

Line-Count-Exception:
backend/utils/conversations/process_conversation.py | 3566 -> 3592 |
Small integration seams retain canonical memory/task writer ownership;
scheduler and outbox worker are separate modules.

Line-Count-Exception: backend/utils/retrieval/agentic.py | 1993 -> 1999
| Register and gate one tool implemented in its own module.

Line-Count-Exception: backend/utils/sync/pipeline.py | 3385 -> 3391 |
Small flag/coalescing and explicit-demand hooks preserve the existing
sync owner.

Line-Count-Exception: app/lib/pages/home/page.dart | 1126 -> 1127 | One
startup hook starts the opt-in reporter even without a recording socket;
no view construction changes.

Line-Count-Exception: desktop/macos/Desktop/Sources/OmiApp.swift | 1683
-> 1684 | One startup hook starts the opt-in reporter after
environment/auth setup; implementation remains in ListenClientState.
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