Repository navigation
fix(home): older conversations load reliably on v3 Home; hidden runs are scanned, not downloaded - #26193
Conversation
…are scanned, not downloaded App: a newest-page read waits for an older page in flight instead of discarding it, a full fetch keeps a deeper paging position, Home asks for the next page when one lands short, and the v3 periodic and capture-event re-reads ask only for recent rows (one-hour rule for pending rows). Backend: page refills through a hidden run stream four visibility fields per row and read in full only rows that may be visible. Kill switch OMI_LIST_LEAN_SKIP_ENABLED. GET /v1/conversations logs a per-request read meter line (counts and timings only). Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…gment Co-Authored-By: Claude Fable 5.2 <[email protected]>
…stry Co-Authored-By: Claude Fable 5.2 <[email protected]>
Codex Review Summary: ✅ CompletedThis 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: c917849dbd
ℹ️ 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".
| if (_conversationPagedDeeper && _conversationPagingKey == pagingKey) { | ||
| // Same filters, older pages already loaded and still on screen: keep the deeper position. | ||
| // Restarting at page two would re-read every page the reader already has before any new row. | ||
| _recordServerPageIds(result.items, result.storageCount); |
There was a problem hiding this comment.
Verify continuity before retaining the deeper paging position
If more than one page of new conversations arrives after the user has paged deeper, the refreshed first page no longer overlaps the previously loaded rows. Retaining the old cursor skips the intervening new conversations; if the user previously reached the end, retaining _conversationServerHasMore == false prevents any further paging at all. For example, after loading all 120 existing rows, receiving 60 newer rows and refreshing displays only the newest 50 plus the old 120, leaving 10 unreachable through scrolling or subsequent refreshes. Preserve the deeper position only after establishing continuity with the loaded range, or fetch the intervening pages before resuming it.
Useful? React with 👍 / 👎.
| return provider.refreshRecentConversations(ConversationsV3Provider.recentRefreshSince([ | ||
| ...touched, | ||
| for (final row in ConversationsV3Provider.recentlyMidPipeline(provider.conversations, now)) row.createdAt, | ||
| for (final row in provider.processingConversations) row.createdAt, | ||
| ], now)); |
There was a problem hiding this comment.
Include the manually finished live window in the refresh bound
When End is accepted for a live conversation created more than an hour ago, its derived successor can appear after the one-off full refresh in ProviderCaptureExternalActions.onManualFinishSettled. Once the recording leaves processingConversations, these periodic refreshes have no timestamp for that window and start only an hour back, excluding the successor. Manual finish also hides v3.live, and _afterV3Frame suppresses the closed-live refresh while finishRow exists, so neither path supplies the missing timestamp. The accepted finish cancels its expiry and waits for finishHasSuccessor, leaving the processing placeholder indefinitely until a manual refresh. Retain the finished live window's creation time and include it in the bound while awaiting its successor.
Useful? React with 👍 / 👎.
|
@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment |
…atic page loads A newest-page read now waits past the server's request cutoff for an older page in flight (review F1). Follow-up pages asked for without a new scroll stop at four (F4). Test for the filter fallback (F7); wording (F6, F8). Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
/approve-ui a095939 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a095939e81
ℹ️ 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".
| snapshots = { | ||
| snapshot.id: snapshot | ||
| for snapshot in budgeted_get_all( | ||
| db, [doc.reference for doc in pending], self.budget, field_paths=self.scout.hydrate_fields |
There was a problem hiding this comment.
Use the prescribed Firestore client seam for hydration
Whenever a hidden run triggers lean hydration, this new helper reads through the module-global db proxy. backend/AGENTS.md explicitly prohibits using that legacy proxy in new code and requires call-time get_firestore_client() resolution with an optional keyword-only firestore_client injection seam. Resolve and pass the client through the page-fill helpers so hydration can use an injected client without replacing module-global state.
AGENTS.md reference: backend/AGENTS.md:L180-L180
Useful? React with 👍 / 👎.
| await fetchConversations(); | ||
| return; | ||
| } | ||
| await _fetchNewConversations(restoreMergeWatches: false, since: since); |
There was a problem hiding this comment.
Publish recent-row completions to the Siri index
On iOS with Siri indexing enabled, a v3 conversation that completes during Home's periodic refresh now updates the displayed list without updating Spotlight/Siri. Previously, the watcher called fetchConversations(), which publishes accepted rows through queueReconcileConversations or queueUpsertConversations; _fetchNewConversations() and its reconciliation helpers do neither. Consequently, a completion discovered only by polling remains absent or stale in the native index until a separate full-list or owner-wide refresh. Publish accepted recent rows to Siri as well, using additive upserts or a reconciliation bounded to the actual covered window.
Useful? React with 👍 / 👎.
…; meter tolerates budget fakes A run hidden for reasons only the full predicate sees made every scouted row a candidate and paid a second read for each (CI: pending-bridge read budget test). Refills now go lean only when the scout's flags explain at least half of what the first window hid. The read meter reads the document count defensively (CI: retired list projection test). Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
/approve-ui e7c80fe |
…nges (#26201) Multica: SCA-4136. ## What changed and why When `backend/utils/other/list_budget.py` changes, put the pending-bridge and retired-list regressions first in the focused pre-push list. The existing import graph already selects both for CI. The exact #26193 backend diff has more than 40 focused candidates, so the mapping also gives these two tests priority within the cap. ## Product invariants affected none ## How it was verified - Ran the selector CLI with `--changed-files` and `--focused-output` for the budget path alone and the full backend changed-file list from #26193 (`git diff --name-only 1c0f059^1 1c0f059 -- backend/`). Both regressions were missing from pre-push before the fix and now occupy its first two slots. The budget-only focused list has 16 files. CI's output was identical before and after for both inputs. - Ran the selector and import-graph suites plus both affected regression files with the locked backend environment. All 54 tests passed. - Ran `bash scripts/test-pre-push-backend-test-cap.sh`. The hook cap tests passed. - Ran `make preflight` with this PR body. All 38 checks passed. ## Tests `test_list_budget_regressions_run_under_pre_push_cap` checks CI selection and the first 40 focused entries for both inputs. Both cases reproduced the local miss before the fix. UI-Evidence: none -- selector tooling Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26201?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26201?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26201&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
What changed and why
On a v3 account, scrolling to the bottom of Home is slow and sometimes never loads older conversations. Two causes, both fixed here.
Measured (2026-11-24 02:47Z, one consenting v3 owner, read-only, counts only): of the newest 4,000 rows the Home query matches, 3,016 are hidden (1,199 raw recordings, 1,817
home_hiddenwindows). The first 50 visible rows span 1,487 storage rows; the next 50 span 962. Production request logs (10% sample): first page p50 2.7 s / p90 11.5 s, cursor pages p50 2.3 s / p90 11.5 s.App: paging survives refreshes
fetchConversations,_fetchNewConversations) under the same filters now waits for an older page in flight to settle (bounded at 35 s, past the server's 30 s cutoff). Before, it bumped the fetch revision and the older page was dropped when it returned.start_date= the earliest recent pending row, at most a day back) through the newrefreshRecentConversations. They no longer read the whole newest page or touch the paging position.Backend: a hidden run is scanned, not downloaded
_PageFillrefills (which only happen once a page met hidden rows) now stream four fields per row (created_at,recording,home_hidden,deleted). Only rows that pass that first look are read in full and put through the complete visibility predicate.OMI_LIST_LEAN_SKIP_ENABLED=falserestores full-document refills. On by default.Backend: read meter
GET /v1/conversationslogs one line per request: documents read, storage rows consumed, hidden rows skipped, rows returned, read and total milliseconds. No owner id, no query. The existinglist_read_*counters report zero for the serving backend, so this is the first production reading of reads per Home page.Carried from #26188
mainfails the feature-flag registry check as of 2026-11-24 (theOMI_INDEXED_LIST_READS_ENABLEDrow passed its grace). #26188 (SCA-3682) fixes that and is merged into this branch so its checks can run. The four flag-row changes and the matching registry doc rows in this diff are that PR's, unchanged; they leave this diff once #26188 lands onmain. This PR's own registry change is the one new row,OMI_LIST_LEAN_SKIP_ENABLED.Not in this PR
OMI_INDEXED_LIST_READS_ENABLEDis unset in production, so visible rows are still read with their transcripts.Product invariants affected
none
How it was verified
backend/.venv/bin/python -m pytest tests/unit/test_home_hidden_run_pagination.py tests/unit/test_fsr_wq4_cursor.py: 59 passed.flutter test test/providers/conversation_home_paging_refresh_test.dart test/pages/conversations/home_v3_test.dart: 39 passed.Tests
backend/tests/unit/test_home_hidden_run_pagination.py: lean scan counts, no extra read without hidden rows, projection carries only visibility fields, a row only the full predicate hides, budget cut mid-refill, kill switch, cursor walk.app/test/providers/conversation_home_paging_refresh_test.dart: deeper position kept across a full fetch, filter change restarts, refresh waits for an older page, bounded refresh window and removal, one-hour rule.UI evidence
UI-Evidence: none -- no visual change; paging and refresh behaviour only
Line-count exceptions
Line-Count-Exception: app/lib/pages/conversations/conversations_page.dart | 1572 -> 1614 | the recent-rows re-read replaces three call sites that live in this page's v3 frame logic; splitting it is a separate refactor
Line-Count-Exception: app/lib/providers/conversation_provider.dart | 2432 -> 2510 | paging-position state sits beside the fetch and load-more methods that own it; moving them is a separate refactor
Line-Count-Exception: backend/database/conversations.py | 5369 -> 5504 | the lean refill is a method of the existing page fill and shares its position accounting
Line-Count-Exception: backend/routers/conversations.py | 3085 -> 3103 | the read meter line belongs in the list route it measures
Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code