Skip to content

fix(mobile): follow desktop's queued-message rules in structured chats - #33980

Closed
AmoabaKelvin wants to merge 47 commits into
mainfrom
mobile-chat-queue-rules
Closed

AmoabaKelvin wants to merge 47 commits into
mainfrom
mobile-chat-queue-rules

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 61 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1323 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2124 $\color{#cf222e}{\Huge{\mathbf{−}}}$​801
Prod 142 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2741 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2599 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​142

Stacked on #33977: review the commits after 8494f24.

ELI5

Messages queued in a structured chat now follow desktop's rules on the phone. Turning off "Queue follow-ups" works from the phone. An edit to a queued card is no longer lost when the agent picks the card up. /clear and /compact wait for the same things they wait for on desktop.

What Changed

  • Queued-card projection (native-chat I attached a github issue with this worktree, but I have no way of seeing it #17 / agent-sessions Fix first worktree card top border cutoff #15).
    • Before: the phone had its own copy of the card projection, steer rule and a separate queue reducer, and an image-only queued draft showed a blank card.
    • Now: the projection, steer, pause, command-waiting and returned-caption rules and the image label live once in src/shared/structured-agent-session-queued-cards.ts (plus native-chat-image-label.ts).
    • Image-only cards show the image name or "N images", like desktop.
    • The phone's queue reducer is deleted; it reads the queue from the shared reducer.
  • Queue follow-ups (agent-sessions Linux support #1). Before: with the setting off, a mid-turn send from the phone still waited as a queued card. Now: both apps use structuredAgentSessionQueueEnabled, and the host's settings.get projection includes nativeChatQueueFollowUps, so with it off the phone sends straight into the running turn like desktop.
  • Queued edit hand-off (native-chat Fix PTY listener leak, use local restty with selection support #5 / agent-sessions Add Shift+Enter to insert newline in terminal #3). Before: if the card left the queue, Save came back gone or changed, or you switched chats, the phone closed the editor and dropped your text. Now: unsaved text moves into the chat box with desktop's notice ("This message was already sent or removed. Your edit is in the chat box."). queuedEditStanding and the notice copy moved into src/shared/queued-message-edit.ts.
  • /clear and /compact holds (agent-sessions Improve terminal font rendering, per-pane zoom, and UI zoom #7).
    • Before: the phone held these only while a prompt was open or the agent was working.
    • Now: structuredConversationCommandHold and the failure text moved to src/shared/structured-conversation-command-hold.ts. The phone also holds for background tasks, a send still going out, a queued /compact ahead, and a command already running.
    • A start failure that a row already shows isn't repeated, and errors name the agent.
    • The phone keeps a small per-chat map of in-flight sends for this.

Why

Desktop logic wins in the mobile/desktop parity audit. The phone ignored a user setting, lost typed edits, and fired commands desktop would hold. One shared rule set fixes all of this.

Linked Issue

Part of the mobile/desktop parity audit

Visual Proof

No device captures for this fleet. The change adopts desktop's existing behavior from these files:

  • structured-agent-session-queued-cards.ts
  • use-structured-agent-session.ts (queue enable)
  • use-structured-agent-session-queued-edit.ts (hand-off)
  • structured-conversation-command-send.ts (holds)

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Desktop queued-card tests moved with the rule.

  • The host settings projection has a new spec.

  • Mobile tests that pinned the deleted copies are removed: the feed reducer test and six caption tests.

  • Focused root native-chat, shared and runtime-settings tests pass, as do mobile src/session and settings-read-operations tests.

AI Disclosure

Review

Codex review, 3 rounds.

  • Round 1: an edit could land in the wrong chat after a tab switch (fixed), and a type error from widening the queue type (fixed).
  • Round 2: the send hold leaked across chats (fixed), and the setting could go stale (now re-read per chat).
  • Round 3: a published null queue now reads as empty, matching the removed phone reducer.
  • Rejected: a stale setting while staying in one chat. The phone has no settings stream, so the value is read on connect and chat open.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile behavior removed (desktop wins):

  • Unsaved queued-edit text is no longer dropped; it moves to the chat box.
  • The editor no longer stays open with a "changed" notice when the card changed before editing began; it closes as on desktop.
  • After a lost Save reply where the card already holds the edit, the editor closes.
  • A command counts as accepted only when the host reports it completed with no error.
  • A second command while one runs shows "agent still working" instead of a silent rejection.

Desktop: no behavior change. The pendingWork notice moved to the shared key writeNotice.pendingWork, with translations moved in all 7 locales.

Deferred features (new phone UI): a Queue follow-ups toggle on the phone, the "Sending…" queued card, and image edits in the phone's queued editor.

Compatibility:

  • Host change: settings.get also returns nativeChatQueueFollowUps. A missing field (old host) means on, which is the old phone behavior. An old phone ignores the field.
  • default-global-settings.ts is unchanged.
  • Folder workspaces, SSH and all host OSes are unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-queue-rules branch 2 times, most recently from 72ce24c to 45e3fb3 Compare October 27, 2026 01:20
@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 27, 2026 01:21
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

This pull request moves native-chat logic from mobile and renderer modules into shared helpers. It adds shared handling for pending sends, session-option labels and caching, model discovery, command holds, tool views, image labels, and queued-edit state. Mobile and renderer code now call those helpers for copy text, tool output, diff display, queue cards, and availability checks. Mobile structured option writes now use tracked picks and turn-aware reads. Queue-follow-up settings now flow from runtime settings into send behavior. Many tests were updated or removed with the moved logic.

Priority: Pending latest changes

Merge Risk: Moderate · up to 08168

The change moves native-chat behavior into shared helpers. Its static-analysis check currently fails on a duplicate import that is a trivial fix, and it must pass before merge. Two smaller issues remain: a queued or pending message bubble can linger on a phone whose clock is skewed from the host, and image-only labels may show untranslated English text.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.65% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the scope, user impact, rationale, testing, compatibility, review history, and checklist status. It does not provide an actual linked issue, and the visual-proof section does … Add the actual issue reference under Linked Issue, such as Fixes #12345 or the applicable existing issue. Add before/after screenshots or a video for the changed mobile behavior; if visual proof is genuinely impossible, write exactly `N/A…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "fix(mobile): follow desktop's queued-message rules in structured chats" matches the main change. The diff moves queued-card projection, queue follow-up enablement, queued-edit hand-off, and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(mobile): follow desktop's queued-message rules in structured chats" matches the main change. The diff moves queued-card projection, queue follow-up enablement, queued-edit hand-off, and /clear and /compact holds onto shared logic that desktop and mobile both use. The title is specific, concise, and under 72 characters.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.65% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 92 functions across 86 files. (8 skipped: 8 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description explains the scope, user impact, rationale, testing, compatibility, review history, and checklist status. It does not provide an actual linked issue, and the visual-proof section does not include the required before/after captures or the exact N/A statement with a valid reason for this behavior/UI change.

Resolution

Add the actual issue reference under Linked Issue, such as Fixes #12345 or the applicable existing issue. Add before/after screenshots or a video for the changed mobile behavior; if visual proof is genuinely impossible, write exactly N/A and briefly explain why.

Finishing Touches: 💡 3
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
⚔️ Resolve merge conflicts: 💡
  • Resolve merge conflict in branch mobile-chat-queue-rules
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-queue-rules branch 5 times, most recently from 342c582 to 1d001e3 Compare October 27, 2026 04:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84d18736-d226-477a-862b-15cfa7554490
Commits

Reviewing files that changed from the base of the PR and between 887b781 and 1d001e3.

Files selected for processing: 196
  • config/flaky-test-pattern-baseline.txt
  • config/tsconfig.node.json
  • mobile/src/session/MobileNativeChatDiffCard.tsx
  • mobile/src/session/MobileNativeChatFullContent.tsx
  • mobile/src/session/MobileNativeChatMessage.tsx
  • mobile/src/session/MobileNativeChatMessageActionsSheet.tsx
  • mobile/src/session/MobileNativeChatToolLine.tsx
  • mobile/src/session/MobileNativeChatToolRun.tsx
  • mobile/src/session/MobileNativeChatView.streaming-rows.test.ts
  • mobile/src/session/MobileNativeChatView.tsx
  • mobile/src/session/MobileQueuedMessageCardRow.tsx
  • mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts
  • mobile/src/session/mobile-native-chat-message-plain-text.test.ts
  • mobile/src/session/mobile-native-chat-message-plain-text.ts
  • mobile/src/session/mobile-native-chat-pending-baseline.test.ts
  • mobile/src/session/mobile-native-chat-pending-baseline.ts
  • mobile/src/session/mobile-native-chat-render-data.test.ts
  • mobile/src/session/mobile-native-chat-render-data.ts
  • mobile/src/session/mobile-omp-session-catalog.ts
  • mobile/src/session/mobile-session-option-records.ts
  • mobile/src/session/mobile-structured-composer-command.test.ts
  • mobile/src/session/mobile-structured-composer-command.ts
  • mobile/src/session/mobile-structured-queued-message-cards.test.ts
  • mobile/src/session/mobile-structured-queued-message-cards.ts
  • mobile/src/session/mobile-structured-queued-message-feed.test.ts
  • mobile/src/session/mobile-structured-queued-message-feed.ts
  • mobile/src/session/native-chat/composer/MobileNativeChatComposer.test.ts
  • mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.test.ts
  • mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.test.tsx
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts
  • mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionSegments.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatTaskList.tsx
  • mobile/src/session/native-chat/input/mobile-native-chat-session-option-labels.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-session-option-persistence.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-session-option-controller.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.test.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts
  • mobile/src/session/native-chat/mobile-native-chat-eligibility.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-eligibility.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-echo.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-echo.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-pasted-content.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-retirement.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-retirement.ts
  • mobile/src/session/native-chat/use-mobile-native-chat-unconfirmed-sends.ts
  • mobile/src/session/use-mobile-native-chat-controller.test.ts
  • mobile/src/session/use-mobile-native-chat-model-discovery.test.ts
  • mobile/src/session/use-mobile-native-chat-model-discovery.ts
  • mobile/src/session/use-mobile-native-chat-queue-follow-ups.ts
  • mobile/src/session/use-mobile-native-chat-readability.ts
  • mobile/src/session/use-mobile-native-chat-turn-disclosure-opening-send.test.tsx
  • mobile/src/session/use-mobile-omp-model-discovery.ts
  • mobile/src/session/use-mobile-structured-agent-options.first-frame.test.ts
  • mobile/src/session/use-mobile-structured-agent-options.permission-mode.test.ts
  • mobile/src/session/use-mobile-structured-agent-options.test.ts
  • mobile/src/session/use-mobile-structured-agent-options.ts
  • mobile/src/session/use-mobile-structured-agent-session-queued.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-structured-agent-state.ts
  • mobile/src/session/use-mobile-structured-background-tasks.ts
  • mobile/src/session/use-mobile-structured-native-chat-send-bridge.test.ts
  • mobile/src/session/use-mobile-structured-option-state.ts
  • mobile/src/session/use-mobile-structured-queued-edit.test.tsx
  • mobile/src/session/use-mobile-structured-queued-edit.ts
  • mobile/src/session/use-mobile-structured-queued-message-controls.ts
  • mobile/src/session/use-mobile-structured-send-with-outcome.ts
  • mobile/src/session/use-mobile-structured-sends.test.tsx
  • mobile/src/session/use-mobile-structured-sends.ts
  • mobile/src/session/use-mobile-structured-session-option-stamp.ts
  • mobile/src/transport/settings-read-operations.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-codex-version-recovery.test.ts
  • src/main/runtime/runtime-client-settings-queue-follow-ups-projection.test.ts
  • src/main/runtime/runtime-client-settings-shape.ts
  • src/main/runtime/runtime-client-settings.ts
  • src/main/runtime/runtime-store-contract.ts
  • src/renderer/src/components/native-chat/NativeChatDiffCard.tsx
  • src/renderer/src/components/native-chat/NativeChatImageAttachmentPreview.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatModelCombobox.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageCard.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageEditor.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.inline-edit.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatResolvedView.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx
  • src/renderer/src/components/native-chat/NativeChatSessionOptionRows.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx
  • src/renderer/src/components/native-chat/NativeChatTaskList.tsx
  • src/renderer/src/components/native-chat/NativeChatToolLine.tsx
  • src/renderer/src/components/native-chat/NativeChatToolOutput.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx
  • src/renderer/src/components/native-chat/agent-session-write-notice-text.ts
  • src/renderer/src/components/native-chat/claude-model-switch-confirmation.ts
  • src/renderer/src/components/native-chat/native-chat-composer-draft-persistence.ts
  • src/renderer/src/components/native-chat/native-chat-context-command.test.tsx
  • src/renderer/src/components/native-chat/native-chat-image-label.ts
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/renderer/src/components/native-chat/native-chat-launch-default-adoption.test.ts
  • src/renderer/src/components/native-chat/native-chat-message-copy-text.ts
  • src/renderer/src/components/native-chat/native-chat-pane-resolution.ts
  • src/renderer/src/components/native-chat/native-chat-pending.test.ts
  • src/renderer/src/components/native-chat/native-chat-pending.ts
  • src/renderer/src/components/native-chat/native-chat-pty-retired-model.test.ts
  • src/renderer/src/components/native-chat/native-chat-retire-persisted-model.test.ts
  • src/renderer/src/components/native-chat/native-chat-session-assembler.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-cache.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-labels-text.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-labels.ts
  • src/renderer/src/components/native-chat/native-chat-stopped-before-start-row.ts
  • src/renderer/src/components/native-chat/native-chat-tool-line-label.ts
  • src/renderer/src/components/native-chat/omp-model-switch-capability.test.ts
  • src/renderer/src/components/native-chat/queued-message-edit-notices.ts
  • src/renderer/src/components/native-chat/structured-agent-session-queued-edit-images.ts
  • src/renderer/src/components/native-chat/structured-agent-session-queued-edit-standing.ts
  • src/renderer/src/components/native-chat/structured-agent-session-sending-queued-cards.test.ts
  • src/renderer/src/components/native-chat/structured-agent-session-sending-queued-cards.ts
  • src/renderer/src/components/native-chat/structured-agent-session-status-hooks.ts
  • src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts
  • src/renderer/src/components/native-chat/structured-conversation-command-send.ts
  • src/renderer/src/components/native-chat/use-native-chat-local-command-answer.ts
  • src/renderer/src/components/native-chat/use-native-chat-pending-delivery.ts
  • src/renderer/src/components/native-chat/use-native-chat-picker-command-dispatch.ts
  • src/renderer/src/components/native-chat/use-native-chat-pty-composer-send.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-option-command.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.surface-owner.test.ts
  • src/renderer/src/components/native-chat/use-native-chat-toggle-shortcut.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-option-state.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-options.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.test.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-send-options.test.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-send-options.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-sends.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/renderer/src/components/status-bar/workspace-space-format.ts
  • src/renderer/src/components/tab-bar/tab-bar-item-surface.tsx
  • src/renderer/src/components/terminal-pane/use-terminal-pane-chat-state.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-session-write-notice-copy.ts
  • src/shared/format-bytes.ts
  • src/shared/native-chat-availability.test.ts
  • src/shared/native-chat-availability.ts
  • src/shared/native-chat-discovered-catalog-models.ts
  • src/shared/native-chat-image-label.ts
  • src/shared/native-chat-message-copy-text.test.ts
  • src/shared/native-chat-message-copy-text.ts
  • src/shared/native-chat-pending-occurrence.test.ts
  • src/shared/native-chat-pending-occurrence.ts
  • src/shared/native-chat-pending-pasted-content.test.ts
  • src/shared/native-chat-pending-sends.test.ts
  • src/shared/native-chat-pending-sends.ts
  • src/shared/native-chat-pty-session-options.test.ts
  • src/shared/native-chat-pty-session-options.ts
  • src/shared/native-chat-session-option-apply.ts
  • src/shared/native-chat-session-option-cache.ts
  • src/shared/native-chat-session-option-dispatch.ts
  • src/shared/native-chat-session-option-labels.test.ts
  • src/shared/native-chat-session-option-labels.ts
  • src/shared/native-chat-stopped-before-start.ts
  • src/shared/native-chat/input/native-chat-task-list.ts
  • src/shared/native-chat/tools/native-chat-edit-model.ts
  • src/shared/native-chat/tools/native-chat-tool-activity.ts
  • src/shared/native-chat/tools/native-chat-tool-line-view.ts
  • src/shared/native-chat/tools/native-chat-tool-output.ts
  • src/shared/native-chat/tools/native-chat-tool-run-header.ts
  • src/shared/queued-message-edit.ts
  • src/shared/structured-agent-session-option-pick-book.test.ts
  • src/shared/structured-agent-session-option-pick-book.ts
  • src/shared/structured-agent-session-option-state.ts
  • src/shared/structured-agent-session-queued-cards.test.ts
  • src/shared/structured-agent-session-queued-cards.ts
  • src/shared/structured-conversation-command-hold.test.ts
  • src/shared/structured-conversation-command-hold.ts
  • tests/e2e/native-chat-startup-option-pickers.unit.test.ts
  • tests/e2e/structured-permission-report-publication.unit.test.ts
Files with no reviewable changes: 21
  • mobile/src/session/mobile-structured-queued-message-feed.test.ts
  • mobile/src/session/use-mobile-native-chat-turn-disclosure-opening-send.test.tsx
  • config/flaky-test-pattern-baseline.txt
  • mobile/src/session/native-chat/mobile-native-chat-pending-echo.test.ts
  • mobile/src/session/mobile-native-chat-message-plain-text.ts
  • mobile/src/session/mobile-native-chat-message-plain-text.test.ts
  • mobile/src/session/mobile-native-chat-merged-snapshot-parity.test.ts
  • config/tsconfig.node.json
  • mobile/src/session/mobile-session-option-records.ts
  • mobile/src/session/mobile-native-chat-pending-baseline.test.ts
  • mobile/src/session/use-mobile-omp-model-discovery.ts
  • mobile/src/session/mobile-omp-session-catalog.ts
  • mobile/src/session/mobile-native-chat-pending-baseline.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-retirement.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-pasted-content.test.ts
  • mobile/src/session/mobile-structured-queued-message-feed.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-labels.ts
  • src/renderer/src/components/native-chat/structured-agent-session-queued-edit-standing.ts
  • mobile/src/session/mobile-native-chat-render-data.test.ts
  • src/renderer/src/components/native-chat/structured-conversation-command-send.test.ts
  • mobile/src/session/native-chat/mobile-native-chat-pending-retirement.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +21 to +33
export function nativeChatImageLabel(
block: NativeChatImageRefBlock,
copy: NativeChatImageLabelCopy
): string {
return (
block.alt?.trim() ||
(block.path && isNativeChatPastedImagePath(block.path)
? copy.pastedImage
: block.path
? getRuntimePathBasename(block.path)
: 'Image')
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

Route the 'Image' fallback through NativeChatImageLabelCopy.

nativeChatImageLabel accepts a copy object so that desktop can pass translated words. The fallback for a block with no alt and no path is still a hardcoded English 'Image'. A block with only a url takes that branch. Desktop then shows an untranslated label in localized chats. Add an image entry to NativeChatImageLabelCopy and to NATIVE_CHAT_IMAGE_LABEL_ENGLISH. Then update the renderer's translated copy.

Proposed fix
 export type NativeChatImageLabelCopy = {
   pastedImage: string
+  image: string
   imageCount: (count: number) => string
 }
 
 export const NATIVE_CHAT_IMAGE_LABEL_ENGLISH: NativeChatImageLabelCopy = {
   pastedImage: 'Pasted image',
+  image: 'Image',
   imageCount: (count) => `${count} images`
 }
@@
       : block.path
         ? getRuntimePathBasename(block.path)
-        : 'Image')
+        : copy.image)

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-queue-rules branch 3 times, most recently from d510e1a to 0816891 Compare October 27, 2026 13:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7002ffe-e09e-42da-853e-96167282ad15
Commits

Reviewing files that changed from the base of the PR and between d510e1a and 0816891.

Files selected for processing: 61
  • mobile/src/session/MobileNativeChatDiffCard.tsx
  • mobile/src/session/MobileNativeChatFullContent.tsx
  • mobile/src/session/MobileNativeChatView.streaming-rows.test.ts
  • mobile/src/session/MobileQueuedMessageCardRow.tsx
  • mobile/src/session/mobile-native-chat-message-plain-text.ts
  • mobile/src/session/mobile-session-option-records.ts
  • mobile/src/session/mobile-structured-queued-message-cards.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.test.tsx
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts
  • mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts
  • mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatSessionOptionSegments.tsx
  • mobile/src/session/native-chat/input/mobile-native-chat-session-option-labels.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-session-option-persistence.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts
  • mobile/src/session/native-chat/transcript/MobileNativeChatToolLine.tsx
  • mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.tsx
  • mobile/src/session/use-mobile-queued-message-composer-actions.ts
  • mobile/src/session/use-mobile-structured-agent-session-queued.test.tsx
  • mobile/src/session/use-mobile-structured-queued-message-controls.ts
  • src/renderer/src/components/native-chat/NativeChatModelCombobox.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageCard.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageImageCount.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.arrival.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageRows.test.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageRows.tsx
  • src/renderer/src/components/native-chat/native-chat-image-paste.ts
  • src/renderer/src/components/native-chat/native-chat-message-copy-text.ts
  • src/renderer/src/components/native-chat/native-chat-pending.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-cache.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-labels.ts
  • src/renderer/src/components/native-chat/use-native-chat-picker-command-dispatch.ts
  • src/renderer/src/components/native-chat/use-native-chat-pty-composer-send.ts
  • src/renderer/src/components/native-chat/use-native-chat-session-options.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.test.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-reorder.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/native-chat-discovered-catalog-models.ts
  • src/shared/native-chat-message-copy-text.ts
  • src/shared/native-chat-pty-session-options.test.ts
  • src/shared/native-chat-pty-session-options.ts
  • src/shared/native-chat-session-option-apply.ts
  • src/shared/native-chat-session-option-cache.ts
  • src/shared/native-chat-session-option-labels.test.ts
  • src/shared/native-chat-session-option-labels.ts
  • src/shared/structured-agent-session-option-state.ts
Files with no reviewable changes: 3
  • mobile/src/session/mobile-native-chat-message-plain-text.ts
  • mobile/src/session/mobile-session-option-records.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-labels.ts
Files skipped from review as they are similar to previous changes: 6
  • src/renderer/src/i18n/locales/en.json
  • src/shared/structured-agent-session-option-state.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/components/native-chat/use-structured-agent-session-queued-edit.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Comment on lines +154 to +160
boundary: {
afterMessageId: tail?.id ?? null,
afterMessageTimestamp: tail?.timestamp ?? null,
...(transcriptSettled && !tail && sessionId
? { afterEmptyTranscriptSessionId: sessionId }
: {})
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
# Find production callers of captureSendOrigin and check whether they pass a host-aligned sentAt.
rg -nP --type=ts -C3 '\bcaptureSendOrigin\s*\(' mobile/src -g '!**/*.test.*'

# Inspect how the shared boundary compares timestamps.
fd -t f 'native-chat-pending-occurrence.ts|native-chat-pending-sends.ts' src/shared --exec rg -nP -C6 'afterMessageTimestamp|messagesAfterPendingBoundary|sentAt' {}

Repository: stablyai/orca

Length of output: 7431


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- use-mobile-native-chat-message-send.ts ---'
nl -ba mobile/src/session/use-mobile-native-chat-message-send.ts | sed -n '1,125p'
printf '%s\n' '--- use-mobile-structured-native-chat-send-bridge.ts ---'
nl -ba mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts | sed -n '1,95p'
printf '%s\n' '--- captureSendOrigin definitions and related types ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -C8 'function captureSendOrigin' mobile/src src/shared || true
rg -n -F --glob '*.ts' --glob '*.tsx' -C6 'captureSendOrigin' mobile/src/session src/shared
printf '%s\n' '--- changed drafts boundary and send-origin use ---'
nl -ba mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts | sed -n '1,220p'
printf '%s\n' '--- timestamp producers in the explicit caller ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'sentAt' -e 'Date.now' mobile/src/session/use-mobile-native-chat-message-send.ts mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts

Repository: stablyai/orca

Length of output: 41600


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- shared pending boundary implementation ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'function messagesAfterPendingBoundary' -e 'afterEmptyTranscriptSessionId' -e 'nativeChatPendingMatchingAfter' src/shared mobile/src/session
printf '%s\n' '--- complete owning shared file ---'
file=$(rg -l -F --glob '*.ts' 'function messagesAfterPendingBoundary' src/shared mobile/src/session | head -n1)
test -n "$file"
nl -ba "$file" | sed -n '1,115p'
printf '%s\n' '--- production sendWithOutcome calls with sentAt context ---'
rg -n -P --type=ts --type=tsx -C6 'sendWithOutcome\s*\(' mobile/src/session mobile/src | head -n 260
printf '%s\n' '--- definitions and calls of the explicit message sender ---'
rg -n -P --type=ts --type=tsx -C5 'sendWithOutcome:\s*\(' mobile/src/session

Repository: stablyai/orca

Length of output: 7333


Do not use the phone clock as a host-transcript boundary.

When the structured-chat bridge sends with no transcript tail and the transcript is not settled, captureSendOrigin stores no host timestamp and defaults sentAt to Date.now(). messagesAfterPendingBoundary then filters host rows with message.timestamp >= sentAt. A host echo with a lower timestamp can remain unmatched, so the pending bubble can persist.

Use a host-aligned boundary, or defer matching until an authoritative transcript boundary is available.

} from './native-chat-session-option-cache'
import { createSessionOptionAppliers } from './native-chat-session-option-apply'
import { buildNativeChatSessionOptionSnapshot } from './native-chat-session-option-snapshot'
import { buildNativeChatSessionOptionSnapshot } from './native-chat/input/native-chat-session-option-snapshot'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Major · Maintainability & Code Quality · Quick win

Combine the snapshot imports to unblock static analysis.

Line 20 and the following import read from the same module. Oxlint reports this duplicate import, and --deny-warnings fails the static-analysis job. Add buildNativeChatSessionOptionSnapshot to the following import and remove the separate import. (raw.githubusercontent.com)

Tools
GitHub Actions: PR 33980 | source 83225c4 | workflow 83225c4 | unit full / 17_static analysis and typecheck.txt

[error] 20-20: Command node node_modules/oxlint/bin/oxlint --type-aware --config config/oxlint-code-quality-type-aware.json src config tests --deny-warnings failed because Oxlint reported: "Modules should not be imported multiple times in the same file". The warning was treated as an error by --deny-warnings.

GitHub Actions: PR 33980 | source 83225c4 | workflow 83225c4 | unit full / static analysis and typecheck

[error] 20-20: Oxlint reported that modules should not be imported multiple times in the same file. The check ran with --deny-warnings and failed with exit code 1.

Source: Pipeline failures

Mobile now uses the shared detected-then-launch precedence and transcript-readability check; the phone's remembered agent only fills in after them.
Copy now leaves out roster and background-task fallback twins and wordless provider frames.
Mobile reuses it instead of its own matcher.
…hed ones

Uses desktop's rule: rows before the send no longer retire an echo, a send that
never lands no longer lets later glued sends retire, and an unmatched echo sits
below later turns.
The phone keeps one option surface per chat, so a pick that lands after leaving
and returning shows there, and a picker command only switches the chat it came
from. Discovered models merge with the seed catalog as on desktop, so Grok keeps
its effort picker. A Claude model switch the phone cannot confirm is never
saved as a launch default.
A tab that runs another agent drops its kept option surfaces, report markers
and cached record, so a fresh session shows its own model. A pick that lands
after the phone moved to another chat is not saved as a launch default.
A write that lands after its tab started another agent no longer publishes the
old agent's record, and a changed OMP switch capability rebuilds the chat's
surface from the cache instead of reviving an older one.
Desktop translation pieces use literal English defaults so the localization gate can read them, the selected-choice lookup is shared once, and the phone keeps one option surface per tab with the agent change detected from the cached record.
…mobile

Desktop and the phone now track picks per option through one shared book: a
repeat of an option on its way waits, other options go together, a lost reply
is not a pick done, and a stale reply only commits its own option. The phone
also re-reads options each turn and after the provider starts, and shows picks
at once while the host is still starting the provider.
…dget and pass the phone turn in the e2e harness
Image-only queued drafts showed a blank card on the phone.
With it off, a mid-turn send from the phone still queued while desktop sent it into the running turn.
The phone closed the editor and dropped the typing; it now goes to the chat box as on desktop.
The phone fired the command where desktop holds it, showed start failures twice, and left the agent unnamed in failures.
@AmoabaKelvin

Copy link
Copy Markdown
Collaborator Author

Folded into #34000 to land the stack in one pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant