Repository navigation
One chat shell: every content block renders everywhere, plus chat ergonomics (#12598) - #12607
Conversation
There was a problem hiding this comment.
40 issues found across 211 files
Confidence score: 2/5
DashboardViewModel.swiftcan publish the previous account’s goals after an account switch, and failed progress updates can leave rejected optimistic values persisted; snapshot ownership and roll back both published and stored state on failure.memory_link_block.dart,message.dart, andai_message.dartexpose several chat-content regressions: memory links can remain disabled, rich blocks without IDs can disappear, and mixed fallback content can hide plain text; initialize providers, assign stable IDs, and preserve non-interactive blocks.TaskNavigationRequestStore.swiftcurrently has no reachable callers, so chat-originated task and candidate targets cannot reachTasksPage; wire the producers to the request APIs.QueryShellHome.swiftandChatFirstShell.swiftcan leave users on the wrong route or an indefinite “Loading goals” state when asynchronous resolution fails or completes late; validate navigation before changing routes and reload goals after capability activation.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/MainWindow/Dashboard/DashboardViewModel.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/DashboardViewModel.swift:85">
P1: When an account switches while a dashboard load is in flight, this code can sync and publish the previous account's goals after `resetSessionState()` clears the view model. Capture an owner authorization snapshot or generation for every dashboard/local load and guard it before storage sync and every UI publication.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/DashboardViewModel.swift:149">
P2: When the progress PATCH fails, the optimistic value remains visible and persisted even though the server rejected it. Save the prior goal value and roll back both the published goal and `GoalStorage` when the remote update fails.</violation>
<violation number="3" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/DashboardViewModel.swift:203">
P2: When the backend delete fails after the local soft-delete, the goal stays hidden until a later refresh makes it reappear. Restore the local record on delete failure, or queue the deletion durably so local visibility cannot claim a deletion that the server rejected.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/memory_link_block.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/memory_link_block.dart:51">
P1: When a user encounters a memory link before visiting the Memories page, `MemoriesProvider` is never initialized, so this button remains disabled with a spinner and the memory cannot be opened. Initialize the provider for the chat lifecycle, or add a single-flight `ensureLoaded` path before resolving the memory.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Dashboard/TaskNavigationRequestStore.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/TaskNavigationRequestStore.swift:33">
P1: No caller invokes either `request` overload, so the exact task/candidate handoff is unreachable. Since `pendingTarget` is `private(set)`, `TasksPage` can never receive a queued target; wire the chat producers to these APIs before relying on this navigation path.</violation>
</file>
<file name="app/lib/backend/schema/message.dart">
<violation number="1" location="app/lib/backend/schema/message.dart:445">
P1: When the API returns a rich block without an `id`, `typedContentBlocks` drops it before rendering, so legacy conversation/task/etc. cards appear only as plain fallback text. Assign a stable message-scoped ID for missing block IDs before decoding, or otherwise allow the decoder to render these valid first-class blocks.</violation>
</file>
<file name="app/lib/pages/chat/widgets/ai_message.dart">
<violation number="1" location="app/lib/pages/chat/widgets/ai_message.dart:298">
P1: When a fallback contains both interactive and non-interactive blocks, this condition hides the non-interactive block text because `ChatContentBlockList` renders only interactive blocks. Replace the body only when every raw block is valid and represented by one of the six interactive widgets; otherwise append the widgets to the fallback text.</violation>
</file>
<file name="desktop/macos/scripts/check-single-chat-shell.py">
<violation number="1" location="desktop/macos/scripts/check-single-chat-shell.py:88">
P1: When an auxiliary surface uses a property name other than `chatFirstRichBlockContext`, this tripwire misses the optional context and its `if let` rendering fork. It currently passes the production `floatingSurface` implementation, allowing rich blocks to disappear; match the type annotation itself and add a self-test for this form.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/QueryShell/QueryShellHome.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/QueryShell/QueryShellHome.swift:476">
P2: When a referenced memory is not in the local cache, this navigates away before confirming it can be opened. `ChatFirstShell.resolvePendingMemoryFocus` returns on failure without reverting the route, leaving the user on an empty or stale Memories pane; preflight both memory-opening paths before calling `navigation.open`.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstShell.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstShell.swift:124">
P2: When a user opens Goals before the asynchronous capability resolves, the page can remain on “Loading goals” indefinitely. Trigger a goals reload after capability activation, or keep the initial load pending until the capability resolves.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift:2179">
P2: When an agent transcript contains a question card, this context gates it against the main-chat transcript instead of the agent message being displayed. Pass a surface-specific question state/handler, or keep the agent card explicitly passive, so the floating card does not present a misleading non-functional control.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift:328">
P2: If this task runs during a transient missing-owner or account transition, the sample becomes permanently resolved with capability off and the next account never gets a capability fetch. Reset the sample's resolved state or explicitly retry after the new owner is available.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubbleSupport.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubbleSupport.swift:350">
P2: When an assistant message contains only a rich block, this branch hides the metadata band and removes the row's only timestamp. The ChatFirst cards do not display their own time, so task, question, and memory history loses temporal context; keep a timestamp-only band for these rows or render the timestamp inside the rich block card.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatSelectableTextPopover.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatSelectableTextPopover.swift:91">
P2: When the popover content is mounted before its window is attached, this one-shot focus attempt does nothing and the advertised ⌘A/⌘C shortcuts are unavailable until a click. Claim first responder from `viewDidMoveToWindow` or an attached-view update path instead of silently dropping the request.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatSelectableTextPopover.swift:100">
P2: When `Select Text…` is opened during an in-progress answer, each streamed token replaces `NSTextView.string` and interrupts native selection. Snapshot the text when opening the popover, or preserve the selection and scroll position while applying streaming updates.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:90">
P2: The new context affects rich-card rendering, but the bubble identity ignores it and the rich-block view does not observe its `ChatProvider`. Include the relevant context/capability identity in the bubble refresh path or observe the provider so capability changes update existing cards.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:286">
P2: While an assistant is streaming after a tool call but before an answer arrives, this fallback exposes pre-tool commentary as copyable text. Use `message.copyableText` directly so copy and selection preserve the answer-only projection.</violation>
<violation number="3" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:723">
P3: The copy shortcut activates when any metadata control is focused because they share one Boolean focus state. Track the focused metadata control with distinct focus values and enable `⌘C` only for the copy control.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatMessagesView.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatMessagesView.swift:36">
P2: When a settled row is later rewritten by journal replay or its failure status changes, the new adjacent duplicate pass is not rerun, so the transcript can retain an obsolete “Duplicate message” chip or miss a newly eligible collapse. Include the relevant row text/status fingerprint in the invalidation key, or refresh when those values change.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatMessagesView.swift:60">
P2: Consecutive user turns now collapse as duplicate answers. Restrict the adjacent-collapse pass to assistant rows so repeating a long user question does not hide the later turn behind the duplicate chip.</violation>
</file>
<file name="desktop/macos/e2e/flows/home.yaml">
<violation number="1" location="desktop/macos/e2e/flows/home.yaml:15">
P2: `home.yaml` lists `DesktopAutomationHomeStageActions.swift` in `covers:` claiming it exercises the four `home_*` bridge actions, but no step in this flow invokes any of them, and the flow's preconditions only include `auth_ready` (no `automation_bridge_ready`). The S1–S6 steps are direct UI interactions (typing in the composer, clicking buttons, hovering markers), so the bridge actions' behavior is never driven or verified here. Per the e2e `covers:` contract, either drop this entry or add a step that drives a `home_*` action through the bridge (and add the `automation_bridge_ready` precondition).</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/task_card_block.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/task_card_block.dart:94">
P2: When `item.isLocked` is true, this control remains enabled and `_toggle` optimistically changes the task before the API rejects the update. Disable the toggle for locked items so chat does not show a flicker and failed mutation on paywalled tasks.</violation>
</file>
<file name="app/lib/backend/schema/chat_content_block.dart">
<violation number="1" location="app/lib/backend/schema/chat_content_block.dart:114">
P2: When a citation carries `momentTimestampMs`, `createdAt`, `appName`, or `url`, this decoder silently drops that metadata from `typedContentBlocks`. Preserve the canonical citation fields, including their snake_case aliases, in `CitationContentBlock`.</violation>
<violation number="2" location="app/lib/backend/schema/chat_content_block.dart:137">
P2: When an agent completion includes `promptSnippet`, this projection drops it even though the canonical and Swift codecs preserve it. Add `promptSnippet` to `AgentCompletionContentBlock` and decode the wire field.</violation>
<violation number="3" location="app/lib/backend/schema/chat_content_block.dart:181">
P2: When a cold-start question reaches mobile, `_decodeQuestionCard` discards its canonical `coldStartSequence`, so consumers of the typed block cannot identify the script or step. Decode and expose this field, including the snake_case representation.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/conversation_link_blocks.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/conversation_link_blocks.dart:63">
P2: When a failed lookup is followed by a different block at the same list position, Flutter reuses this state and `_isUnavailable` remains true, so the new block incorrectly renders unavailable. Reset state in `didUpdateWidget` when the block identity changes, or key the stateful block widgets themselves.</violation>
</file>
<file name="desktop/macos/e2e/flows/tasks.yaml">
<violation number="1" location="desktop/macos/e2e/flows/tasks.yaml:9">
P2: The new covers entry claims the tasks flow exercises TaskNavigationRequestStore's exact-record handoff, but no step in tasks.yaml produces a navigation request: S1 navigates via the nav-bar tab button and S2a clicks a task row already inside the page. The store's request(task:)/request(candidate:) also have no callers in the codebase, so consumeIfAvailable always returns nil. Per the repo rule, list a source in covers only when the flow actually exercises and verifies its behavior — remove this entry (or add a step that hands the Tasks page an exact record and verifies it opens on arrival).</violation>
</file>
<file name="desktop/macos/e2e/flows/floating-bar-functional.yaml">
<violation number="1" location="desktop/macos/e2e/flows/floating-bar-functional.yaml:14">
P2: This Ask-Omi-only flow never drives the notch's agent-exit routing, so listing DesktopShellPresentationPolicy.swift in covers claims coverage the flow does not exercise. S2-S7 only open Ask Omi, send a stubbed query, and close it via closeAskOmiForAutomation -> closeAIConversation; the policy's sole call site is showMainConversationFromAgent (FloatingControlBarWindow.swift:1621) -> routePrimaryTextInputToMainAppAfterAgentExit, which no step triggers. List it only in a flow that backs out of an agent chat in the notch, or drop the entry.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/goal_link_block.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/goal_link_block.dart:96">
P2: When a goal uses more than one decimal place, `_format` rounds both values before displaying them, so the sheet reports inaccurate progress. Preserve the value's precision instead of forcing every non-integer to one decimal place.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ViewExporter.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ViewExporter.swift:55">
P2: After removing the dashboard and daily-score standalone views and the full-dashboard page, `standaloneViewCount` (18) and `fullPageCount` (11) no longer match the registry arrays (13 and 8). `runBatch` spawns a subprocess for every index up to count, and `standaloneViewAt`/`fullPageViewAt` return nil past the end, so the subprocess exits(1) and `--export-views`/`--export-fullpages` log spurious FAILED exports for nonexistent views. Update the two counts (or derive them from the arrays) when removing registry entries.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/ViewExporter.swift:55">
P3: `previewChatProvider()` is now dead code: its only caller was the removed "02-dashboard" registry entry. Remove the unused private helper to avoid a stale build-time dependency on ChatProvider.</violation>
</file>
<file name="desktop/macos/e2e/flows/chat-first-cohesive.yaml">
<violation number="1" location="desktop/macos/e2e/flows/chat-first-cohesive.yaml:47">
P2: ChatSelectableTextPopover.swift is listed in `covers:`, but no step in this flow exercises it. The popover is only instantiated when `showSelectableText` becomes true (the "Select Text…" context-menu or hover-strip path); the `.popover(isPresented:)` anchor here is a `Color.clear` view that is always present, so it never renders `ChatSelectableTextPopover`/`OmiSelectableTextView`. Steps S1–S23 contain no interaction that presents the popover or triggers copy/select-text behavior. The added comment even concedes the file's behavior is asserted hermetically in `ChatSelectableTextSurfaceTests`, "not here". Per the repo convention that `covers:` lists only sources the flow actually exercises and verifies, this entry should be dropped (or a step added that opens and dismisses the popover) so the manifest does not claim coverage it does not provide.</violation>
</file>
<file name="desktop/macos/e2e/flows/home-spine.yaml">
<violation number="1" location="desktop/macos/e2e/flows/home-spine.yaml:24">
P2: home-spine.yaml lists DashboardViewModel.swift in `covers:`, but the flow never exercises it. The comment claims Home's corner counts and goal rows read it; in fact the corner count comes from QueryShellHome's `total` (appState conversations + tasksStore.tasks + memoriesViewModel.memories + screenCount), DashboardViewModel is only used by StartupWarmupCoordinator/ViewModelContainer, and no S1-S10 step touches goal rows or scores. Per the repo's covers contract, only list sources the flow actually exercises and verifies. Drop the entry (and the comment) or add a step that drives a goal row and asserts the dashboard-derived count.</violation>
</file>
<file name="desktop/macos/e2e/CORE_E2E.md">
<violation number="1" location="desktop/macos/e2e/CORE_E2E.md:72">
P2: This PR makes ChatFirstShell the universal shell for every account, yet deleting the 'Home stage (hub/chat/connect), chat-first shell | T2' row from the change→tier map drops the only documented minimum qualification tier for that surface. The replacement flows home.yaml and home-spine.yaml are only `tier: manual` and were not added to the flow audit baseline, so the now-universal chat shell has no traceable coverage requirement. Replace the removed row with a reference to the new home/chat-first flows (and list them in the flow audit) instead of deleting it outright.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift:32">
P2: The `.disabled` branch in `ChatFirstQuestionCardOptionsPolicy.presentation` is reached whenever `isActionable` is false and capability is off, but `isActionable` is false both for a live question with capability off and for a question that has been retired (no longer the transcript tail). The code comment says capability-off is "the only reason to show unpressable options: the question is live," yet the view passes only `isActionable`, which cannot tell the two apart. As a result a superseded question card renders dimmed options plus the "Answering is unavailable right now" label even though the real reason is that the question is no longer active, contradicting the intent and the `hidden` policy used for retired questions when capability is on.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/chat_block_chrome.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/chat_block_chrome.dart:133">
P3: While task data is hydrating, `ChatBlockLoading` ignores its `icon` and `label`, so the card shows only a spinner and loading message without identifying the block as a task. Render `ChatBlockEyebrow` (or otherwise include the icon and label) in the loading state.</violation>
</file>
<file name="desktop/macos/e2e/feature-vector.md">
<violation number="1" location="desktop/macos/e2e/feature-vector.md:40">
P3: The new coverage claim says `home.yaml (nav + conversation_list_snapshot)`, but `home.yaml` never exercises `conversation_list_snapshot` and contains no snapshot/bridge action, and it is `tier: manual` rather than a T2 deep flow. The row now misattributes coverage that the flow does not provide, which misleads the coverage tracker. Drop the `conversation_list_snapshot` parenthetical (or add the snapshot step to `home.yaml`) so the status reflects what the flow actually verifies.</violation>
</file>
<file name="desktop/macos/e2e/flows/chat-first-capability-isolation.yaml">
<violation number="1" location="desktop/macos/e2e/flows/chat-first-capability-isolation.yaml:4">
P3: The updated description and the S2 comment claim this flow proves content blocks "still render", task check-off works, and only the question card's options dim on a capability-off bundle, but the steps only assert `state.shellVariant: chat_first` and `state.visibleChatFirstRoute: chat`. No step actually renders or samples any block, so running this manual flow yields no evidence for those claims and the text overstates what it verifies. Align the description/comment with the shell-mount-and-route assertion the steps actually make, or add steps that exercise a block.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Chat/ChatContinuityInvariants.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Chat/ChatContinuityInvariants.swift:59">
P3: The `isJournaled` documentation reverses the property's behavior: `true` permits journal persistence, while only trial and onboarding return `false`. Describe the property as whether this kind should be journaled, and call out trial/onboarding as presentation-only exceptions.</violation>
</file>
<file name="desktop/macos/Desktop/Tests/HomeStageCloseSemanticsTests.swift">
<violation number="1" location="desktop/macos/Desktop/Tests/HomeStageCloseSemanticsTests.swift:102">
P3: Removing the three DashboardPage static-contract tests leaves the class doc comment factually wrong and an empty MARK section behind. The comment still claims HomeAskFocusPolicyTests unit-tests the deferred focus policy and that 'the DashboardPage assertions below' are static-contract tripwires, but both that test file and DashboardPage.swift were removed. Delete the now-empty '// MARK: Flow (static contract over DashboardPage wiring)' section and trim the stale references in the header comment.</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Re-trigger cubic
| // 1. Show local data first (already loaded in init) | ||
| // 2. Fetch from API | ||
| do { | ||
| let apiGoals = try await APIClient.shared.getGoals() |
There was a problem hiding this comment.
P1: When an account switches while a dashboard load is in flight, this code can sync and publish the previous account's goals after resetSessionState() clears the view model. Capture an owner authorization snapshot or generation for every dashboard/local load and guard it before storage sync and every UI publication.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Dashboard/DashboardViewModel.swift, line 85:
<comment>When an account switches while a dashboard load is in flight, this code can sync and publish the previous account's goals after `resetSessionState()` clears the view model. Capture an owner authorization snapshot or generation for every dashboard/local load and guard it before storage sync and every UI publication.</comment>
<file context>
@@ -0,0 +1,208 @@
+ // 1. Show local data first (already loaded in init)
+ // 2. Fetch from API
+ do {
+ let apiGoals = try await APIClient.shared.getGoals()
+ // 3. Sync to SQLite
+ try await GoalStorage.shared.syncServerGoals(apiGoals)
</file context>
| summary: block.summary, | ||
| actionTitle: l10n.chatBlockOpenInMemories, | ||
| actionKey: Key('chat-block-memoryLink-${block.id}-open'), | ||
| isOpening: memory == null, |
There was a problem hiding this comment.
P1: When a user encounters a memory link before visiting the Memories page, MemoriesProvider is never initialized, so this button remains disabled with a spinner and the memory cannot be opened. Initialize the provider for the chat lifecycle, or add a single-flight ensureLoaded path before resolving the memory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/chat/widgets/content_blocks/memory_link_block.dart, line 51:
<comment>When a user encounters a memory link before visiting the Memories page, `MemoriesProvider` is never initialized, so this button remains disabled with a spinner and the memory cannot be opened. Initialize the provider for the chat lifecycle, or add a single-flight `ensureLoaded` path before resolving the memory.</comment>
<file context>
@@ -0,0 +1,57 @@
+ summary: block.summary,
+ actionTitle: l10n.chatBlockOpenInMemories,
+ actionKey: Key('chat-block-memoryLink-${block.id}-open'),
+ isOpening: memory == null,
+ onAction: memory == null ? null : () => showMemoryDialog(context, provider, memory: memory),
+ );
</file context>
| } | ||
| } | ||
|
|
||
| func request(task: TaskActionItem) { |
There was a problem hiding this comment.
P1: No caller invokes either request overload, so the exact task/candidate handoff is unreachable. Since pendingTarget is private(set), TasksPage can never receive a queued target; wire the chat producers to these APIs before relying on this navigation path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Dashboard/TaskNavigationRequestStore.swift, line 33:
<comment>No caller invokes either `request` overload, so the exact task/candidate handoff is unreachable. Since `pendingTarget` is `private(set)`, `TasksPage` can never receive a queued target; wire the chat producers to these APIs before relying on this navigation path.</comment>
<file context>
@@ -0,0 +1,66 @@
+ }
+ }
+
+ func request(task: TaskActionItem) {
+ pendingTarget = .task(task.id)
+ pendingTask = task
</file context>
| /// | ||
| /// The raw list stays authoritative on the wire (see [toJson]); this is the | ||
| /// renderable view used by the chat content-block widgets. | ||
| List<ChatContentBlock> get typedContentBlocks => _typedContentBlocks ??= ChatContentBlock.decodeList(contentBlocks); |
There was a problem hiding this comment.
P1: When the API returns a rich block without an id, typedContentBlocks drops it before rendering, so legacy conversation/task/etc. cards appear only as plain fallback text. Assign a stable message-scoped ID for missing block IDs before decoding, or otherwise allow the decoder to render these valid first-class blocks.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/backend/schema/message.dart, line 445:
<comment>When the API returns a rich block without an `id`, `typedContentBlocks` drops it before rendering, so legacy conversation/task/etc. cards appear only as plain fallback text. Assign a stable message-scoped ID for missing block IDs before decoding, or otherwise allow the decoder to render these valid first-class blocks.</comment>
<file context>
@@ -435,38 +436,25 @@ class ServerMessage {
+ ///
+ /// The raw list stays authoritative on the wire (see [toJson]); this is the
+ /// renderable view used by the chat content-block widgets.
+ List<ChatContentBlock> get typedContentBlocks => _typedContentBlocks ??= ChatContentBlock.decodeList(contentBlocks);
+
+ /// True when [text] carries nothing beyond the fallback text synthesized from
</file context>
| List<ChatContentBlock> get typedContentBlocks => _typedContentBlocks ??= ChatContentBlock.decodeList(contentBlocks); | |
| List<ChatContentBlock> get typedContentBlocks => _typedContentBlocks ??= ChatContentBlock.decodeList( | |
| contentBlocks.asMap().entries.map((entry) { | |
| final block = Map<String, dynamic>.from(entry.value); | |
| if ((block['id'] as String?)?.trim().isNotEmpty != true) { | |
| block['id'] = '$id:content-block:${entry.key}'; | |
| } | |
| return block; | |
| }).toList(growable: false), | |
| ); |
| final blocksReplaceBody = contentBlocks != null && | ||
| message.memories.isEmpty && | ||
| message.type != MessageType.daySummary && | ||
| !displayOptions && | ||
| message.textIsStructuredFallback; |
There was a problem hiding this comment.
P1: When a fallback contains both interactive and non-interactive blocks, this condition hides the non-interactive block text because ChatContentBlockList renders only interactive blocks. Replace the body only when every raw block is valid and represented by one of the six interactive widgets; otherwise append the widgets to the fallback text.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/chat/widgets/ai_message.dart, line 298:
<comment>When a fallback contains both interactive and non-interactive blocks, this condition hides the non-interactive block text because `ChatContentBlockList` renders only interactive blocks. Replace the body only when every raw block is valid and represented by one of the six interactive widgets; otherwise append the widgets to the fallback text.</comment>
<file context>
@@ -284,8 +285,26 @@ Widget buildMessageWidget(
+ // A message whose text is only the fallback synthesized from its blocks has
+ // nothing to say that the components do not already show, so the components
+ // replace the body instead of repeating it.
+ final blocksReplaceBody = contentBlocks != null &&
+ message.memories.isEmpty &&
+ message.type != MessageType.daySummary &&
</file context>
| final blocksReplaceBody = contentBlocks != null && | |
| message.memories.isEmpty && | |
| message.type != MessageType.daySummary && | |
| !displayOptions && | |
| message.textIsStructuredFallback; | |
| final blocksReplaceBody = contentBlocks != null && | |
| message.memories.isEmpty && | |
| message.type != MessageType.daySummary && | |
| !displayOptions && | |
| message.textIsStructuredFallback && | |
| message.typedContentBlocks.length == message.contentBlocks.length && | |
| message.typedContentBlocks.every( | |
| (block) => const { | |
| 'taskCard', | |
| 'goalLink', | |
| 'captureLink', | |
| 'conversationLink', | |
| 'memoryLink', | |
| 'questionCard', | |
| }.contains(block.type), | |
| ); |
| name: chat-first-capability-isolation | ||
| tier: manual | ||
| description: "Manual local/offline capability-off assertion. Run it once for each isolated fixture case in the two-launch matrix below." | ||
| description: "Manual local/offline capability-off assertion: the one shell still mounts and its content blocks still render, non-actionable. Run it once for each isolated fixture case in the two-launch matrix below." |
There was a problem hiding this comment.
P3: The updated description and the S2 comment claim this flow proves content blocks "still render", task check-off works, and only the question card's options dim on a capability-off bundle, but the steps only assert state.shellVariant: chat_first and state.visibleChatFirstRoute: chat. No step actually renders or samples any block, so running this manual flow yields no evidence for those claims and the text overstates what it verifies. Align the description/comment with the shell-mount-and-route assertion the steps actually make, or add steps that exercise a block.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/chat-first-capability-isolation.yaml, line 4:
<comment>The updated description and the S2 comment claim this flow proves content blocks "still render", task check-off works, and only the question card's options dim on a capability-off bundle, but the steps only assert `state.shellVariant: chat_first` and `state.visibleChatFirstRoute: chat`. No step actually renders or samples any block, so running this manual flow yields no evidence for those claims and the text overstates what it verifies. Align the description/comment with the shell-mount-and-route assertion the steps actually make, or add steps that exercise a block.</comment>
<file context>
@@ -1,7 +1,7 @@
name: chat-first-capability-isolation
tier: manual
-description: "Manual local/offline capability-off assertion. Run it once for each isolated fixture case in the two-launch matrix below."
+description: "Manual local/offline capability-off assertion: the one shell still mounts and its content blocks still render, non-actionable. Run it once for each isolated fixture case in the two-launch matrix below."
app: non-prod
# A harness invocation owns one automation port, hence one named app. It cannot
</file context>
| .focused($isMetadataControlFocused) | ||
| // Only while this row's control strip holds keyboard focus. A window-wide | ||
| // ⌘C would take the shortcut away from selected prose and the composer. | ||
| .modifier(ChatCopyKeyboardShortcut(isActive: isMetadataControlFocused)) |
There was a problem hiding this comment.
P3: The copy shortcut activates when any metadata control is focused because they share one Boolean focus state. Track the focused metadata control with distinct focus values and enable ⌘C only for the copy control.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift, line 723:
<comment>The copy shortcut activates when any metadata control is focused because they share one Boolean focus state. Track the focused metadata control with distinct focus values and enable `⌘C` only for the copy control.</comment>
<file context>
@@ -709,9 +718,32 @@ struct ChatBubble: View {
.focused($isMetadataControlFocused)
+ // Only while this row's control strip holds keyboard focus. A window-wide
+ // ⌘C would take the shortcut away from selected prose and the composer.
+ .modifier(ChatCopyKeyboardShortcut(isActive: isMetadataControlFocused))
.help("Copy message")
}
</file context>
| /// Kinds whose cards are presentation only and must never enter the chat | ||
| /// journal. See `FloatingControlBarManager.persistNotificationMessageIfNeeded`. |
There was a problem hiding this comment.
P3: The isJournaled documentation reverses the property's behavior: true permits journal persistence, while only trial and onboarding return false. Describe the property as whether this kind should be journaled, and call out trial/onboarding as presentation-only exceptions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/Chat/ChatContinuityInvariants.swift, line 59:
<comment>The `isJournaled` documentation reverses the property's behavior: `true` permits journal persistence, while only trial and onboarding return `false`. Describe the property as whether this kind should be journaled, and call out trial/onboarding as presentation-only exceptions.</comment>
<file context>
@@ -35,7 +50,20 @@ enum ProactiveNotificationKind: String, Equatable, CaseIterable {
+ }
+ }
+
+ /// Kinds whose cards are presentation only and must never enter the chat
+ /// journal. See `FloatingControlBarManager.persistNotificationMessageIfNeeded`.
+ var isJournaled: Bool {
</file context>
| /// Kinds whose cards are presentation only and must never enter the chat | |
| /// journal. See `FloatingControlBarManager.persistNotificationMessageIfNeeded`. | |
| /// Whether this kind's card should enter the chat journal. Trial and onboarding cards | |
| /// are presentation only and must never be journaled. |
| ), | ||
|
|
||
| ( | ||
| "02-dashboard", |
There was a problem hiding this comment.
P3: previewChatProvider() is now dead code: its only caller was the removed "02-dashboard" registry entry. Remove the unused private helper to avoid a stale build-time dependency on ChatProvider.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ViewExporter.swift, line 55:
<comment>`previewChatProvider()` is now dead code: its only caller was the removed "02-dashboard" registry entry. Remove the unused private helper to avoid a stale build-time dependency on ChatProvider.</comment>
<file context>
@@ -51,21 +51,6 @@ enum ViewExporter {
- ),
-
(
"04-conversations",
{ AnyView(ConversationsPage(appState: AppState(), selectedConversation: .constant(nil))) },
@@ -102,12 +87,6 @@ enum ViewExporter {
</file context>
|
|
||
| /// hub → chat → connect → close must collapse to the resting surface, and a | ||
| /// later `home_ask` must rest in chat — never force-jump to the hub. | ||
| func testAutomationCloseRoutesToUserCollapseNotHubJump() throws { |
There was a problem hiding this comment.
P3: Removing the three DashboardPage static-contract tests leaves the class doc comment factually wrong and an empty MARK section behind. The comment still claims HomeAskFocusPolicyTests unit-tests the deferred focus policy and that 'the DashboardPage assertions below' are static-contract tripwires, but both that test file and DashboardPage.swift were removed. Delete the now-empty '// MARK: Flow (static contract over DashboardPage wiring)' section and trim the stale references in the header comment.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Tests/HomeStageCloseSemanticsTests.swift, line 102:
<comment>Removing the three DashboardPage static-contract tests leaves the class doc comment factually wrong and an empty MARK section behind. The comment still claims HomeAskFocusPolicyTests unit-tests the deferred focus policy and that 'the DashboardPage assertions below' are static-contract tripwires, but both that test file and DashboardPage.swift were removed. Delete the now-empty '// MARK: Flow (static contract over DashboardPage wiring)' section and trim the stale references in the header comment.</comment>
<file context>
@@ -97,97 +97,4 @@ final class HomeStageCloseSemanticsTests: XCTestCase {
// MARK: Flow (static contract over DashboardPage wiring)
- /// hub → chat → connect → close must collapse to the resting surface, and a
- /// later `home_ask` must rest in chat — never force-jump to the hub.
- func testAutomationCloseRoutesToUserCollapseNotHubJump() throws {
- let source = try dashboardSource()
-
- XCTAssertFalse(
</file context>
DesktopHomeView held the app on a "Preparing Omi…" card until a network call decided which of two shells to mount, then rendered either ChatFirstShell or a legacy sidebar + DashboardPage tree. Both were the same product with different chrome, and the legacy branch was the only reason `useLegacyHomeDesign`, `useOldestHomeDesign`, DashboardPage's inline chat, SidebarView, and the widget hub still existed. The shell now mounts immediately for everyone. The server-owned capability still resolves — same request, same analytics event, same ChatProvider projection gate — but alongside the mounted shell rather than in front of it, and it now only decides whether the capability-gated kernel features engage. Capability-off renders the same shell. `navigate help` named a "Help from Founder" page no shell had mounted for a long time: the bridge resolved a title and then timed out. It now resolves to Settings → About, where getting help from a person actually lives. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Six of the journal's block kinds — question card, task card, goal link, capture link, conversation link, memory link — were dropped on the floor by every Chat surface except one. `ContentBlockGroup.group` skipped them unless `richBlockRenderingEnabled`, and `ChatBubble.blockView` returned `EmptyView` for each of them again. A turn whose whole content was a task card therefore read as an empty assistant reply in the task panel and in the notch, and as a card you could tick off in the main window. `ChatFirstRichBlockContext` is now non-optional on `QueryShellHome`, `QueryAnswerThread`, `ChatMessagesView` and `ChatBubble`; the task panel and the floating/notch renderers bind the shell's process-wide owners through `.auxiliary`, so a card tapped in the notch summons the main window and routes the one shell. `ChatFirstRichBlockGroupView` is the single renderer all three hosts share. Capability-off degrades rather than disappears: cards render, task check-off works (it binds `TasksStore`, not the projection), links navigate, and a question card shows its options dimmed and unpressable with an explicit "Answering is unavailable right now" line, instead of a question with no visible answers. Co-Authored-By: Claude Fable 5.1 <[email protected]>
`showNotification` took an optional `kind:` and `FloatingBarNotification` quietly filled it in from `assistantId`, whose default arm is `.general`. Five producers never passed one — trial messaging, onboarding permission help, both notch moments, and the whole generic proactive path — so their cards journaled a bare `notification:<uuid>` continuity key and came back in the transcript badged "Notification" with a bell, a row that says nothing about what Omi actually noticed. `kind:` is now required and never derived inside the value type. The generic proactive path derives it once at the producer edge, from the same `from(assistantId:)` call the category gate already makes three lines earlier. `.trial` and `.onboarding` are new kinds and are excluded from journaling alongside the integration nudge: billing copy and permission help are not observations. `.functional` carries the system notices that used to ride on `.general`. `.general` survives as decode-only so historical bare keys keep reading back, and its badge arm stays for exactly those rows. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…nd-shell flows The tests that protected the old shape are the reason it would come back: `ChatFirstRichBlockTests` asserted that a caller without an explicit context got *nothing*, and three flows waited on `shellVariant: legacy`. - `OneChatShellRichBlockTests` builds one turn carrying prose plus all six interactable kinds and asserts the grouping keeps every one of them, in transcript order, on the same entry point the notch and task panel call. It then drives each link's typed navigation target through the real navigation owner, and pins capability-off to "options dimmed", never "options gone" — via a new `ChatFirstQuestionCardOptionsPolicy` that separates *answered* and *retired* (hide) from *capability-off* (disable). - `ProactiveNotificationKindTests` walks every assistant id a producer ships and proves none of them derives `.general`, so no producer can mint a bare `notification:<uuid>` key; historical bare keys still decode. - `check-single-chat-shell.py` (+ manifest entries, with a self-test) is the tripwire for the vocabulary that made a second shell expressible. - `home-stage.yaml` and `dashboard.yaml` described `DashboardPage` and are deleted with it; `chat-first-capability-isolation.yaml` is repurposed to the assertion that now matters — capability-off mounts the same shell. Co-Authored-By: Claude Fable 5.1 <[email protected]>
`ChatFirstRichBlockContext.auxiliary` binds `ChatFirstShellNavigation.shared` so a card tapped in the notch or the task panel routes the shell. The root was still creating its own instance, so those taps would have moved a navigation object nothing rendered — the card would appear to do nothing. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…more `DashboardIntelligenceStore` fetched recommendations, projected them, and kept a feedback outbox for a section that only `DashboardPage` mounted. With the page gone its 750 lines had no renderer and no caller — the grep is exact: the class was referenced only by its own file and its own tests. Its 1,117-line test file went with it, because a test for a store nothing mounts is coverage of nothing. What stays is the part other surfaces still use: `TaskNavigationRequestStore`, the exact-record handoff `QueryShellHome` and the chat-first task card give the Tasks page instead of a tab index. The file is named for it now. Three source-reading tests still pointed at `DashboardPage.swift` and failed on the missing file rather than on anything real; they move onto `QueryAnswerThread` / `QueryShellHome`, which is where Home's error card and its colour tokens actually live. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…efault `navigate help` pre-selects About because that is where getting help from a person lives. A caller that also names a section meant that section. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…as cut off Three things a reader could not do with a reply on screen. Select it. `OmiMarkdown` disabled native text selection outright, so a date or a name in an answer could only be retyped. The reason was real — one AppKit selection overlay per `Text`, on a row that rewrites its body every streaming flush, is a non-converging layout loop (400 segments, 2 s hangs) — but it is a reason about *streaming* rows. Selection is now opt-in through `\.chatTextSelectable`, and `ChatTextSelectionPolicy` grants it to settled rows only, on every surface that shows chat prose: the transcript, the notch, the expanded floating bar, and onboarding. The three `.textSelection(.enabled)` calls outside `OmiMarkdown` in the floating surfaces were dead — the inner `.disabled` won — and are replaced rather than left as decoration. Copy it without hunting. The copy button lived only in the hover-revealed strip, and a user turn had no copy affordance at all. Every row now has a "Copy Message" context menu over the same pasteboard write, and the copy button takes ⌘C while its row's strip holds keyboard focus — not window-wide, which would take the shortcut from selected prose and the composer. See that it stopped mid-sentence. A voice barge-in persists the partial answer with a terminal failed status, and the only failure affordance was a stamp for a row with no text — so "…arrive on Saturday," rendered exactly like a finished reply. `ChatTurnFailurePresentation` decides between that stamp and a quiet trailing "Interrupted" mark, and the empty-row case is unchanged. Also: the hover strip is now `accessibilityHidden` when it is invisible (opacity and hit-testing hid it from the eye and the mouse but not VoiceOver), each row carries a You/Omi label, and a row whose whole content is a rich block reserves no metadata band — a memory card stamps its own time and has nothing to copy or rate. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Two consecutive one-line answers sat roughly 100 device pixels apart, and a memory card floated in symmetric dead space. Measured on the real views: 44 pt between two settled replies, and a 48 pt card row inflated to 69 pt. Two causes, both double-charges. The hover strip is 28 pt of real reserved height under every settled reply. The stack then added a full 16 pt inter-exchange gap on top of it, so the separation the band already provides was paid for twice. `ChatTranscriptLayout.spacing` now asks whether the row above reserves a band and takes a hairline when it does; every other rung of the ladder is unchanged, and a reply still binds to its question more tightly than to the next exchange. `ChatOmiMarkPlacement.rowHeight` reserved 32 pt on every assistant row for a mark that only needs it when an empty streaming reply has no height of its own. On a settled row the reservation did nothing but centre short content in a box taller than itself — which is what put equal dead space above and below the memory card. It now applies while streaming, top-aligned. Measured after: 32 pt between two replies, 48 pt for the card row, and a five-row transcript 296 pt tall instead of 341. Also collapses adjacent repeats. Dedup only ran on messages over 200 characters, so three push-to-talk tries at the same ~90-character question stuttered down the transcript untouched — each press mints a distinct `voice:<uuid>` turn, so those are three legitimate journal rows and journal identity is not the place to fix it. `adjacentDuplicateIDs` collapses a short answer repeated in the row immediately below it within ten minutes, and folds a failed barge-in fragment into the answer it is a strict prefix of. It stays behind the existing expandable "Duplicate message" chip, so nothing is hidden outright, and non-adjacent, distant, or cross-sender repeats are left alone. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Mobile stored `content_blocks` as raw maps and, since #12015, hid any message whose blocks were only desktop chat-first chrome (goal/task/ question) because there was no renderer for them. Both halves are now wrong: the components are coming, so the schema needs a typed projection and the hide filter has to go. Add `ChatContentBlock`, a sealed model mirroring the canonical schema in `desktop/macos/agent/src/runtime/types.ts` and the Swift codec's required-field rules, decoding both the camelCase (desktop/agent) and snake_case (chat-first spec) dialects. Malformed blocks are dropped; unknown types become `UnknownContentBlock` so the message keeps its synthesized fallback text instead of losing content. The raw list stays authoritative on the wire — `toJson` is unchanged. Delete `hideFromMobileChat` / `visibleOnMobile` and their four call sites in MessageProvider, replacing the "is this body only the fallback dump?" test with `textIsStructuredFallback`, which the renderer uses to decide whether components replace the body or sit beside it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Ten new keys for the block eyebrows, destination actions, unavailable state, and the conversation link's recommended-steps header, translated into all 48 non-template locales. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Every block type that macOS renders as a control now has a mobile component, driven from the same wire schema (#12598): - taskCard: a live checkbox wired to the single tasks mutation path, ActionItemsProvider.updateActionItemState. The tasks API is list-only, so the card resolves against the loaded list and mirrors the macOS loading / unavailable states rather than inventing a fetch-by-id. - goalLink: mobile has no goal detail route, so the card opens a bottom sheet with the goal's title and progress resolved from GoalsProvider, and shows the unavailable state when the id is not in the list. - captureLink / conversationLink: push ConversationDetailPage through the citation preamble already shipped in chat (grouped-map hit, then fetch by id). conversationLink also lists its recommended action items as plain rows; mobile creates tasks from the tasks surface, so the block mutates nothing. - memoryLink: opens the existing memory sheet for the resolved memory. - questionCard: options send their preparedAnswer down the normal chat send path, so the runtime stays authoritative for what an answer means. A deferral option is not special — it sends its own prepared answer. Once selectedOptionId is set only the chosen option remains, disabled, so no stale chip ever looks tappable. text/thinking/toolCall/discoveryCard/citation/agentSpawn/agentCompletion and unknown types render nothing extra — the body (or its synthesized fallback) already carries them — but they never hide the message. Where the body is only that fallback, the components replace it instead of repeating it. Every interactive element carries Key('chat-block-<type>-<id>...'). Co-Authored-By: Claude Fable 5.1 <[email protected]>
…class Co-Authored-By: Claude Fable 5.1 <[email protected]>
…le transcript The selection change this branch shipped is reverted. `OmiMarkdown` disables native text selection again at both sites, explicitly, and the `\.chatTextSelectable` environment key, `ChatTextSelectionPolicy` and `OmiChatTextSelectability` are gone along with the host wiring in `AIResponseView`, `FloatingControlBarView` and `OnboardingChatView` — those hosts now carry no `textSelection` modifier around `OmiMarkdown` at all, since the ones that were there before this branch were dead code under the inner `.disabled`. The settled-row gate was not enough. PR #10834 made the same argument and reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146: every sampled main-thread stack sat in `SelectionOverlay`, `setFont`, intrinsic-size invalidation and AttributeGraph, and memory grew without bound. A settled row is still rebuilt by transcript loading, scrolling, window resize and parent-state updates, which is all that loop needs. `.github/scripts/check_chat_selection_boundary.py` rejects the escape hatch and names the remedy: the existing copy actions, or a separate non-live reading surface. So this adds the reading surface. "Select Text…" sits on the row's context menu next to "Copy Message" and as an ibeam button in the hover strip, on assistant and user rows alike. It opens `ChatSelectableTextPopover`: one `NSTextView` over one message's copyable text — `isEditable` false, `isSelectable` true, ⌘A and ⌘C native, Escape closes, sized to content with a 360 pt cap and internal scrolling. It is outside the transcript's layout and does not mount until the reader asks for it, so it cannot take part in the loading, scrolling and resize passes that made in-place selection unsafe. No SwiftUI `textSelection` anywhere in it — AppKit selection is what an `NSTextView` already is. The strip now carries four controls plus the timestamp (thumbs, thumbs, copy, select, info-when-present). At 24 pt each that still leaves the timestamp its own room, so both affordances stay rather than context-menu only. Everything else on this branch is unchanged: right-click Copy, focus-gated ⌘C, the metadata-band policy, the transcript rhythm, the interrupted-turn marker, adjacent duplicate collapse, and the accessibility fixes. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
RealtimeConversationToolProjection.swift was folded into ChatToolExecutor in 758cd3f and the flow kept the stale path, which fails desktop-flow-lint. Co-Authored-By: Claude Fable 5.1 <[email protected]>
482cde7 to
803c4dd
Compare
#12608 (first-48h activation) landed upstream while this branch deleted the second shell. Three conflicts, all of them the same shape: main put new behaviour on surfaces this branch removes. - `DashboardPage.swift` (modify/delete): kept our deletion. Everything #12608 added to it was a *second* wiring of behaviour it had already wired into the shared surfaces — the day-0 chip composition, the prefilled-draft consumption, the draft-chip branch. Those live in `ChatProvider` / `OnboardingOpenerView` / `QueryShellHome` and survive. - `home-stage.yaml` (modify/delete): kept our deletion. Its S1-S8 assert `state.homeMode`, which only `DashboardPage` ever published; its new S9-S12 (prefilled draft, daily-summary snapshot) are real and are re-homed onto `chat-first.yaml`, on the route that owns them now. - `ptt-lifecycle.yaml` (content): took main's version. Both sides fixed the same stale covers path; main dropped the entry, we repointed it. Main's is the one already on the base branch. `QueryShellHome`'s new prefilled-draft path arrived guarded on `usesLegacyPresentation`, a symbol this branch deletes; the guard is dropped, which is also the correct behaviour — it is the only composer. `HomeDailySummarySection` was the hub's rendering of the summary and had no renderer left; its `HomeDailySummaryStatsRow`, which the surviving Chat card uses, stays and now names the file. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ettles `ChatBubbleTruncation` clamps any body over 500 characters, and only once `isStreaming` goes false. So an answer rendered in full while it streamed — with the transcript following it down — collapsed to its own first paragraph the instant it finished. A forty-item list became three items and a "Show more", and the document shrank by thousands of points under a reader pinned to the live edge. Watching that happen reads as "the chat stopped scrolling": everything you just followed is taken back at the end. Truncation is for restored history, where a long transcript should not be mostly one old reply. An answer that just settled here is the opposite case, so it keeps its full body. Co-Authored-By: Claude Opus 5 <[email protected]>
…hows Asking by voice what was on the list answered "you don't have any tasks overdue or due today" to someone looking at thirty of them. `get_tasks` is backed by `TasksStore.loadDashboardTasks`, which narrowed the list twice in ways the Tasks page never has: - a seven-day recency window, as a lower bound on overdue due dates and as a `createdAfter` cutoff on undated rows. The page buckets on `dueAt < startOfTomorrow` alone and ages nothing out, so a backlog older than a week was invisible to the assistant and only to the assistant. - a source filter that dropped every AI-capture row. That gate was written when a capture could still land in `action_items` unreviewed. INV-TASK-2 has since made capture suggestion-only — `TaskCaptureModePolicy.usesLegacyStaging` is false for every mode, and a capture stays a Candidate until an explicit gesture accepts it — so the gate no longer separated reviewed from unreviewed. It hid the user's own backlog, and anything they created by voice, since `create_action_item` comes back stamped `conversation`. On the reporting account those two took thirty visible tasks to zero. The buckets now carry what the page carries: 82 overdue + 3 due today against the page's "Today: 85". The per-bucket cap moves 50 → 500, because the count is spoken and 50 would have understated it. `isPendingSuggestion` stays for proactive nudges, the one consumer still asking whether a capture pipeline wrote a row. `DashboardTaskLanePolicy` had no other caller and goes. The voice tool descriptions said "overdue + due today", which is where the spoken wording came from; they now describe the whole open list. Co-Authored-By: Claude Opus 5 <[email protected]>
…king it Found while tracking down the streaming-scroll report. `UserScrollDetector` promotes an open mouse press to reader ownership as soon as the clip view moves, because a scrollbar-track click repositions the viewport without ever emitting a drag. That test cannot tell the app's own follow-scroll from the reader's, and while an answer streams the transcript re-reaches the live edge every `ChatScrollFollowThrottle.interval` — so a press still open when one lands ends follow mode for the rest of the answer. Now that every content block is something you can click, a press inside a streaming transcript is ordinary. Two lifecycle holes alongside it: a release delivered to another window — the "Select Text…" popover and context menus present in their own — was dropped by the same-window guard, leaving the press candidate open for the life of the scroll view with every later follow-scroll able to promote it; and a second press registered its bounds observer without removing the first. The transcript now records when it moves its own viewport, and movement inside that window re-baselines the press instead of promoting it. A drag and a scrollbar-track click still take ownership, which the existing harness cases pin. Co-Authored-By: Claude Opus 5 <[email protected]>
…from The Tasks page and `tasks_snapshot` read the same rows now, so the flow can say so: S6 compares the page's Today count against overdue_count + today_count. That is the comparison the bug failed — thirty tasks on the page, zero in the lanes. Co-Authored-By: Claude Opus 5 <[email protected]>
`render_chat_blocks` had never once been offered to the model on this Mac, and on the turns where it did run its cards were deleted three seconds later. Four separate gates, one confusion between them: *which surface is this*. One shell means main Chat and the floating bar project the same conversation, so a session the bar registered carries `surface_kind = floating_chat` while main-Chat runs execute on it. Every chat-first gate admits `main_chat` only, and three of them read the session's registration instead of the run's: the adapter metadata that sets `OMI_CHAT_FIRST_UI`, the tool-capability broker that admits the call, and the surface Swift re-validates before executing. The fourth was separate — run admission built its own context snapshot and dropped the capability on the way, because the capability map lived on `KernelSessions` where run admission could not reach it. Any one of the four was enough on its own; advertised tools go 41 -> 46 with all four fixed. Then the cards died anyway. `monotonicAcceptContentBlocks` protected exactly two block kinds across terminalization, and terminalization applies the projection *Swift* assembled from the adapter stream — text and tool calls, never a block the agent appended mid-turn, because that append is a journal mutation the surface never saw. So the replace erased every task card, goal link and memory link the turn had rendered, moments after the tool reported `ok`. The protected set is now the kinds the kernel authors and the surface never does. Confirmed live: the tool executes, and three `taskCard` blocks now survive on the finished turn. Co-Authored-By: Claude Opus 5 <[email protected]>
Checking a box replaced the card with "Task is no longer available" — the one message that means the row is not the user's any more. Nothing had gone away. Ticking moves the task between the store's two arrays and the toggle awaits SQLite first, so `liveTask` is briefly nil. That flips the card's `hydrationKey`, SwiftUI cancels the in-flight hydration, and `TasksStore.isCurrent` folds `!Task.isCancelled` into its lease check — so `resolveCanonicalTask` then returns nil *by construction*, not because the task is missing. The old code published that nil, cleared the retained task and set `hydrationFinished`: exactly the pair that draws the unavailable placeholder. A superseded hydration now speaks for nothing, and a store that cannot vouch for a row is no longer read as the row being retired. Co-Authored-By: Claude Opus 5 <[email protected]>
Two ways the same answer was being said twice. The tool's own instructions were the first. They told the model to render components "whenever you retrieve, create, or summarize" those entities and "do not leave them as a Markdown table/list" — so a summary of yesterday stacked three conversation cards above the prose that already said it. That is backwards: reading an entity to answer a question makes it a *source*, and sources belong in citations. A component is for the entity that IS the answer — the one the user asked to see or act on, or the one this turn created or changed — and when components are rendered they are the list, so the prose above them is one lead-in sentence at most. The second was ours. A turn that carried only components still printed the blocks' own degradation text underneath them, so three cards sat above the three lines they were made from. `ChatStructuredFallbackText` mirrors the producer case for case, and a body that is only that projection is recognised as the cards talking to themselves rather than as answer text. Mobile drew six of the nine kinds the desktop transcript draws and silently skipped the rest. Discovery cards and the two agent-run blocks have components now, and a parity test fails if the desktop grows a tenth without one. Co-Authored-By: Claude Opus 5 <[email protected]>
"Select Text…" opened a popover that re-printed the message in raw Markdown next to the row the reader was already looking at, and only assistant rows had it — a user turn has no hover strip, so their own words were never selectable by any means. SwiftUI's selection stays barred: PR #10834 put it back on settled rows and reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146, every sampled main-thread stack in `SelectionOverlay` and `setFont` while memory climbed. But that bar is on `SelectionOverlay`, not on selecting. An `NSTextView` *is* one selection: one view owns it, a rebuild replaces a string, and nothing per-`Text` is mounted for a parent to thrash. `ChatSelectableTextPopover` said so in its own header — it just kept that view outside the transcript. So the words are the surface now. Chat prose renders through one text view per block, parsed from exactly what the SwiftUI renderer parses, and the reader drags across an answer in place with ⌘C copying what they highlighted. Citation markers become link ranges rather than buttons, which is what made the surrounding line selectable at all — a chip in a flow layout forced the prose to be chopped into per-segment views — and they still open their source and still preview it on hover. Two things had to be got right. Height is measured beside the live view rather than inside it, because a container left holding a measurement width wrapped the answer to a width the transcript never granted; and the measurement is synchronous, because publishing a height a frame late broke the transcript's follow-scroll. The gesture harness reads pixels, and `cacheDisplay` stopped seeing prose once it was drawn from a layer, so the probe composites the layer tree and can measure the row again. The boundary check now guards this file too: the AppKit path may never quietly acquire the SwiftUI one. Co-Authored-By: Claude Opus 5 <[email protected]>
…update Two leaks left over from making components reachable. The first: terminalization was not the only replace. The streaming projection pushes the surface's own block list several times a turn, and `updateJournalTurn` took the replacement literally — so cards that survived the terminal commit died to the very next update instead, which is why they appeared on one turn and not the next. Both paths now apply a projection over the journal rather than in place of it: an id the projection carries is the projection's to define, which is how a question card's options still get retired, and an id it omits survives only when the kernel wrote it. The second is what the reader saw. When the model renders components and skips inline markers, we append a compact `Sources: [1][2][3]` rail so provenance stays discoverable. That was a sensible garnish when components were rare; now that a component turn is one lead-in line and three cards, the rail is a row of bare markers printed under the very things they point at. Sources the turn already draws are dropped from it, and anything with no component of its own keeps its marker. Co-Authored-By: Claude Opus 5 <[email protected]>
…le and live
The AppKit prose path matched `[\d{1,3}]` of its own invention. Ordinals run to
four digits and the model also writes the kind beside them — `[5004]`,
`[memory 5023]` — so real markers rendered as dead text in the middle of an
answer. It uses `ChatCitationMarkup.numericMarkerPattern` now, which is the
transcript's own definition of a marker rather than a second copy of it.
Also pins what the harness proved by hand: the mounted transcript hosts a
selectable text view on rows at more than one inset, so it is both senders'
words that can be dragged across, not just Omi's.
Co-Authored-By: Claude Opus 5 <[email protected]>
… and arrow The header already carries the recap's emoji and is the fold control, so the recap body showed both a second time - two emojis stacked, and the fold chevron sitting directly over the row's own arrow. The body is now headline + summary only, and its whole surface still opens the page. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The chat row was the only recap surface without the day's numbers. A strip of micro chips - same data as the Activity day card, bubble-row weight, content-hugging so nothing clips - sits under the overview. Badges and actions stay page-only; this is the number line, nothing more. Co-Authored-By: Claude Fable 5.1 <[email protected]>
… item TaskCategorySection is itself an item of tasksListView's LazyVStack, and it laid its rows out in a nested LazyVStack. A lazy container nested inside a lazy item makes the section's measured height non-convergent — the inner stack reports estimates while the outer measures it and real heights once placed — so every layout pass mutated lazy-item phases and re-signaled prefetch, each scheduling another transaction. The flush never drained: a permanent beachball the moment the list was scrolled with enough data (sampled: 2627/2627 main-thread samples inside GraphHost.flushTransactions, dominated by LazyStack measureEstimates and LazyLayoutViewCache updateItemPhase). The row stack is now eager, so a section's measured height is deterministic and the flush drains. The outer stack stays the virtualizer. A source inspection guard pins the no-nesting contract. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…e reduce and a fixed settle ladder Navigating to Chat felt delayed. Two measured causes: 1. The composer height travelled through QueryComposerHeightKey, written at the composer and read at the surface root, so SwiftUI ran a reduce over one combiner pair per node of everything mounted between them — the whole transcript — on every switch. Sampled: 40% of the mount transaction's observer work. The height now travels through onGeometryChange into the same guarded state write; the preference key is gone. 2. The initial restore re-pinned the live edge on a fixed [0.05, 0.2, 0.5, 1.0] ladder, so every switch waited out the full ladder even when the document had stopped reflowing after the first pass — 1.16s of pure waiting at the p50. ChatInitialRestoreSettle tightens the ladder and settles early on a height-stability check (two consecutive passes measuring the same laid-out document); the last pass still completes unconditionally. Also adds the opt-in OMI_SWITCH_PERF switch-span telemetry (route select, destination teardown, transcript mount, first laid-out document, settled restore, main-thread stall watchdog) that measured all of this, and the chat-first flow cover for it. Measured: restoreSettled p50 1156ms -> 241ms against memories as the source page. Co-Authored-By: Claude Fable 5.1 <[email protected]>
… text ChatBubbleIdentity.equal compared lhs.copyableText == rhs.copyableText, but copyableText derives purely from (contentBlocks, text, isStreaming) — every one of which the same conjunction already compares. SwiftUI runs this equality for every bubble on every transcript body pass, and each evaluation re-derived and whitespace-normalized the full answer text. Sampled mid-switch: the copyableText chain was the largest app-code cost of the mount. Removing the redundant term is behavior-preserving and dropped the navigate-to-chat settle from ~1.3s to ~240ms at the p50; a regression test pins that block-only edits stay visible through the blocks term. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…, not through JSON ChatBubbleIdentity.equal's blocks term went through ChatContentCodec.comparisonData, which JSON-encodes the persistence dictionary with sorted keys — two full serializations per bubble per transcript pass, for every unchanged row, ~28 times a second while an answer streams. ChatContentBlock now conforms to Equatable with hand-written field-by-field comparison (questionCard options deep-compare as NSDictionary; ToolCallInput synthesizes). The comparison is deliberately one notch stricter than the encoder was — in-flight toolCall statuses (.running/.slow/.stalled) no longer collapse together, which can only force an extra re-render mid-turn, never stale UI: the isStreaming guard already re-renders through those states. Also gives the task-chat panel the compact transcript window: it was the one ChatMessagesView host still on the 500-row default that measured 910 ms and 607 native views against 114 ms and 84 compact. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…g their own titles UI audit findings. A goal created without an explicit target keeps the creation default (1.0) while progress updates push currentValue past it, and the row rendered that raw: "Progress: 20 of 1". When the current value has overshot that unconfigured default target, the target carries no information, so the summary reports the value alone. desiredOutcome falling back to the title echoed every card's title under its title; it is hidden when it matches. Both the focused-goal card and the list rows capped at 680pt while the page header spanned the panel — the cards now fill the lane like the rest of the page. The Rewind capture control said "Capture Off" next to a switch knob in the on position, because the knob shows the setting and the label showed health, and the two can disagree. "Off" now only ever describes the setting; a dead-but- enabled capture reads "Capture Stopped". Co-Authored-By: Claude Fable 5.1 <[email protected]>
Missed from d27ca37: TaskChatPanel is the file carrying the transcriptWindowPolicy one-liner; without it the panel mounts the 500-row default (910 ms / 607 views vs 114 ms / 84 compact for a 400-message thread). Co-Authored-By: Claude Fable 5.1 <[email protected]>
Conflict resolutions: - QueryShellHome: the chat-quota banner slot survives; the banner+composer footer unit is measured through the onGeometryChange callback (this PR's composer-height fix), not the per-node preference the quota commit reused. - DashboardPage stays deleted (quota slots live on in QueryShellHome). - GeneratedToolExecutors regenerated from the merged tool manifest.
ChatProvider.swift is under a hard convergence limit and has one job; the ChatContentBlock: Equatable conformance belongs beside the block codec. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
| // 1. Show local data first (already loaded in init) | ||
| // 2. Fetch from API | ||
| do { | ||
| let apiGoals = try await APIClient.shared.getGoals() |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: MEDIUM
loadGoals() calls APIClient.getGoals() with no RuntimeOwnerAuthorizationSnapshot, then writes the result through GoalStorage.syncServerGoals / getLocalGoals(). getGoals documents that its 5-second process cache is not owner-validated and that owner-bound callers must pass a snapshot. Neighboring owner-scoped paths (HomeSuggestionsStore, SuggestionAssistant, TasksStore) already capture a lease and fail closed after awaits.
Startup warmup schedules loadDashboardData() after a delay, and resetSessionState() only clears the in-memory array. After an account switch, GoalStorage rebinds to the new owner's SQLite, so an in-flight or cache-hit previous-owner payload can be upserted there. syncServerGoals then marks local active goals missing from that list as deleted, so the incoming owner can lose their goals and later chat grounding (GoalStorage.getLocalGoals) can include the previous owner's data.
Impact: Cross-account local goal mix/deletion on the same device after switch, including prior-owner goals in the new session's prompt context.
Reviewed by Cursor Security Reviewer for commit e36d9c4. Configure here.
TaskCategorySection was one lazy item holding an eager stack of all its rows. Eager-in-lazy meant the outer list could not estimate a section without laying out every row, so all sections materialized: leaving the page tore down every task row in the profile (~330 trees, ~600 ms of main-thread layout per navigate away), the reason navigate-to-Chat from Tasks cost ~2x the same switch from Memories. The list is now one LazyVStack whose items interleave a category header with one item per task row (TasksListItem). Rows virtualize individually, nothing nests inside a lazy item — which also retires the lazy-in-lazy estimate livelock class the eager stack had traded the freeze for. Row ids keep keyboard navigation and per-row state; the header (icon, count, Today menu, top drop zone, accessibility identifiers) survives as TaskCategorySectionHeader; per-row drag-drop and inline-create composition is byte-for-byte the old one. Collapse was never wired at the only call site; the dead parameters stay compiling with a note that a real implementation must filter the items where they are built. Measured on a ~330-task profile: freeze stress clean (zero flushTransactions / propagate_dirty samples), the teardown storm gone (TaskRow ≈ 3-5 of ~2370 samples mid-switch), tasks→chat switch parity with Memories. Interactions exercised: snapshot, create, toggle, reorder (persisted), capture. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
38 issues found and verified against the latest diff
Confidence score: 2/5
ChatFirstContentBlockViews.swiftretainslocallyCompletedTaskacross runtime-owner changes, sodisplayTaskcan show the previous account’s task; clear owner-scoped state before projecting the new store.RewindDatabase.swiftdoes not backfilltaskStatusordeletedByfor pre-canonical databases, which can misclassify genuine server-retired tasks after upgrade; add migration logic that preserves their retired state.ai_message.dartdrops text or unknown blocks when a structured fallback also contains a renderable block, causing user-visible content loss; preserve the normal body whenever any fallback block lacks a widget.check_chat_selection_boundary.pycan be bypassed by comments and does not run for changes limited toChatSelectableProse.swift, allowing SwiftUI selection to return without detection; validate an actual AppKit declaration and include the guarded file path.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift:32">
P3: The new options policy shows .disabled (dimmed chips + Answering is unavailable right now) for every question card whenever isCapabilityAvailable is false, even when the question is not actionable because it is no longer the transcript tail. Such a mid-transcript question was never pressable regardless of capability, so it now gets a misleading unavailable banner whose stated cause (server capability) is not the real reason. Gate the disabled state on the question actually being live: only show dimmed options when isActionable is false solely because capability is off.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift:160">
P1: When the runtime owner changes while a task card remains mounted, `locallyCompletedTask` survives the store reset and `displayTask` renders the previous account's task. Clear this owner-scoped state before projecting the new account, and prevent the stale card from issuing a toggle.</violation>
</file>
<file name=".github/scripts/check_chat_selection_boundary.py">
<violation number="1" location=".github/scripts/check_chat_selection_boundary.py:34">
P2: A change limited to `ChatSelectableProse.swift` will not run `desktop-chat-selection-boundary`, so this newly protected selection surface can later gain SwiftUI selection without the guard failing. Add this path to the boundary check's `triggers` in `.github/checks-manifest.yaml`.</violation>
<violation number="2" location=".github/scripts/check_chat_selection_boundary.py:74">
P1: The new check can be satisfied by a comment while `ChatSelectableProse` is rewritten as a SwiftUI `View`, allowing the guarded failure class to return. Validate an actual AppKit declaration, such as the `makeNSView`/`NSTextView` implementation signature, rather than checking for the token anywhere in the file.</violation>
</file>
<file name="app/lib/pages/chat/widgets/ai_message.dart">
<violation number="1" location="app/lib/pages/chat/widgets/ai_message.dart:303">
P2: For a block-only day summary or citation-backed reply, this predicate keeps synthesized `Task`/`Goal` text in the legacy body, so cards duplicate it. Suppress only the synthesized body while retaining the day-summary heading or citation chrome.</violation>
<violation number="2" location="app/lib/pages/chat/widgets/ai_message.dart:308">
P1: When a structured fallback mixes a renderable block with a text or unknown block, this branch discards the text or unknown content. Keep the normal body whenever any fallback-bearing block has no widget, and replace it only when every fallback is represented.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift:2702">
P1: On upgrades from a pre-canonical database, genuine server-retired tasks have `taskStatus = NULL` because the new column has no backfill, and `deletedBy = NULL` because the backend does not provide that field. This predicate therefore resurrects those tasks as live; preserve legacy NULL-status tombstones or add an explicit fabricated-tombstone marker before repairing them.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:320">
P2: When an AI row has no visible answer, the new context menu copies its raw `message.text`, which can contain pre-tool commentary or structured fallback text. Restrict the fallback to user messages so AI rows without `copyableText` do not offer Copy Message.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift:476">
P1: When a conversation reference points to a non-capture conversation, `openResource` now hard-codes the capture route and bypasses the existing exact-record citation routing. Resolve the referenced conversation or route `reference.navigationReference` through the citation policy before choosing `.capture`.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubbleSupport.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubbleSupport.swift:197">
P2: When a structured answer also has an attachment, the fallback body includes the attachment line, so this comparison fails and the desktop prints every card's degradation text under the cards. Include the resource projection in the suppression check (or otherwise strip the known block/resource fallback) before rendering the answer body.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubbleSupport.swift:255">
P2: `ChatStructuredFallbackText.line(for:)` invents prose ("Memory review", "Follow-up") for `memoryReviewCard` and `followUp`, but the producer it claims to mirror never emits a line for these blocks, and the mobile `ServerMessage._blockFallbackText` returns `''` for both. Because `projected()` now includes these lines while the real `message.text` fallback (synthesized by `agent/src/runtime/content-block-fallback.ts`, whose switch is exhaustive over a union excluding both types) does not, `normalized(body) == normalized(projection)` fails whenever such a block sits in a turn with other blocks, so `bodyIsBlockProjection` returns false and the task/goal/etc. fallback prose is printed underneath the cards it was meant to suppress. Return `""` for these two cases (matching the mobile implementation, which deliberately omits them) so the two projections agree.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/agent_run_blocks.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/agent_run_blocks.dart:23">
P2: These agent cards always show English labels for users whose app locale is not English. Add localized agent-card strings and read them through `context.l10n`, as the other chat blocks do.</violation>
<violation number="2" location="app/lib/pages/chat/widgets/content_blocks/agent_run_blocks.dart:39">
P2: When a run ends with `timed_out` or `orphaned`, this predicate renders a checkmark and `Agent completed` even though both are terminal failures. Treat these statuses as failed/stopped too.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Dashboard/ChatDailySummaryCoordinator.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/ChatDailySummaryCoordinator.swift:103">
P2: `ChatProvider.clearChat()` calls `noteChatCleared()` before the journal clear completes; if that clear fails, this flag and watermark hide the recap while the transcript remains. Move the notification until after the clear succeeds.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Automation/MemoryReviewFixture.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Automation/MemoryReviewFixture.swift:142">
P2: When an automation action is cancelled during a wait, swallowing `Task.sleep` cancellation makes this main-actor loop spin until the timeout and can freeze the UI. Return `false` from the sleep error path instead of ignoring the cancellation.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/AuthService.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/AuthService.swift:354">
P1: When `isLoading` is true at the watchdog deadline, this closure returns and never runs again. A sign-in failure or cancellation only clears `isLoading`, so the app can remain on the `.restoring` splash; re-arm the watchdog while loading is active.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift:2210">
P2: When an agent-pill reply contains a question card, this renders it with the main chat provider’s tail check even though the message belongs to `AgentPill.conversationMessages`. The card therefore hides its options instead of showing the question interaction; use an actionability/context path for the agent transcript, or explicitly render the options disabled when that transcript cannot answer them.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Chat/ChatStreamingBuffer.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Chat/ChatStreamingBuffer.swift:157">
P2: When the paced queue contains an empty text delta, this guard exits before consuming it because the budget is zero. The segment remains forever, so the provider repeatedly schedules paced flushes and can keep the main actor busy until the turn's boundary flush; consume empty text segments before applying the budget check.</violation>
</file>
<file name="app/lib/pages/chat/widgets/content_blocks/discovery_card_block.dart">
<violation number="1" location="app/lib/pages/chat/widgets/content_blocks/discovery_card_block.dart:23">
P2: When the message refreshes or block order changes, Flutter reuses this state by position because `DiscoveryCardBlock` is unkeyed. Reset expansion when the block ID changes or key each card by its block ID.</violation>
<violation number="2" location="app/lib/pages/chat/widgets/content_blocks/discovery_card_block.dart:33">
P2: When the user expands a discovery card, the mobile implementation hides the summary that remains visible in the desktop counterpart. Keep the summary visible while adding the expanded full text.</violation>
<violation number="3" location="app/lib/pages/chat/widgets/content_blocks/discovery_card_block.dart:51">
P2: When a discovery card contains Markdown, the expanded mobile body displays the markup literally because `Text` does not parse it. Render `fullText` with the mobile Markdown renderer, matching the desktop `DiscoveryCard` behavior.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Chat/ChatCitation.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Chat/ChatCitation.swift:497">
P2: When two source kinds share an ID, this suppresses the unrelated source from the Sources rail because the filter compares only `sourceID`. Preserve the citation kind in rendered-entity keys and compare `(kind, sourceID)` instead.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatSwitchPerfLog.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatSwitchPerfLog.swift:102">
P2: After this clears only `watchdog`, `switchID` remains positive, so late `mark` and `span` calls pass their guards and are attributed to the completed switch. Track an active generation and reject callbacks after `endSwitch`.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatSwitchPerfLog.swift:105">
P2: When the main queue is blocked at watchdog timeout, `switchEnd` reads the stall total before queued ping callbacks update it, producing an incorrect worst-stall value. Coordinate finalization with the main-queue callbacks before emitting `switchEnd`.</violation>
<violation number="3" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatSwitchPerfLog.swift:171">
P2: When a previous watchdog callback runs after a new route begins, this call ends the new global switch because it ignores the watchdog's own `switchID`. Pass the watchdog ID to `endSwitch` and reject mismatches before clearing the current watchdog.</violation>
</file>
<file name="desktop/macos/e2e/flows/chat-first.yaml">
<violation number="1" location="desktop/macos/e2e/flows/chat-first.yaml:32">
P2: The new `covers:` block lists files this flow never exercises. Steps S11a–S11c only run `open_chat_prefilled`, `chat_drafts_snapshot`, and `daily_summary_snapshot`. The last action reads `ChatDailySummaryCoordinator.shared.store` / `ChatDailySummaryPresentation` (those are exercised), but the flow never activates the recap pill or mounts `DailyRecapPage`, never fires `AnalyticsManager+DailySummary` telemetry, never renders/asserts `DayZeroChips`, `HomeSuggestionsStore`, or `HomeDailySummaryStatsRow`, and makes no `APIClient+DailySummaries` fetch (the snapshot deliberately reads without refreshing). Listing `ChatDailyRecapRow.swift`, `DailyRecapPage.swift`, `AnalyticsManager+DailySummary.swift`, `HomeDailySummaryStatsRow.swift`, `APIClient+DailySummaries.swift`, `DayZeroChips.swift`, and `HomeSuggestionsStore.swift` here claims coverage the flow does not provide. Remove them (or add steps that drive them). `ChatDailyRecapRow`/`DailyRecapPage` are already covered by `chat-first-cohesive.yaml` S22a–S22c, which actually activates the pill and asserts the page.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Providers/ChatProvider+JournalProjection.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Providers/ChatProvider+JournalProjection.swift:120">
P2: A full journal refresh copies the entire preceding transcript for every settled assistant message, even though `inheritedReferences` looks back only eight assistant turns. Pass a bounded history view or change the helper to consume a slice so citation projection remains linear as the transcript grows.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Dashboard/ChatDailySummaryPresentation.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/ChatDailySummaryPresentation.swift:149">
P3: Whitespace-only `summary` or `description` values pass these filters, so the recap renders blank rows. Trim both values before checking emptiness.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Dashboard/ChatDailySummaryPresentation.swift:182">
P2: When a regenerated summary changes only a memory's category, this identity stays unchanged and the old `MemoryReviewCardStore` is reused, leaving the row label and telemetry category stale. Include `category` in the identity fingerprint.</violation>
</file>
<file name="desktop/macos/e2e/flows/floating-bar-functional.yaml">
<violation number="1" location="desktop/macos/e2e/flows/floating-bar-functional.yaml:21">
P2: The flow never exercises FloatingPrimaryTextInputRouting.shouldRouteAgentExitToMainApp: steps S1-S8 only open Ask Omi, send one stubbed typed turn, wait idle, snapshot, and close. No step backs out of an agent chat, which is the only path that calls this routing (from FloatingBarPresentation.swift). Per the floating-bar coverage convention, list this source only when the flow actually drives agent-exit routing, otherwise the manifest overstates coverage.</violation>
</file>
<file name="desktop/macos/e2e/flows/chat-first-cohesive.yaml">
<violation number="1" location="desktop/macos/e2e/flows/chat-first-cohesive.yaml:298">
P2: S22a/S22b assume the main chat transcript is the active surface, but the flow is left on the memories route (capture detail) by S21/S22. seed_memory_review_fixture is registered with surfaces: ["main_chat"], and the chat-daily-recap-row element S22b activates only exists in the main chat transcript (ChatMessagesView.dailyRecapRow). If surface matching is enforced or the chat row is not in the AX tree while the capture detail is open, S22a/S22b fail. Navigate back to chat (bridge.navigate target chat) before S22a so the recap row is mounted and activatable.</violation>
</file>
<file name="desktop/macos/agent/src/runtime/run-tool-capability.ts">
<violation number="1" location="desktop/macos/agent/src/runtime/run-tool-capability.ts:796">
P2: For the shared-session scenario this PR targets, the broker now reports `surfaceKind = "main_chat"` (from the run) even when the session was first registered as `floating_chat`, so a `search_chat_history` invocation passes the `invocation.surfaceKind !== "main_chat"` gate. But `KernelCore.searchAuthorizedChatHistory` still hard-rejects with `if (session.surfaceKind !== "main_chat") throw ...` (kernel-core.ts:328), so the chat-first history tool remains unusable on a shared main-Chat/floating session — the exact case this change is meant to enable. The run-surface fix and the session-surface guard now disagree; align the guard (e.g., admit when the run's surface is main_chat and the session maps to the canonical main-Chat conversation) or document the intended exclusion.</violation>
</file>
<file name="desktop/macos/e2e/flows/home-spine.yaml">
<violation number="1" location="desktop/macos/e2e/flows/home-spine.yaml:27">
P2: The home-spine flow lists DashboardViewModel.swift in `covers:` with the comment "Home's corner counts and goal rows read this view model," but no step in S1–S11 exercises that behavior. Every step drives the merged spine (conversation/memory/screen rows, chips, query field, hour rail, starring, handoff pages, loading, dedup, recap); none verifies the Home score/corner counts or goal rows that DashboardViewModel supplies. The "N results · of M captured" corner count in S4 is the spine's own results count, not DashboardViewModel data. Per the e2e convention, a source belongs in `covers:` only when the flow actually exercises and verifies its behavior — either drop this entry or add a step that asserts the goal rows / score counts.</violation>
</file>
<file name="desktop/macos/e2e/flows/tasks.yaml">
<violation number="1" location="desktop/macos/e2e/flows/tasks.yaml:9">
P3: The flow never exercises TaskNavigationRequestStore: it navigates to the Tasks tab via the nav button and never hands it an exact task/candidate record from a chat task card or QueryShellHome, nor verifies TasksPage consumes the pending target. Per the repo rule, list a source in `covers:` only when the flow actually exercises and verifies its behavior. Either remove this entry or add a step that opens a task from chat/home and asserts the exact-record detail opens.</violation>
<violation number="2" location="desktop/macos/e2e/flows/tasks.yaml:26">
P3: S6 does not exercise DashboardTaskRefreshPolicy. `tasks_snapshot` loads the dashboard lanes from SQLite via `loadDashboardTasks`, while the policy governs the server-refresh reconciliation path (`DashboardTaskRefreshService`/`isDashboardVisible`/`maxServerFetchPages`), which the snapshot never touches. The claim that S6 reads the lanes "these two build" and can detect the described backlog divergence is not supported — remove the covers entry or have S6 drive the server-refresh path it actually guards.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstGoalsPage.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstGoalsPage.swift:373">
P3: The duplicate-outcome guard was only applied to ChatFirstGoalRow, but the focused goal card (ChatFirstFocusedGoalSection, line 256) still renders `Text(detail.goal.desiredOutcome)` unconditionally. For goals created without an outcome, the emphasized card on the page still echoes the title underneath it — the exact rendering bug the comment says this change fixes. Apply the same title-vs-outcome comparison there.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstGoalsPage.swift:425">
P2: The progress-summary guard both under- and over-applies against the goal data model. `targetValue <= 1` cannot distinguish a goal whose target was never configured (creation default 1.0) from a goal whose user explicitly set a small target (e.g. "read 1 book", target 0.5) — so a legitimately configured target of 1 that has been exceeded now silently drops the "of 1" text. Separately, `createGoal` in APIClient.swift allows `unit` to be set independently of `targetValue`, so a goal created with a unit but no explicit target still has the default target 1.0 and still renders "20 of 1 km", the exact impossible-reading this change is meant to fix. The `unit == nil` clause is unrelated to whether the target was configured.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/Generated/GeneratedRealtimeTools.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/Generated/GeneratedRealtimeTools.swift:635">
P3: The new get_tasks description tells the model it returns "everything overdue, everything due today, and everything on the list with no due date" and that it is "the same list the Tasks page shows", but the tool actually truncates each bucket to 15 items via items.prefix(15) in RealtimeHubController+SessionDelegate.swift. When any bucket exceeds 15, the model believes it has the full list and may confidently answer with an incomplete set, contradicting the description's "an empty result means the user genuinely has no open tasks" promise. Either drop the "everything"/"same list" wording or raise the cap so the claim holds. Since this file is generated from omi-tool-manifest.ts by generate-tool-surfaces.mjs, make the edit in the manifest and regenerate rather than editing this file directly.</violation>
</file>
Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Re-trigger cubic
| @State private var retainedCompletedTask: TaskActionItem? | ||
| /// The completion the reader performed on this card, kept whatever the store | ||
| /// says afterwards. See `ChatFirstTaskCardPresentation.displayTask`. | ||
| @State private var locallyCompletedTask: TaskActionItem? |
There was a problem hiding this comment.
P1: When the runtime owner changes while a task card remains mounted, locallyCompletedTask survives the store reset and displayTask renders the previous account's task. Clear this owner-scoped state before projecting the new account, and prevent the stale card from issuing a toggle.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift, line 160:
<comment>When the runtime owner changes while a task card remains mounted, `locallyCompletedTask` survives the store reset and `displayTask` renders the previous account's task. Clear this owner-scoped state before projecting the new account, and prevent the stale card from issuing a toggle.</comment>
<file context>
@@ -103,6 +155,9 @@ struct TaskCardView: View {
@State private var retainedCompletedTask: TaskActionItem?
+ /// The completion the reader performed on this card, kept whatever the store
+ /// says afterwards. See `ChatFirstTaskCardPresentation.displayTask`.
+ @State private var locallyCompletedTask: TaskActionItem?
init(taskID: String, tasksStore: TasksStore, navigation: ChatFirstShellNavigation) {
</file context>
| # selection is the whole reason selection is allowed back into the | ||
| # transcript; a SwiftUI Text here would reopen the failure class. | ||
| selection_source = sources.get(SELECTION_FILE) | ||
| if selection_source is not None and "NSTextView" not in selection_source: |
There was a problem hiding this comment.
P1: The new check can be satisfied by a comment while ChatSelectableProse is rewritten as a SwiftUI View, allowing the guarded failure class to return. Validate an actual AppKit declaration, such as the makeNSView/NSTextView implementation signature, rather than checking for the token anywhere in the file.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/check_chat_selection_boundary.py, line 74:
<comment>The new check can be satisfied by a comment while `ChatSelectableProse` is rewritten as a SwiftUI `View`, allowing the guarded failure class to return. Validate an actual AppKit declaration, such as the `makeNSView`/`NSTextView` implementation signature, rather than checking for the token anywhere in the file.</comment>
<file context>
@@ -59,6 +67,15 @@ def check_sources(sources: Mapping[str, str]) -> list[str]:
+ # selection is the whole reason selection is allowed back into the
+ # transcript; a SwiftUI Text here would reopen the failure class.
+ selection_source = sources.get(SELECTION_FILE)
+ if selection_source is not None and "NSTextView" not in selection_source:
+ failures.append(
+ f"{SELECTION_FILE}: transcript selection must be hosted by an NSTextView"
</file context>
|
|
||
| final Widget messageWidget; | ||
| if (message.memories.isNotEmpty) { | ||
| if (blocksReplaceBody) { |
There was a problem hiding this comment.
P1: When a structured fallback mixes a renderable block with a text or unknown block, this branch discards the text or unknown content. Keep the normal body whenever any fallback-bearing block has no widget, and replace it only when every fallback is represented.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/chat/widgets/ai_message.dart, line 308:
<comment>When a structured fallback mixes a renderable block with a text or unknown block, this branch discards the text or unknown content. Keep the normal body whenever any fallback-bearing block has no widget, and replace it only when every fallback is represented.</comment>
<file context>
@@ -287,8 +288,26 @@ Widget buildMessageWidget(
+
final Widget messageWidget;
- if (message.memories.isNotEmpty) {
+ if (blocksReplaceBody) {
+ messageWidget = contentBlocks;
+ } else if (message.memories.isNotEmpty) {
</file context>
| SELECT COUNT(*) FROM action_items | ||
| WHERE deleted = 1 | ||
| AND (deletedBy IS NULL OR deletedBy = '') | ||
| AND (taskStatus IS NULL OR taskStatus NOT IN ('cancelled', 'superseded')) |
There was a problem hiding this comment.
P1: On upgrades from a pre-canonical database, genuine server-retired tasks have taskStatus = NULL because the new column has no backfill, and deletedBy = NULL because the backend does not provide that field. This predicate therefore resurrects those tasks as live; preserve legacy NULL-status tombstones or add an explicit fabricated-tombstone marker before repairing them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift, line 2702:
<comment>On upgrades from a pre-canonical database, genuine server-retired tasks have `taskStatus = NULL` because the new column has no backfill, and `deletedBy = NULL` because the backend does not provide that field. This predicate therefore resurrects those tasks as live; preserve legacy NULL-status tombstones or add an explicit fabricated-tombstone marker before repairing them.</comment>
<file context>
@@ -2673,6 +2674,46 @@ actor RewindDatabase {
+ SELECT COUNT(*) FROM action_items
+ WHERE deleted = 1
+ AND (deletedBy IS NULL OR deletedBy = '')
+ AND (taskStatus IS NULL OR taskStatus NOT IN ('cancelled', 'superseded'))
+ """) ?? 0
+ guard repaired > 0 else { return }
</file context>
| } | ||
| onOpenInlineCitation?(reference.navigationReference) | ||
| let moment = reference.momentTimestampMs.map { TimeInterval($0) / 1_000 } | ||
| chatFirstRichBlockContext.navigation.open( |
There was a problem hiding this comment.
P1: When a conversation reference points to a non-capture conversation, openResource now hard-codes the capture route and bypasses the existing exact-record citation routing. Resolve the referenced conversation or route reference.navigationReference through the citation policy before choosing .capture.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift, line 476:
<comment>When a conversation reference points to a non-capture conversation, `openResource` now hard-codes the capture route and bypasses the existing exact-record citation routing. Resolve the referenced conversation or route `reference.navigationReference` through the citation policy before choosing `.capture`.</comment>
<file context>
@@ -373,14 +472,10 @@ struct ChatBubble: View {
- }
- onOpenInlineCitation?(reference.navigationReference)
+ let moment = reference.momentTimestampMs.map { TimeInterval($0) / 1_000 }
+ chatFirstRichBlockContext.navigation.open(
+ focus: .capture(id: reference.sourceID, momentTs: moment)
+ )
</file context>
| @@ -5,6 +5,8 @@ description: Tasks tab — search, Today/No Deadline sections, keyboard toolbar | |||
| app: com.omi.computer-macos | |||
| covers: | |||
| - desktop/macos/Desktop/Sources/MainWindow/Pages/TasksPage.swift | |||
| # The exact-record handoff TasksPage consumes on arrival. | |||
| - desktop/macos/Desktop/Sources/MainWindow/Dashboard/TaskNavigationRequestStore.swift | |||
There was a problem hiding this comment.
P3: The flow never exercises TaskNavigationRequestStore: it navigates to the Tasks tab via the nav button and never hands it an exact task/candidate record from a chat task card or QueryShellHome, nor verifies TasksPage consumes the pending target. Per the repo rule, list a source in covers: only when the flow actually exercises and verifies its behavior. Either remove this entry or add a step that opens a task from chat/home and asserts the exact-record detail opens.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/tasks.yaml, line 9:
<comment>The flow never exercises TaskNavigationRequestStore: it navigates to the Tasks tab via the nav button and never hands it an exact task/candidate record from a chat task card or QueryShellHome, nor verifies TasksPage consumes the pending target. Per the repo rule, list a source in `covers:` only when the flow actually exercises and verifies its behavior. Either remove this entry or add a step that opens a task from chat/home and asserts the exact-record detail opens.</comment>
<file context>
@@ -5,6 +5,8 @@ description: Tasks tab — search, Today/No Deadline sections, keyboard toolbar
covers:
- desktop/macos/Desktop/Sources/MainWindow/Pages/TasksPage.swift
+ # The exact-record handoff TasksPage consumes on arrival.
+ - desktop/macos/Desktop/Sources/MainWindow/Dashboard/TaskNavigationRequestStore.swift
- desktop/macos/Desktop/Sources/MainWindow/Pages/TasksViewModel+SearchAnalytics.swift
- desktop/macos/Desktop/Sources/Rewind/Core/ActionItemStorage.swift
</file context>
| "type": "function", | ||
| "name": "get_tasks", | ||
| "description": "Read the user's tasks (overdue + due today) locally and get them back as text to speak. Fast synchronous read — use this for 'what are my tasks', 'what's due today', 'what's on my list'. Reading tasks is always a direct call, never background work.", | ||
| "description": "Read the user's open tasks locally and get them back as text to speak: everything overdue, everything due today, and everything on the list with no due date. This is the same list the Tasks page shows, so an empty result means the user genuinely has no open tasks — never say they have none without calling this first. Fast synchronous read — use it for 'what are my tasks', 'what's due today', 'what's on my list', 'what should I work on'. Reading tasks is always a direct call, never background work.", |
There was a problem hiding this comment.
P3: The new get_tasks description tells the model it returns "everything overdue, everything due today, and everything on the list with no due date" and that it is "the same list the Tasks page shows", but the tool actually truncates each bucket to 15 items via items.prefix(15) in RealtimeHubController+SessionDelegate.swift. When any bucket exceeds 15, the model believes it has the full list and may confidently answer with an incomplete set, contradicting the description's "an empty result means the user genuinely has no open tasks" promise. Either drop the "everything"/"same list" wording or raise the cap so the claim holds. Since this file is generated from omi-tool-manifest.ts by generate-tool-surfaces.mjs, make the edit in the manifest and regenerate rather than editing this file directly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/Generated/GeneratedRealtimeTools.swift, line 635:
<comment>The new get_tasks description tells the model it returns "everything overdue, everything due today, and everything on the list with no due date" and that it is "the same list the Tasks page shows", but the tool actually truncates each bucket to 15 items via items.prefix(15) in RealtimeHubController+SessionDelegate.swift. When any bucket exceeds 15, the model believes it has the full list and may confidently answer with an incomplete set, contradicting the description's "an empty result means the user genuinely has no open tasks" promise. Either drop the "everything"/"same list" wording or raise the cap so the claim holds. Since this file is generated from omi-tool-manifest.ts by generate-tool-surfaces.mjs, make the edit in the manifest and regenerate rather than editing this file directly.</comment>
<file context>
@@ -632,7 +632,7 @@ enum GeneratedRealtimeTools {
"type": "function",
"name": "get_tasks",
- "description": "Read the user's tasks (overdue + due today) locally and get them back as text to speak. Fast synchronous read — use this for 'what are my tasks', 'what's due today', 'what's on my list'. Reading tasks is always a direct call, never background work.",
+ "description": "Read the user's open tasks locally and get them back as text to speak: everything overdue, everything due today, and everything on the list with no due date. This is the same list the Tasks page shows, so an empty result means the user genuinely has no open tasks — never say they have none without calling this first. Fast synchronous read — use it for 'what are my tasks', 'what's due today', 'what's on my list', 'what should I work on'. Reading tasks is always a direct call, never background work.",
"parameters": {
"type": "object",
</file context>
| .lineLimit(2) | ||
| // Goals created without an outcome carry the title in `desiredOutcome`; | ||
| // echoing it under the title reads as a rendering bug. | ||
| if goal.desiredOutcome.trimmingCharacters(in: .whitespacesAndNewlines) |
There was a problem hiding this comment.
P3: The duplicate-outcome guard was only applied to ChatFirstGoalRow, but the focused goal card (ChatFirstFocusedGoalSection, line 256) still renders Text(detail.goal.desiredOutcome) unconditionally. For goals created without an outcome, the emphasized card on the page still echoes the title underneath it — the exact rendering bug the comment says this change fixes. Apply the same title-vs-outcome comparison there.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/ChatFirst/ChatFirstGoalsPage.swift, line 373:
<comment>The duplicate-outcome guard was only applied to ChatFirstGoalRow, but the focused goal card (ChatFirstFocusedGoalSection, line 256) still renders `Text(detail.goal.desiredOutcome)` unconditionally. For goals created without an outcome, the emphasized card on the page still echoes the title underneath it — the exact rendering bug the comment says this change fixes. Apply the same title-vs-outcome comparison there.</comment>
<file context>
@@ -368,10 +368,16 @@ private struct ChatFirstGoalRow: View {
- .lineLimit(2)
+ // Goals created without an outcome carry the title in `desiredOutcome`;
+ // echoing it under the title reads as a rendering bug.
+ if goal.desiredOutcome.trimmingCharacters(in: .whitespacesAndNewlines)
+ .compare(goal.title, options: .caseInsensitive) != .orderedSame
+ {
</file context>
| @@ -19,6 +21,9 @@ covers: | |||
| - desktop/macos/Desktop/Sources/MainWindow/Tasks/TaskDetailSourceNavigator.swift | |||
| - desktop/macos/Desktop/Sources/MainWindow/Tasks/RewindEvidenceCard.swift | |||
| - desktop/macos/Desktop/Sources/Stores/TasksStore.swift | |||
| # S6 reads the lanes these two build — the ones the assistant answers from — | |||
| # and compares them against the page's own Today count. | |||
| - desktop/macos/Desktop/Sources/Stores/DashboardTaskRefreshPolicy.swift | |||
There was a problem hiding this comment.
P3: S6 does not exercise DashboardTaskRefreshPolicy. tasks_snapshot loads the dashboard lanes from SQLite via loadDashboardTasks, while the policy governs the server-refresh reconciliation path (DashboardTaskRefreshService/isDashboardVisible/maxServerFetchPages), which the snapshot never touches. The claim that S6 reads the lanes "these two build" and can detect the described backlog divergence is not supported — remove the covers entry or have S6 drive the server-refresh path it actually guards.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/tasks.yaml, line 26:
<comment>S6 does not exercise DashboardTaskRefreshPolicy. `tasks_snapshot` loads the dashboard lanes from SQLite via `loadDashboardTasks`, while the policy governs the server-refresh reconciliation path (`DashboardTaskRefreshService`/`isDashboardVisible`/`maxServerFetchPages`), which the snapshot never touches. The claim that S6 reads the lanes "these two build" and can detect the described backlog divergence is not supported — remove the covers entry or have S6 drive the server-refresh path it actually guards.</comment>
<file context>
@@ -19,6 +21,9 @@ covers:
- desktop/macos/Desktop/Sources/Stores/TasksStore.swift
+ # S6 reads the lanes these two build — the ones the assistant answers from —
+ # and compares them against the page's own Today count.
+ - desktop/macos/Desktop/Sources/Stores/DashboardTaskRefreshPolicy.swift
- desktop/macos/Desktop/Sources/Stores/TasksStore+BulkSelection.swift
- desktop/macos/Desktop/Sources/Rewind/Core/ActionItemStorage+BulkDelete.swift
</file context>
| if isActionable { return .enabled } | ||
| // Capability-off is the only reason to show unpressable options: the | ||
| // question is live, we simply cannot answer it yet. | ||
| return isCapabilityAvailable ? .hidden : .disabled |
There was a problem hiding this comment.
P3: The new options policy shows .disabled (dimmed chips + Answering is unavailable right now) for every question card whenever isCapabilityAvailable is false, even when the question is not actionable because it is no longer the transcript tail. Such a mid-transcript question was never pressable regardless of capability, so it now gets a misleading unavailable banner whose stated cause (server capability) is not the real reason. Gate the disabled state on the question actually being live: only show dimmed options when isActionable is false solely because capability is off.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/ChatFirst/Blocks/ChatFirstContentBlockViews.swift, line 32:
<comment>The new options policy shows .disabled (dimmed chips + Answering is unavailable right now) for every question card whenever isCapabilityAvailable is false, even when the question is not actionable because it is no longer the transcript tail. Such a mid-transcript question was never pressable regardless of capability, so it now gets a misleading unavailable banner whose stated cause (server capability) is not the real reason. Gate the disabled state on the question actually being live: only show dimmed options when isActionable is false solely because capability is off.</comment>
<file context>
@@ -7,6 +7,35 @@ import SwiftUI
+ if isActionable { return .enabled }
+ // Capability-off is the only reason to show unpressable options: the
+ // question is live, we simply cannot answer it yet.
+ return isCapabilityAvailable ? .hidden : .disabled
+ }
+
</file context>
TaskCardView's body type-checked past the release optimizer's expression
budget ("unable to type-check this expression in reasonable time" at
ChatFirstContentBlockViews.swift:198); the branches are now extracted into
renderedCard / unavailableBlock / unavailableDescription so each sub-expression
type-checks on its own. Drops the one new unused import the Dart analyzer
ratchet flagged in the content-block parity test.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The beat-period test drove a real Thread.sleep and then asserted the sleep stayed inside the beat budget; on a loaded CI runner the sleep itself overshot (periods measured 125-194 ms against a 120 ms ceiling) and the test failed on machines whose streaming was fine. The contract lives in the scheduling math, so nextBeatDeadline is extracted as a pure function and the test simulates the beat chain against it: work inside the interval holds the grid exactly, an overrunning beat resynchronizes to now instead of compounding. Deterministic, and it pins more than the wall-clock version could — the old assertion tolerated any drift under a ceiling, this one requires the grid to hold exactly. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ity-look-at-frame-alias One conflict, and main has since made this PR's original purpose redundant. 8234c83 (BasedHardware#12607) landed the three-name exemption list on main, so the red ChatDiscoverabilityTests assertion this branch opened to fix is already green there. What remains is the derivation this branch added afterwards, which is a different thing: it computes the exempt set from agent/tests/fixtures/tool-manifest.json instead of restating it as a literal, so the list cannot go stale again. Kept the derivation and carried main's rationale into its comment -- main states the reason more clearly than the original did (the local API is the only adapter either name is advertised to, so neither can appear in a chat adapter's declarations), and that reasoning is worth keeping whichever way the set is built. Verified the derivation against main's own fixture rather than assuming the shape survived: localApiOnly entries are get_local_status (no aliases) and get_screenshot (aliases ['look_at_frame']), so the derived set is exactly {get_local_status, get_screenshot, look_at_frame} -- byte-identical in effect to main's literal, and computed rather than maintained.
The task-intelligence source manifest still pointed at WhatMattersNowSection.swift and DashboardPage.swift, which moved to DashboardViewModel.swift in #12607, and still listed desktop_manual create/deleteTask writer symbols that no longer exist. Sync paths and writer symbols with the post-#12607 tree so the contract freeze test passes. Verification: pytest tests/unit/test_task_intelligence_contract_freeze.py tests/unit/test_batch_upload_storage.py tests/unit/test_merge_validation.py tests/unit/test_task_integrations_oauth_atomic.py -q -> 99 passed. Failure-Class: none
#12607 removed WhatMattersNowSection.swift and DashboardPage.swift; the desktop_manual source still listed those owner paths and stale createTask/deleteTask anchors on DesktopAutomationActivationActions. Register DashboardViewModel goal writers under goal_manual_api so the contract freeze matches the one-chat-shell layout.
(#12788) #12607 removed WhatMattersNowSection.swift and DashboardPage.swift; the desktop_manual source still listed those owner paths and stale createTask/deleteTask anchors on DesktopAutomationActivationActions. Register DashboardViewModel goal writers under goal_manual_api so the contract freeze matches the one-chat-shell layout. Co-authored-by: Max Carter 祁明思 <[email protected]>




Closes #12598.
What this does
One chat shell. Every macOS account now mounts
ChatFirstShell. TheuseLegacyHomeDesign/useOldestHomeDesignsettings, theChatFirstShellCapabilitySamplecohort switch, the.legacyvariant,QueryShellHome.usesLegacyPresentation,DashboardPageand its inline chat, the legacy sidebar shell, and the "Preparing Omi…" network-gated loading view are deleted. The shells already shared their chrome (ChatFirstShell's chat route wasQueryShellHome), so nothing a user could see moves except the things the legacy path was still hiding.Every block renders everywhere.
ChatFirstRichBlockContextis no longer optional. Task card, goal link, capture link, conversation link, memory link and question card render as their interactable component in the main chat, the task chat panel, the floating bar and the notch (which now share one navigation owner and summon the main window for deep links). The server capability (controlGeneration) is still resolved and still gates the kernel features it always gated; with it absent, cards still render, task check-off still works, links still navigate, and question-card options are disabled rather than hidden. No backend change:chat_first_uiwas a derived response field only the shell switch read.No bare "Notification" rows.
kind:is required onshowNotification; the assistant-id fallback is gone; trial and onboarding notices are not journaled; functional notices get a.functionalkind..generalsurvives decode-only for historical rows.Mobile renders the same block set. New typed
ChatContentBlockdecoder (camelCase and snake_case), six block widgets bound toActionItemsProvider.updateActionItemState,ConversationDetailPage,showMemoryDialog, a goal bottom sheet, and the chat send path for question-card answers. The #12015 filter that hid task/goal/question messages from the phone is removed.Chat ergonomics (macOS).
desktop-chat-selection-boundarygate exists because feat(macOS): enable drag selection for completed chat messages #10834 reopened FC-selection-overlay-layout-loop in Beta 0.12.146.…and "Interrupted" instead of looking finished.Proofs
OneChatShellRichBlockTests— one turn carrying all six block types renders six typed groups on the shared renderer; each action reachesChatFirstShellNavigation/ question selection; capability-off keeps the task card actionable and disables (not hides) options.ProactiveNotificationKindTests— no producer derives.general; every kinded key round-trips; historical bare keys still decode.ChatRowErgonomicsTests— band policy, failure presentation, adjacent dedup, rendered row heights viaNSHostingView;ChatSelectableTextSurfaceTests— the popover's text view is selectable, not editable, and updates in place.desktop/macos/scripts/check-single-chat-shell.pywired into.github/checks-manifest.yaml(with self-test) forbids every retired symbol.app/test/widgets/chat_content_blocks_test.dart— one fixture carrying every block; task toggle and question answer recorded on recording providers.server_message_content_blocks_test.dartinverted.dashboard.yaml,home-stage.yamlremoved;check-e2e-flow-coverage.py --strictanddesktop-flow-lint.pypass;agent-logic-harness.sh --swift-onlypassed.Known pre-existing failures on
origin/main, not touched here:check-sources-root-layout.py(90 vs baseline 77) andChatDiscoverabilityTests/testDesktopCapabilitiesExistInAgentToolDeclarations(look_at_frame).Merged with #12608 (first-48h activation)
origin/mainlanded the activation work while this branch deleted the second shell. Everything user-facing in it survives, on the surface that remains:ChatMessagesView(showsDailySummary, admitted only while the transcript follows the live edge), which both shells shared. It renders inQueryAnswerThread; the task panel opts out.HomeDailySummarySection, the hub's second rendering of the same record, had no renderer left and is deleted — itsHomeDailySummaryStatsRow, which the surviving Chat card uses, stays and names the file.ChatProvider.onboardingOpenerviaHomeSuggestionComposer.compose(dayZero: .live())and rendered byOnboardingOpenerView, which also owns the "Remember that I…" draft branch.DashboardPage's copy of both was the duplicate.MainChatNavigationRequestStore.request(draft:)→QueryShellHome.takePendingDraftIfAny(). It arrived guarded onusesLegacyPresentation, a symbol this branch deletes; the guard is gone, which is also correct — it is the only composer.OmiApp,FloatingControlBarWindow,RealtimeHubControllerand Settings; untouched by the shell deletion.home-stage.yamlS1–S8 assertstate.homeMode, which onlyDashboardPagepublished, so the flow goes with the page. Its new S9–S12 (open_chat_prefilled,chat_drafts_snapshot,daily_summary_snapshot) are real and move tochat-first.yamlS11a–S11c, on the route that owns them, with the activationcovers:entries that still name live files.Product invariants affected
ChatProvidergains no auth authority; the capability resolve still runs under the existing owner/authorization snapshot and fails to a nil projection, never to a session change.ChatProvider.messages, and dedup/interrupted marking are display-only over kernel turn identity.ChatMessagesViewis untouched; only the row spacing ladder and the dedup helper changed.ChatFirstShellowners (Tasks, Memories, Goals, Apps, Settings); the deleted legacy pages were the reduced copies.loadDashboardTasksis a separate read (voiceget_tasks, the About-user card,SuggestionAssistantgrounding) and stays bounded: its No Deadline bucket is a single capped page, not the whole universe, and no dated bucket is truncated to make a Tasks load smaller.action_items, becauseTaskCaptureModePolicy.usesLegacyStagingis alreadyfalsefor every mode and a capture stays a Candidate until an explicit gesture accepts it. The filter was guarding a row shape that can no longer be written.omi-tool-manifest.tsedits only theget_tasks/get_action_itemsdescriptions; identity, authority, lifecycle, adapter selection and the invocation lease are untouched, and the regenerated Swift surfaces carry only those description strings and their manifest digests.Follow-up: three defects found reading the shipped shell
A reply the reader watched arrive collapsed when it settled
ChatBubbleTruncationclamps any body over 500 characters, and only onceisStreaminggoes false. An answer therefore rendered in full while it streamed — with the transcript following it down — and then collapsed to its own first paragraph the instant it finished. A forty-item list became three items and a "Show more", and the document shrank by thousands of points under a reader pinned to the live edge. Reproduced against the running dev bundle; the "chat stopped scrolling" report is this, seen from the reader's side.Truncation is for restored history, where a long transcript should not be mostly one old reply. A row that settled in front of the reader is the opposite case and now keeps its full body (
ChatBubbleTruncation.settlingKeepsFullBody).The assistant read a different task list than the Tasks page
Asking by voice what was on the list answered "you don't have any tasks overdue or due today" to someone looking at thirty of them.
get_tasksis backed byTasksStore.loadDashboardTasks, which narrowed the list twice in ways the Tasks page never has:createdAftercutoff on undated rows.TasksViewModel.categoryForbuckets ondueAt < startOfTomorrowalone and ages nothing out, so a backlog older than a week was invisible to the assistant and only to the assistant.action_itemsunreviewed. INV-TASK-2 has since made capture suggestion-only —TaskCaptureModePolicy.usesLegacyStagingisfalsefor every mode, and a capture stays a Candidate until an explicit gesture accepts it — so the gate no longer separated reviewed from unreviewed. It hid the user's own backlog, and anything they created by voice, sincecreate_action_itemcomes back stampedconversation.On the reporting account those two took thirty visible tasks to zero. Verified end to end against the running bundle: the buckets now report 82 overdue + 3 due today against the page's own "Today: 85". The per-bucket cap moves 50 → 500 because the count is spoken and 50 understated it.
isPendingSuggestionstays for proactive nudges, the one consumer still asking whether a capture pipeline wrote a row.DashboardTaskLanePolicyhad no other caller and goes. The voice tool descriptions said "overdue + due today" — the source of the spoken wording — and now describe the whole open list.The transcript's own follow-scroll could be read as the reader taking it
Found while tracking the scroll report down; hardening, not the cause of it.
UserScrollDetectorpromotes an open mouse press to reader ownership as soon as the clip view moves, because a scrollbar-track click repositions the viewport without ever emitting a drag — and that test cannot tell the app's follow-scroll from the reader's. While an answer streams the transcript re-reaches the live edge everyChatScrollFollowThrottle.interval, so a press still open when one lands would end follow mode for the rest of the answer; now that every content block is clickable, such a press is ordinary. Two lifecycle holes alongside it: a release delivered to another window (the Select Text popover, a context menu) was dropped by the same-window guard and left the press candidate open for the life of the scroll view, and a second press registered its bounds observer without removing the first.The transcript now records when it moves its own viewport, and movement inside that window re-baselines the press instead of promoting it. A drag and a scrollbar-track click still take ownership, which the existing harness cases pin.
Coverage
DashboardTaskLaneReachTestsdrives real SQLite throughloadDashboardTasksand asserts a month-overdue row, a capture-sourced row, a due-today row and a month-old undated row all reach the lanes.ChatBubbleLayoutRegressionTestspins the settle rule and that restored history still collapses.ChatPressPromotionPolicyTestspins the movement classification. 195 tests across every suite touching the changed APIs pass.Polish pass on the running bundle
A reply folds after two screens, not five lines
ChatBubbleTruncationclamped at 500 characters — five lines — so every real answer collapsed and "Show more" sat under nearly everything. The budget is now measured in viewports of rendered text: a reply may fill two screens before the transcript offers to fold it, and one that long starts folded. Lines are estimated per source line at the column's width, so a bulleted list is measured as the lines it takes rather than the characters it holds, and the cut lands on a line boundary with any open fence closed. The transcript publishes its viewport to the rows through the environment, republished at a coarse step so a resize drag does not re-evaluate every row per frame.ChatBubbleLayoutRegressionTestspins the two-screen budget, the line-based estimate, the line-boundary cut, the fence close, and that the budget follows the transcript's geometry.Streaming reads as a flow
The wire delivers an answer in bursts — a provider chunk, a paragraph the moment a tool returns — and the 35 ms flush dumped everything it had, so the transcript lurched by a sentence and then sat still. Each flush now reveals a paced slice (
ChatStreamingReveal): a small backlog drains over about five flushes, a large one is let through fast enough that the reader is never more than two lines behind the model, and the tail of every burst tapers. Boundary flushes — a tool starting, the turn settling — still land everything at once, so block order is unchanged. The follow scroll eases to the live edge instead of snapping a row at a time; restores and sends stay instant, and Reduce Motion disables the glide.ChatStreamingRevealTestspins the pacing, the in-order reveal past a thinking block, grapheme-safe cuts, and the self-re-arming flush; the live-edge gesture harness still holds drift under 120 pt through a 40-chunk stream.A follow-up's
[1]opens what it points at"Pick one conversation from that day" answered without a tool call, so the turn had no ordinals of its own — and the
[1]it wrote, meaning the first conversation of the previous answer, drew as plain text beside a title nobody could open (read off the running bundle's journal: the turn carried nocitationblocks at all). Ordinals a turn cannot resolve itself are now borrowed from the nearest earlier assistant turn that persisted them; a turn's own provenance always outranks the past. The binding runs at finalize and over every journal projection, so restored history opens the same source.ChatCitationInheritanceTestscovers precedence, bounded lookback, and the projection.The component is the default answer for what Omi draws
The same turn should have rendered the conversation, not named it. The render policy now says so first: default to a component whenever the user asks for a task, goal, memory, conversation or capture, and reserve prose for a request to read — a summary, a recap, an analysis, a comparison, a count, or a list too long to render. The conversation and memory retrieval tools carry the rule with their own block shapes, including follow-ups that narrow an earlier result ("pick one", "the second one"). Tool surfaces and the manifest fixture are regenerated; 757 agent tests pass.
Failure-Class: new
Line-Count-Exception: desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift | 4835 -> 4839 | shellVariant snapshot pinned to chat_first for flows; legacy field removed; follow-glide stage actions
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift | 3116 -> 3127 | floating chat renders rich blocks through the shared renderer
Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift | 5783 -> 5790 | notification kind is required; trial/onboarding excluded from journaling; follow-glide routing
Line-Count-Exception: desktop/macos/Desktop/Sources/MainWindow/Components/OmiMarkdown.swift | 1643 -> 1673 | the explicit selection boundary, and the AppKit prose path chat rows opt into so a reader can drag across an answer in place
Line-Count-Exception: desktop/macos/Desktop/Sources/Stores/TasksStore.swift | 3676 -> 3708 | dashboard lanes match the Tasks page: the two windows removed, plus why the gate that hid AI captures is gone
Line-Count-Exception: desktop/macos/Desktop/Sources/ProactiveAssistants/Services/NotificationService.swift | 1528 -> 1535 | every proactive card passes an explicit notification kind
Line-Count-Exception: desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift | 3567 -> 3608 | one repair migration that clears the local tombstones the Removed lane manufactured over live tasks
Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatProvider.swift | 7290 -> 7326 | earlier: capability resolve moved out of the shell switch, agent cards wired into Home, paced streaming flush re-arms itself; now: hand-written field-by-field Equatable for ChatContentBlock so bubble identity stops JSON-encoding both sides per pass
Line-Count-Exception: desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift | 2102 -> 2119 | the collapse budget is sized from the transcript viewport rather than a character count
🤖 Generated with Claude Code
Line-Count-Exception: desktop/macos/Desktop/Sources/AuthService.swift | 2845 -> 2869 | the chat-first shell extends the registry and auth restore owns a resolving watchdog
Line-Count-Exception: desktop/macos/Desktop/Sources/Rewind/UI/RewindPage.swift | 1779 -> 1783 | the capture-state label now distinguishes a dead-but-enabled capture ("Capture Stopped") from the setting being off, so the control cannot read as contradicting its own knob