Repository navigation
feat(app): show and filter conversations with linked tasks - #24727
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
The engineering here is solid — clean, well-bounded, and honestly degradable; it needs green CI and a product sign-off, not a rework. What I verified on this head:
Notes on material dimensions:
USER IMPACT: once released (backend first), conversations with linked tasks show a "Has linked tasks" badge on Home, and Search gains a "Has tasks" filter that browses all matching conversations with query/date/folder/star filters — not just the rows already loaded on Home. Before this can progress: Dart Analyze & Tests and Mobile Release Eligibility are both red on this head — get them green, keep the backend-before-mobile deploy order, then mark ready for review. Source-row task links (#19859) correctly stay out of scope here. This adds a new first-party API surface and a user-facing product surface for #20620 — leaving for human maintainer review on the product/API-contract direction rather than implementation correctness. Feedback generated by AI on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Preserve both sets of localization keys, regenerate Dart localizations and assert the combined Home duration label.
The hosted default Java 25 fails during Gradle 8.14.2 build-script analysis. Match the emulator job pin and protect the JVM and compile jobs with the existing infrastructure contract.
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.
7 issues found across 140 files
Confidence score: 4/5
- The search and emulator coverage is weaker than it looks:
task_filter_qa_server.pydoes not send textual search through the real emulator, andtest_conversation_task_filter.pyuses a fake that ignores the query. Make the fixture filter onqueryand route the search path through the emulator. test_conversation_tasks_emulator.pydoes not verify privacy for a task linked to a foreign conversation because the seed data never creates that link. Add a foreign-linked task to the test.- The new labels need a localization pass:
app_fa.arbuses a different term for tasks than the rest of the Persian locale, and the standalone labels inapp_fi.arbandapp_ms.arbare awkward. Use the established Persian term and the suggested natural Finnish and Malay phrasing. conversations_with_tasks_page.dartusesFilterChipinstead of the sharedOmiFilterChip, so the starred filter may not match the other search filters’ styling, semantics, or 44-point target. UseOmiFilterChip.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/lib/l10n/app_fa.arb">
<violation number="1" location="app/lib/l10n/app_fa.arb:12195">
P2: These labels translate the product’s task concept as `کار` (work/job), while the Persian locale consistently uses `وظیفه` for tasks. Use the established terminology so the badge and filter clearly refer to Omi tasks.</violation>
</file>
<file name="app/lib/l10n/app_fi.arb">
<violation number="1" location="app/lib/l10n/app_fi.arb:4639">
P3: `Tehtäviä sisältävät` is an incomplete standalone label because it omits the noun being modified. Replace it with the natural standalone phrase `Sisältää tehtäviä` (or include an explicit noun such as `Tehtäviä sisältävät keskustelut`).</violation>
</file>
<file name="backend/tests/unit/test_conversation_task_filter.py">
<violation number="1" location="backend/tests/unit/test_conversation_task_filter.py:51">
P2: This parameterization does not test query filtering: the fake search owner ignores `query` and returns identical rows for `''` and `'invoice'`, so a broken Search → Has tasks query can pass. Make the fixture/query assertion distinguish matching and non-matching rows, or add an integration case through the real search owner.</violation>
</file>
<file name="app/lib/l10n/app_ms.arb">
<violation number="1" location="app/lib/l10n/app_ms.arb:4638">
P3: The Malay badge label is grammatically awkward because `dipautkan` needs a relative clause marker here. Change it to `Mempunyai tugas yang dipautkan` so the accessible announcement reads naturally.</violation>
</file>
<file name="backend/tests/integration/test_conversation_tasks_emulator.py">
<violation number="1" location="backend/tests/integration/test_conversation_tasks_emulator.py:119">
P3: This regression does not actually exercise foreign-task privacy: `seed()` never links an action item to `foreign`, so the false result only covers a missing parent. Add a synthetic task row with `conversation_id='foreign'` and keep the expected presence false to catch disclosure regressions.</violation>
</file>
<file name="backend/testing/e2e/task_filter_qa_server.py">
<violation number="1" location="backend/testing/e2e/task_filter_qa_server.py:32">
P2: This harness does not use the real emulator for the textual-search path it claims to exercise: only the task-link module is redirected, while the reused search owner resolves Firestore through the globally patched client and reads the empty in-memory fake. Inject the captured emulator client into the shared database client seam, or avoid patching Firestore construction for this fixture, before importing the production routes.</violation>
</file>
<file name="app/lib/pages/conversations/conversations_with_tasks_page.dart">
<violation number="1" location="app/lib/pages/conversations/conversations_with_tasks_page.dart:246">
P3: The new starred filter uses Material `FilterChip` instead of the shared `OmiFilterChip`. Replace it with `OmiFilterChip` so selected styling, semantics, and the 44-point target stay consistent with the other search filters.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| "hasLinkedTasksLabel": "دارای کارهای مرتبط", | ||
| "hasTasksFilter": "دارای کار", |
There was a problem hiding this comment.
P2: These labels translate the product’s task concept as کار (work/job), while the Persian locale consistently uses وظیفه for tasks. Use the established terminology so the badge and filter clearly refer to Omi tasks.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/l10n/app_fa.arb, line 12195:
<comment>These labels translate the product’s task concept as `کار` (work/job), while the Persian locale consistently uses `وظیفه` for tasks. Use the established terminology so the badge and filter clearly refer to Omi tasks.</comment>
<file context>
@@ -12192,6 +12192,8 @@
"referralClaimShort": "دریافت",
"paymentDeclinedTitle": "کارت شما رد شد",
"paymentDeclinedMessage": "برای بازگرداندن {plan} کارت را بهروزرسانی کنید",
+ "hasLinkedTasksLabel": "دارای کارهای مرتبط",
+ "hasTasksFilter": "دارای کار",
"firmwareUpdateNotInstalledMessage": "The update didn't install. Your pendant is still on {version}. Please try again.",
</file context>
| "hasLinkedTasksLabel": "دارای کارهای مرتبط", | |
| "hasTasksFilter": "دارای کار", | |
| "hasLinkedTasksLabel": "دارای وظایف مرتبط", | |
| "hasTasksFilter": "دارای وظایف", |
| "paymentDeclinedTitle": "Korttisi hylättiin", | ||
| "paymentDeclinedMessage": "Päivitä kortti saadaksesi {plan} takaisin", | ||
| "hasLinkedTasksLabel": "Sisältää liitettyjä tehtäviä", | ||
| "hasTasksFilter": "Tehtäviä sisältävät", |
There was a problem hiding this comment.
P3: Tehtäviä sisältävät is an incomplete standalone label because it omits the noun being modified. Replace it with the natural standalone phrase Sisältää tehtäviä (or include an explicit noun such as Tehtäviä sisältävät keskustelut).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/l10n/app_fi.arb, line 4639:
<comment>`Tehtäviä sisältävät` is an incomplete standalone label because it omits the noun being modified. Replace it with the natural standalone phrase `Sisältää tehtäviä` (or include an explicit noun such as `Tehtäviä sisältävät keskustelut`).</comment>
<file context>
@@ -4635,6 +4635,8 @@
"paymentDeclinedTitle": "Korttisi hylättiin",
"paymentDeclinedMessage": "Päivitä kortti saadaksesi {plan} takaisin",
+ "hasLinkedTasksLabel": "Sisältää liitettyjä tehtäviä",
+ "hasTasksFilter": "Tehtäviä sisältävät",
"firmwareUpdateNotInstalledMessage": "The update didn't install. Your pendant is still on {version}. Please try again.",
"firmwareUpdateUnconfirmedMessage": "Couldn't confirm the update. Your pendant hasn't reconnected yet. Keep it nearby and check its firmware version before trying again.",
</file context>
| "hasTasksFilter": "Tehtäviä sisältävät", | |
| "hasTasksFilter": "Sisältää tehtäviä", |
| "referralClaimShort": "Tuntut", | ||
| "paymentDeclinedTitle": "Kad anda ditolak", | ||
| "paymentDeclinedMessage": "Kemas kini kad untuk mendapatkan semula {plan}", | ||
| "hasLinkedTasksLabel": "Mempunyai tugas dipautkan", |
There was a problem hiding this comment.
P3: The Malay badge label is grammatically awkward because dipautkan needs a relative clause marker here. Change it to Mempunyai tugas yang dipautkan so the accessible announcement reads naturally.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/l10n/app_ms.arb, line 4638:
<comment>The Malay badge label is grammatically awkward because `dipautkan` needs a relative clause marker here. Change it to `Mempunyai tugas yang dipautkan` so the accessible announcement reads naturally.</comment>
<file context>
@@ -4635,6 +4635,8 @@
"referralClaimShort": "Tuntut",
"paymentDeclinedTitle": "Kad anda ditolak",
"paymentDeclinedMessage": "Kemas kini kad untuk mendapatkan semula {plan}",
+ "hasLinkedTasksLabel": "Mempunyai tugas dipautkan",
+ "hasTasksFilter": "Dengan tugas",
"firmwareUpdateNotInstalledMessage": "The update didn't install. Your pendant is still on {version}. Please try again.",
</file context>
| "hasLinkedTasksLabel": "Mempunyai tugas dipautkan", | |
| "hasLinkedTasksLabel": "Mempunyai tugas yang dipautkan", |
| def test_real_membership_follows_delete_relink_lock_and_duplicate_task_rows(store): | ||
| client, uid = store | ||
| user = seed(client, uid) | ||
| ids = ['c000', 'c001', 'c054', 'c055', 'c104', 'foreign'] |
There was a problem hiding this comment.
P3: This regression does not actually exercise foreign-task privacy: seed() never links an action item to foreign, so the false result only covers a missing parent. Add a synthetic task row with conversation_id='foreign' and keep the expected presence false to catch disclosure regressions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/integration/test_conversation_tasks_emulator.py, line 119:
<comment>This regression does not actually exercise foreign-task privacy: `seed()` never links an action item to `foreign`, so the false result only covers a missing parent. Add a synthetic task row with `conversation_id='foreign'` and keep the expected presence false to catch disclosure regressions.</comment>
<file context>
@@ -0,0 +1,167 @@
+def test_real_membership_follows_delete_relink_lock_and_duplicate_task_rows(store):
+ client, uid = store
+ user = seed(client, uid)
+ ids = ['c000', 'c001', 'c054', 'c055', 'c104', 'foreign']
+
+ def read():
</file context>
| runSpacing: OmiSpacing.xs, | ||
| crossAxisAlignment: WrapCrossAlignment.center, | ||
| children: [ | ||
| FilterChip( |
There was a problem hiding this comment.
P3: The new starred filter uses Material FilterChip instead of the shared OmiFilterChip. Replace it with OmiFilterChip so selected styling, semantics, and the 44-point target stay consistent with the other search filters.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/pages/conversations/conversations_with_tasks_page.dart, line 246:
<comment>The new starred filter uses Material `FilterChip` instead of the shared `OmiFilterChip`. Replace it with `OmiFilterChip` so selected styling, semantics, and the 44-point target stay consistent with the other search filters.</comment>
<file context>
@@ -0,0 +1,328 @@
+ runSpacing: OmiSpacing.xs,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ children: [
+ FilterChip(
+ key: const ValueKey('tasks_filter_starred'),
+ label: Text(l10n.starred),
</file context>
| FilterChip( | |
| OmiFilterChip( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5503c2dcd8
ℹ️ 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".
| Object _taskInputs(ActionItemsProvider source) => ( | ||
| source.apiViewState, | ||
| source.actionItems.length, | ||
| source.isLoading, | ||
| source.isFetching, | ||
| ); |
There was a problem hiding this comment.
Invalidate presence after a task delete commits
When a user deletes a task through the app’s undo flow, stageDeleteActionItem removes it and notifies immediately, so this key invalidates before the backend deletion. The ensuing refresh can still find the canonical task; commitStagedDelete does not notify on success, and this key has no acknowledged-write revision to trigger another refresh. The stale positive presence can therefore keep the conversation’s Home badge and Has Tasks result visible until an unrelated refresh. Invalidate on the acknowledged task mutation, including staged-delete commit.
Useful? React with 👍 / 👎.
Failure-Class: FC-raw-page-limit-before-visibility-filter
…lid cursors Failure-Class: FC-raw-page-limit-before-visibility-filter
Failure-Class: FC-raw-page-limit-before-visibility-filter
Failure-Class: FC-raw-page-limit-before-visibility-filter
There was a problem hiding this comment.
8 issues found across 145 files
Confidence score: 3/5
conversations.pycan drop transcript-only task matches after the first 100 results. Paginate transcript hits or return a clear continuation.refreshAndReplayAfter401can return a stale replay response after the owner guard is revoked. Restore thesessionChanged()check after replay.conversations_with_tasks_page.dartignoresdata.partial, so users can mistake budget-truncated results for a complete set. Show the partial-result notice and retry option.conversation_task_presence_provider.dartcan keep a stale task badge when a conversation is replaced in place. Track a content/version fingerprint or invalidate on every conversation update.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/test/widgets/conversations_with_tasks_test.dart">
<violation number="1" location="app/test/widgets/conversations_with_tasks_test.dart:113">
P2: This server-side filter test does not cover folder or date filters. Capture those arguments and exercise the corresponding controls so regressions in those advertised filters fail the test.</violation>
</file>
<file name="backend/tests/integration/test_conversation_tasks_emulator.py">
<violation number="1" location="backend/tests/integration/test_conversation_tasks_emulator.py:27">
P2: This emulator proof cannot run with the documented synthetic setup because the integration package's autouse Firebase fixture requires unrelated Application Default Credentials before `store` runs. Remove that credential requirement for this emulator test (or isolate it from the credentialed integration conftest) so AnonymousCredentials and the local emulator are sufficient.</violation>
</file>
<file name="app/lib/pages/conversations/conversations_with_tasks_page.dart">
<violation number="1" location="app/lib/pages/conversations/conversations_with_tasks_page.dart:161">
P2: `data.partial` is ignored, so budget-truncated pages look like ordinary pages. Preserve this flag and render the existing partial-result notice/retry alongside the continuation so users know the result set is incomplete.</violation>
</file>
<file name="backend/routers/conversation_tasks.py">
<violation number="1" location="backend/routers/conversation_tasks.py:14">
P3: This router imports another router to reuse an internal helper, violating the backend import hierarchy and coupling task-route startup to the full conversations router graph. Move candidate discovery into a shared `utils` or `database` module and have both routers depend on it.</violation>
</file>
<file name="backend/routers/conversations.py">
<violation number="1" location="backend/routers/conversations.py:2404">
P2: Task search drops transcript-only matches after the first 100 because this candidate response preserves Typesense pagination, which does not account for transcript-index results. Paginate transcript hits or return a continuation whenever the transcript search is capped.</violation>
</file>
<file name="app/lib/providers/conversation_task_presence_provider.dart">
<violation number="1" location="app/lib/providers/conversation_task_presence_provider.dart:67">
P2: This identity-and-length key misses in-place conversation replacements, allowing a stale task badge to survive a relevant conversation refresh. Track a content/version fingerprint or invalidate on every conversation update that can affect the badge.</violation>
</file>
<file name="app/lib/backend/http/shared.dart">
<violation number="1" location="app/lib/backend/http/shared.dart:594">
P2: `refreshAndReplayAfter401` no longer checks `canSend` after `await replay()`, so stale replay responses can reach callers after the owner guard is revoked. Restore the post-replay `sessionChanged()` check before classifying or returning the replay response.
(Based on your team's feedback about owner-scope fencing after awaits.) .</violation>
</file>
<file name="backend/docs/conversation-task-filter.md">
<violation number="1" location="backend/docs/conversation-task-filter.md:30">
P3: This presents the 120/hour exemption as unconditional, but `RATE_LIMIT_BOOST_EXEMPT` can intentionally remove it and multiply the limit. Document it as the default exemption, or state the override caveat so operators do not rely on a guarantee the configuration does not enforce.</violation>
</file>
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
| DateTime? endDate, | ||
| String? cursor, | ||
| bool Function()? canSend}) { | ||
| requests.add((query, starred, includeDiscarded)); |
There was a problem hiding this comment.
P2: This server-side filter test does not cover folder or date filters. Capture those arguments and exercise the corresponding controls so regressions in those advertised filters fail the test.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/test/widgets/conversations_with_tasks_test.dart, line 113:
<comment>This server-side filter test does not cover folder or date filters. Capture those arguments and exercise the corresponding controls so regressions in those advertised filters fail the test.</comment>
<file context>
@@ -0,0 +1,287 @@
+ DateTime? endDate,
+ String? cursor,
+ bool Function()? canSend}) {
+ requests.add((query, starred, includeDiscarded));
+ final result = Completer<ApiResult<TaskConversationPage>>();
+ pending.add(result);
</file context>
|
|
||
|
|
||
| @pytest.fixture | ||
| def store(monkeypatch): |
There was a problem hiding this comment.
P2: This emulator proof cannot run with the documented synthetic setup because the integration package's autouse Firebase fixture requires unrelated Application Default Credentials before store runs. Remove that credential requirement for this emulator test (or isolate it from the credentialed integration conftest) so AnonymousCredentials and the local emulator are sufficient.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/integration/test_conversation_tasks_emulator.py, line 27:
<comment>This emulator proof cannot run with the documented synthetic setup because the integration package's autouse Firebase fixture requires unrelated Application Default Credentials before `store` runs. Remove that credential requirement for this emulator test (or isolate it from the credentialed integration conftest) so AnonymousCredentials and the local emulator are sufficient.</comment>
<file context>
@@ -0,0 +1,248 @@
+
+
[email protected]
+def store(monkeypatch):
+ host = os.getenv('FIRESTORE_EMULATOR_HOST', '')
+ if not host:
</file context>
| byId[row.id] = row; | ||
| } | ||
| _rows = byId.values.toList(); | ||
| _cursor = data.nextCursor; |
There was a problem hiding this comment.
P2: data.partial is ignored, so budget-truncated pages look like ordinary pages. Preserve this flag and render the existing partial-result notice/retry alongside the continuation so users know the result set is incomplete.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/pages/conversations/conversations_with_tasks_page.dart, line 161:
<comment>`data.partial` is ignored, so budget-truncated pages look like ordinary pages. Preserve this flag and render the existing partial-result notice/retry alongside the continuation so users know the result set is incomplete.</comment>
<file context>
@@ -0,0 +1,335 @@
+ byId[row.id] = row;
+ }
+ _rows = byId.values.toList();
+ _cursor = data.nextCursor;
+ });
+ case ApiFailure(:final problem):
</file context>
| void _conversationChanged() { | ||
| final conversations = _conversations!; | ||
| final key = conversations._taskPresenceInputs; | ||
| if (key == _conversationKey) return; |
There was a problem hiding this comment.
P2: This identity-and-length key misses in-place conversation replacements, allowing a stale task badge to survive a relevant conversation refresh. Track a content/version fingerprint or invalidate on every conversation update that can affect the badge.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/providers/conversation_task_presence_provider.dart, line 67:
<comment>This identity-and-length key misses in-place conversation replacements, allowing a stale task badge to survive a relevant conversation refresh. Track a content/version fingerprint or invalidate on every conversation update that can affect the badge.</comment>
<file context>
@@ -0,0 +1,176 @@
+ void _conversationChanged() {
+ final conversations = _conversations!;
+ final key = conversations._taskPresenceInputs;
+ if (key == _conversationKey) return;
+ _conversationKey = key;
+ invalidate();
</file context>
| rethrow; | ||
| } | ||
| if (sessionChanged()) { | ||
| if (snapshotChanged()) { |
There was a problem hiding this comment.
P2: refreshAndReplayAfter401 no longer checks canSend after await replay(), so stale replay responses can reach callers after the owner guard is revoked. Restore the post-replay sessionChanged() check before classifying or returning the replay response.
(Based on your team's feedback about owner-scope fencing after awaits.) .
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/backend/http/shared.dart, line 594:
<comment>`refreshAndReplayAfter401` no longer checks `canSend` after `await replay()`, so stale replay responses can reach callers after the owner guard is revoked. Restore the post-replay `sessionChanged()` check before classifying or returning the replay response.
(Based on your team's feedback about owner-scope fencing after awaits.) .</comment>
<file context>
@@ -577,7 +591,7 @@ Future<T> refreshAndReplayAfter401<T>({
rethrow;
}
- if (sessionChanged()) {
+ if (snapshotChanged()) {
service.recordAuthenticatedRequest401(recovered: false, outcome: 'session_changed');
await (disposeStaleResponse ?? disposeUnauthorizedResponse)?.call(replayed);
</file context>
| if (snapshotChanged()) { | |
| if (sessionChanged()) { |
| TaskConversationPageRequest, | ||
| TaskConversationPageResponse, | ||
| ) | ||
| from routers.conversations import search_task_conversation_candidates |
There was a problem hiding this comment.
P3: This router imports another router to reuse an internal helper, violating the backend import hierarchy and coupling task-route startup to the full conversations router graph. Move candidate discovery into a shared utils or database module and have both routers depend on it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/conversation_tasks.py, line 14:
<comment>This router imports another router to reuse an internal helper, violating the backend import hierarchy and coupling task-route startup to the full conversations router graph. Move candidate discovery into a shared `utils` or `database` module and have both routers depend on it.</comment>
<file context>
@@ -0,0 +1,104 @@
+ TaskConversationPageRequest,
+ TaskConversationPageResponse,
+)
+from routers.conversations import search_task_conversation_candidates
+from utils.conversations import paid_lock_recovery, transcribing_hold
+from utils.conversations.render import redact_conversations_for_list
</file context>
| Sparse scans may return an empty intermediate page **with continuation**, which | ||
| the UI never labels “No results”. A budget failure without progress is retryable. | ||
| The presence read uses existing task version invalidation and a 15-second cache. | ||
| Its 120/hour limit is exempt from the global rate-limit multiplier. |
There was a problem hiding this comment.
P3: This presents the 120/hour exemption as unconditional, but RATE_LIMIT_BOOST_EXEMPT can intentionally remove it and multiply the limit. Document it as the default exemption, or state the override caveat so operators do not rely on a guarantee the configuration does not enforce.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/conversation-task-filter.md, line 30:
<comment>This presents the 120/hour exemption as unconditional, but `RATE_LIMIT_BOOST_EXEMPT` can intentionally remove it and multiply the limit. Document it as the default exemption, or state the override caveat so operators do not rely on a guarantee the configuration does not enforce.</comment>
<file context>
@@ -0,0 +1,109 @@
+Sparse scans may return an empty intermediate page **with continuation**, which
+the UI never labels “No results”. A budget failure without progress is retryable.
+The presence read uses existing task version invalidation and a 15-second cache.
+Its 120/hour limit is exempt from the global rate-limit multiplier.
+No new composite-index deployment is required; runtime query guards verify this.
+
</file context>
| Its 120/hour limit is exempt from the global rate-limit multiplier. | |
| By default, its 120/hour limit is exempt from the global rate-limit multiplier; `RATE_LIMIT_BOOST_EXEMPT` can override that exemption. |
Failure-Class: FC-raw-page-limit-before-visibility-filter
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94ee6f3e59
ℹ️ 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".
| ) | ||
|
|
||
| async def search(page): | ||
| return await search_task_conversation_candidates( |
There was a problem hiding this comment.
Forward the list budget into keyword-search hydration
When a non-empty query has sparse task matches, this callback can advance through many search pages, but their Firestore conversation snapshots are hydrated without the route’s ListReadBudget. Those reads are never charged, so the scan can exceed OMI_LIST_READ_MAX_DOCUMENTS while returning a supposedly budgeted partial page. Forward the budget into the candidate-search hydration path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
1 existing issue remains and 2 new issues found across 145 files
Confidence score: 3/5
conversations.pycan return the same conversation twice when a transcript hit appears on a later Typesense page. Deduplicate candidate IDs across pages.conversation_tasks.pymay not return the refreshable 400 response for stale or malformed task cursors. Normalize browse-positionValueErrortoTaskFilterCursorErrorbefore the route boundary.conversation_tasksnow depends on search orchestration inconversations, coupling the routers. Move the shared helper into a service or utility module.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/routers/conversation_tasks.py">
<violation number="1" location="backend/routers/conversation_tasks.py:91">
P2: Normalize browse-position `ValueError` into `TaskFilterCursorError` before this route boundary so stale or malformed task cursors consistently return the refreshable 400 response.</violation>
</file>
<file name="backend/routers/conversations.py">
<violation number="1" location="backend/routers/conversations.py:2285">
P2: The task-filter search can return the same conversation twice when a transcript hit also appears on a later Typesense page. Deduplicate candidate IDs across raw pages, or use a cursor/search source that guarantees disjoint pages, before applying task membership pagination.</violation>
</file>
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
| can_recover_locked=recovery.can_recover, | ||
| ) | ||
| await run_blocking(db_executor, recovery.heal, result['items']) | ||
| except TaskFilterCursorError as error: |
There was a problem hiding this comment.
P2: Normalize browse-position ValueError into TaskFilterCursorError before this route boundary so stale or malformed task cursors consistently return the refreshable 400 response.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/conversation_tasks.py, line 91:
<comment>Normalize browse-position `ValueError` into `TaskFilterCursorError` before this route boundary so stale or malformed task cursors consistently return the refreshable 400 response.</comment>
<file context>
@@ -0,0 +1,105 @@
+ can_recover_locked=recovery.can_recover,
+ )
+ await run_blocking(db_executor, recovery.heal, result['items'])
+ except TaskFilterCursorError as error:
+ raise HTTPException(status_code=400, detail='Invalid task-filter cursor. Refresh this list.') from error
+ except (
</file context>
| search_request: SearchRequest, uid: str, *, budget: ListReadBudget | ||
| ) -> Dict[str, Any]: | ||
| """Internal task discovery, with raw pagination and no access writes.""" | ||
| return await _search_conversation_page(search_request, uid, None, None, candidate_budget=budget) |
There was a problem hiding this comment.
P2: The task-filter search can return the same conversation twice when a transcript hit also appears on a later Typesense page. Deduplicate candidate IDs across raw pages, or use a cursor/search source that guarantees disjoint pages, before applying task membership pagination.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/routers/conversations.py, line 2285:
<comment>The task-filter search can return the same conversation twice when a transcript hit also appears on a later Typesense page. Deduplicate candidate IDs across raw pages, or use a cursor/search source that guarantees disjoint pages, before applying task membership pagination.</comment>
<file context>
@@ -2268,6 +2275,25 @@ async def search_conversations_endpoint(
+ search_request: SearchRequest, uid: str, *, budget: ListReadBudget
+) -> Dict[str, Any]:
+ """Internal task discovery, with raw pagination and no access writes."""
+ return await _search_conversation_page(search_request, uid, None, None, candidate_budget=budget)
+
+
</file context>
What changed and why
Home conversation rows now show an accessible task badge, and Search → Has tasks browses the full server result set with query/date/folder/star filters. Both surfaces use the same current, undeleted canonical task links; completed and manually linked tasks count, while stale summary suggestions do not.
Closes #20620. Source-conversation task-row links remain the separate scope of #19859.
The membership join and candidate scans are bounded and read-only. Signed cursors bind the account and filters and support sparse pages. Only selected task-bearing results can receive existing paid-access recovery. The change adds no task writes, recording-content writes, backfill or Firestore indexes. Backend deployment must precede the mobile release.
Reuses the shared stale-HTTP-error guards and regressions from #24182 (
e53adc5fd0,6fc6816804), retaining current main's newer streaming behavior. Existing task/conversation notifications invalidate badges; old-account responses cannot repaint or expire a replacement session. The architecture, checklist, release order and local rerun commands are inbackend/docs/conversation-task-filter.md.Product invariants affected
How it was verified
make mobile-verify ARGS="fast --paths ...").Authentication, Redis and external search-provider I/O in local integration are synthetic. The native host reuses production conversation rows and the production filter page; it is not the full authenticated Home shell. No physical Android TalkBack run, production deployment, store release or customer confirmation is claimed. Android semantics/large text are exercised in Flutter widget tests. All 69 selected local repository preflight checks and all 27 production-shell performance checks passed. Keep draft until required current-commit CI passes.
Main reconciliation
Verified locally at
7c4941ff329aca0f4a046e2b39249aea90c3af6d. Merged current main, preserved every existing locale entry and both task-filter translations, and regenerated Dart localizations for all 49 locales. The Home regression now asserts the combined• 10mlabel rendered by the row.backend/test.shacross the task filter and OpenAPI contracts.python3 scripts/l10n.py checkpassed. The previously recorded simulator and Firestore checks cover the same feature behavior.All 69 local preflight checks and the normal push gates passed.
Tests
backend/tests/unit/test_conversation_task_filter.py,backend/tests/integration/test_conversation_tasks_emulator.py, executable Firestore query drivers,app/test/unit/conversation_task_presence_test.dart,app/test/unit/backend/http/conversation_tasks_api_test.dart,app/test/widgets/conversations_with_tasks_test.dart, andapp/integration_test/conversation_tasks_e2e_test.dartcover the new core and recovery paths. The local QA server rejects non-loopback emulators/cloud projects and never uses customer data.UI evidence
Production conversation rows in the synthetic QA Home host, then the production Has tasks page; both on the iOS 26.5 simulator with local emulator data.
Failure class (fixes)
Failure-Class: FC-raw-page-limit-before-visibility-filter
Android CI toolchain
The reconciliation CI exposed a shared runner mismatch. The Android compile and JVM test jobs now set Java 21 before Flutter setup, matching the existing emulator job. Gradle 8.14.2 ran successfully with Java 21 in a local smoke probe. Actionlint, five infrastructure guard tests and the CI budget refresh passed.
CI follow-up source:
5503c2dcd8ab20c10bf3989d7077370b9e64d5f6. Product source and the tested reconciliation are unchanged by the workflow-only follow-up.Account and pagination follow-up
Owner checks fence 401 refresh and replay across account switches. Task search advances through raw index pages while public search retains visible-result pagination. Task browse and search read candidates without restoring access until the result page is selected. The 120/hour task-presence cap remains effective under the production rate multiplier.
a78454f41c, including account switches during 401 refresh and replay, new-owner badge reads while an old request is pending, invalid cursor recovery, large page decoding on the background worker and the episode navigation test.241c23c540. Coverage includes the Home badge, global results, injected 503 and 403 responses, deletion refresh and return to the original Home position. The new backend regressions use synthetic auth, entitlement and search inputs.Line-Count-Exception: backend/routers/conversations.py | 2539 -> 2574 | Share authoritative search hydration and exact-reference handling with task discovery. Keep public redaction and pagination separate from the read-only candidate path.
Five Firestore emulator tests passed again with synthetic auth. They cover the document cap across search hydration and retention of folder-curated conversations. All 57 affected backend unit and inventory tests passed.