Skip to content

Show other agents' waiting messages at the end of the chat, not in my queue - #45882

Merged
brennanb2025 merged 39 commits into
mainfrom
brennanb2025/agent-mail-pending-row
Nov 24, 2026
Merged

brennanb2025 merged 39 commits into
mainfrom
brennanb2025/agent-mail-pending-row

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When another agent sends a busy chat a message, Orca used to park it in the box above the composer, where your own queued messages live, so it looked like something you typed. Now it waits at the bottom of the chat as a faded "Message from …" row and turns into a normal row when the agent picks it up.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​322 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​322
Prod 58 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2275 $\color{#cf222e}{\Huge{\mathbf{−}}}$​422 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1853

What Changed

Applies only to messages from other agents (orchestration send, worker mail, bot hand-offs). Your own follow-ups keep today's composer queue.

  • A waiting agent message no longer shows as a composer-queue card. It is drawn after the chat's live activity in the shape it will have once delivered, dimmed, with no time and no status text. Screen readers hear "…, not sent yet", and a new arrival is announced. Rows scrolled far away stay reachable by Tab and screen readers.
  • When the agent takes it, the delivered row replaces it in place (an open row stays open).
  • Steer (Send when idle), Edit and Delete are on the row: on hover or keyboard focus on desktop, always on the phone. Edit works as on main: it opens the queue's editor, and saving makes the text your own message.
  • Clear all still removes held agent messages, as it did when they were cards. A paused queue keeps Paused, Clear all and Resume.
  • While a new bot's setup screen shows, its waiting mail sits below setup (up to half the pane, scrolling by itself) instead of over setup's buttons.
  • A message that failed or came back keeps its card, where its caption says why. A chat with no transcript yet (empty or loading) also keeps cards.
  • Delivery is unchanged: the host's queue, its order, Stop and restart behave as before (worker mail still flows after Stop; orchestration mail may still steer ahead of queued follow-ups).

Mechanism: the client splits the host's queue. Agent mail is drawn from the queue itself at the transcript's end, outside the message projection, so queue changes never re-project history. Rows far from view keep only their height (desktop and phone), so a long backlog costs only the rows on screen.

Why

The composer queue is where your own pending words live; another agent's message there reads as if you wrote it. Drawing it in its delivered shape at the end of the chat says who sent it and that it hasn't gone in yet, without touching delivery, persistence or recovery.

Linked Issue

Tracked in STA-16774.

Visual Proof

Before (main): agent mail as a "From an agent" card in your queue.
Before

After: the waiting message dimmed under "Working…", your own follow-up still in the queue.
After

Row actions on hover, and a paused queue with your card plus waiting mail:
Hover actions
Paused

A new bot's setup screen with 20 waiting messages below it (final head):
Setup with waiting mail

Testing

macOS desktop, real OpenCode chats, mail sent through the app's own CLI, 1280x800: pending look and keyboard reach; delivery in place; mail arriving while your own message still says "Sending…" (caught at +24 ms) and Stop pressed during "Sending…" (+22 ms); Stop with mail waiting; Steer and the steer shortcut (mail first in line, and during a drag); Edit / Cancel / Save / Delete / Send; Paused with Clear all and Resume; your own queue unchanged; two graceful restarts with mail waiting. a 30-message backlog scrolled fast both ways (no blank band, no jump, an opened row stays open); Edit while the queue is folded. Every message was delivered exactly once; deleted or cleared ones never were.

Also with real Claude and Codex chats as targets and senders: delivery in place once, Steer, Edit/Save, Delete, your own follow-ups, Stop with mail waiting, focus kept while scrolled away, and Tab reaching every waiting row.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Projection tests cover the queue split, hand-off in place, Stop, restart and rejected sends.

Performance

Waiting rows are memoized per message and read their own sender only; arrivals redraw only the new row. Rows far from view hold no card, subscriptions or animation. Rows without a time keep no clock. No new timers, polling or host work.

Risk

The riskiest part is the hand-over: a waiting row must vanish exactly when its delivered row appears. If that broke, a message could show twice or not at all on screen; the host's queue is unchanged, so nothing is lost or resent. Waiting agent messages can no longer be dragged to a new place in the queue (Steer sends any of them first). No saved data, settings or wire format change; older hosts that send no sender keep cards. A plain revert restores the old presentation.

Level: Medium

AI Disclosure

Review

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

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)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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)

@brennanb2025 brennanb2025 changed the title Draw other agents' waiting messages at the end of the chat, not in the composer queue Show other agents' waiting messages at the end of the chat, not in my queue Nov 20, 2026
…e the transcript projection; narrow stable row-actions context; Edit on waiting mail
…r a bot's setup screen, Edit kept on hosts without in-place edits, image count on mobile
… presses mail at the queue's head, focus returns to the composer after Send or Delete
…okup indexed per roster, one copy of the rows over bot setup, mobile rows memoized
…mobile queue cards ignore streaming unless a card's failure caption reads it
…agent-mail-ui

# Conflicts:
#	mobile/src/i18n/locales/en.json
#	mobile/src/session/native-chat/input/queued-messages/MobileNativeChatQueuedMessages.tsx
#	mobile/src/session/native-chat/transcript/agent-messages/MobileNativeChatAgentMessageCard.tsx
#	src/renderer/src/components/native-chat/messages/rows/NativeChatAgentMessageCard.tsx
#	src/renderer/src/components/native-chat/pane/actions/use-structured-native-chat-submit-reveal.test.ts
#	src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageList.tsx
#	src/renderer/src/i18n/locales/en.json
… the queue's head, no clock for rows without a time, Steer greyed while the host can't send, setup overlay opaque, phone keeps cards in an empty chat
…w, body text read once per body, phone Delete all holds the mail it deletes, row re-measures when its actions change
…n arrival redraws no other row's buttons; missing useMemo import
…arrivals are announced, phone rows over setup scroll within half the screen and the list's end is tracked through resizes
…al is announced; phone rows under setup pause their ring by the setup scroller's own place
… rows that come into or leave view; a far row keeps its height and none of its card
…ap areas stay within half the gap to the next row, a row arriving off screen is windowed, and a reflow rebuilds the window once per frame
…none of their card; an editor opened from a waiting row opens a folded queue
…ows are observed against their own scroller; an edit opens a folded queue once
…er its controls and keeps rows' open state; bot lookup indexed once per catalog snapshot
…scroll box; setup content stays reachable when squeezed
@brennanb2025

brennanb2025 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Review status: ready (head 35a3f97, main merged)

Problem: a message another agent sent to a busy chat showed up in the composer queue, next to your own queued messages, so it looked like something you typed.

User-facing change: that mail now waits at the end of the chat as a dimmed "Message from …" row, with no time or status, and becomes a normal row in place when delivered. Steer / Edit / Delete sit on the row; Edit keeps main's behavior (saving makes it your own message). Your own follow-ups, Paused / Clear all / Resume, and delivery order, Stop and restart are unchanged. Under a new bot's setup screen, the mail sits below setup instead of over it.

Fixed during review: Clear all includes held agent mail; no clock for rows without a time; rows far from view keep only their height (desktop and phone) so a long backlog costs only what's on screen; one bot-catalog index per snapshot; setup screen and its mail block no longer overlap, setup's top stays reachable, held rows under setup keep their height. From the last review round: held desktop rows stay named Tab / screen-reader stops that draw when focused; a focused row is never dropped while scrolled away; phone rows show no running badge, follow the drawn transcript, are all reachable while VoiceOver/TalkBack runs, and new arrivals are spoken (only while a screen reader runs, only for mail new to the open, loaded chat); phone row actions under setup work with the keyboard up.

Deferred (P2): Shift+Tab onto a held desktop row lands on the row before its buttons (one Tab reaches them); a screen reader may read the drawn card instead of the held row's short label on Tab focus; the desktop live region can re-announce a row when it remounts; an Edit click looks inert when the queue is folded during another edit; desktop Edit/Delete labels don't name the sender; on a squeezed setup screen the floating bot-name pill partly covers the avatar. Decided trade-off: waiting agent mail can't be dragged to a new queue position (Steer sends any of them first). With Claude and Codex, mail joins a running turn within ~13 ms (host rule, unchanged), so the dimmed row is mostly seen while a turn is blocked (approval, an open edit).

Verified:

  • Regression audit on 35a3f97: SAFE. Claude and Codex reviews clean. Performance scan clean on 35a3f97 (comment below), including the phone footer subscriptions.
  • QA on macOS with real Claude and Codex chats (round 7 on ae8bab3, 7b on 35a3f97; later commits are phone-only): pending look, delivery in place once, Steer, Edit/Save, Delete, your own follow-ups in the queue, focus kept 2,000+ px away, Stop with mail waiting, Tab reaching all 15 held rows and their buttons, constant scroll height. Earlier rounds with OpenCode: Sending-window and Stop races, Paused, restarts, a 30-message backlog, bot setup with 20 waiting messages and hand-over.
  • Remote check (format, lint, typecheck, affected tests, mobile typecheck and lint) passed on 35a3f97.

(screenshot removed: contained real product data)
(screenshot removed: contained real product data)

@brennanb2025
brennanb2025 marked this pull request as ready for review November 24, 2026 01:48
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The changes project queued agent messages into transcript rows and connect them to queue state, editing, steering, and deletion. Desktop and mobile chat views render these rows with actions and visibility tracking. Mobile setup and footer layouts support separate mail scrollers. Other changes add cached workspace and sender lookups, allow message-time clock subscriptions to be disabled, and update bot-turn queue checks.

Merge Risk: Low · up to 35a3f

This change shows other agents' waiting messages as dimmed rows at the end of the chat. A few minor accessibility and presentation issues remain open, such as status badges on waiting rows and screen-reader announcement edge cases. None blocks the core workflow; they are worth following up before or soon after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: other agents' waiting messages move from the composer queue to the end of the chat. The description and summaries confirm this. The title is specific and concise. It …
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.
Description check Passed The description covers most of the template. It has a clear ELI5, a detailed What Changed section with before and after behavior, a Why section, a Visual Proof section with before, after, and addition…
Full details: Title check

Explanation

The title states the main change: other agents' waiting messages move from the composer queue to the end of the chat. The description and summaries confirm this. The title is specific and concise. It does not cover the setup-screen placement, Steer/Edit/Delete row actions, or the performance work, which is expected for a single-sentence title.

Full details: Description check

Explanation

The description covers most of the template. It has a clear ELI5, a detailed What Changed section with before and after behavior, a Why section, a Visual Proof section with before, after, and additional screenshots, a Testing section with manual test steps and checked boxes, a Performance statement, and a Risk section with level and revert guidance. The Linked Issue section names STA-16774 but does not use the template's 'Fixes #' form. The AI Disclosure section is empty. The Review section heading has no content. The Notes section repeats the template text without addressing the listed areas. The Testing section names platforms (macOS desktop, with Claude and Codex chats) but does not state Linux, Windows, or SSH coverage, so the cross-platform and remote items remain unaddressed. Because the required sections are mostly filled, the check passes. The gaps are minor and non-critical.

  • 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

Recent 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: fa10c04e-6ffa-4082-b61f-3ea5299bac3b
Commits

Reviewing files that changed from the base of the PR and between 7dac091 and 35a3f97.

Files selected for processing: 1

  • src/renderer/src/components/native-chat/queue/NativeChatWaitingAgentMailRows.tsx

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

@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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Suppress the status badge on waiting rows. · NativeChatAgentMessageCard.tsx:134

src/renderer/src/components/native-chat/messages/rows/NativeChatAgentMessageCard.tsx:134
Minor · Functional Correctness · Quick win

Suppress the status badge on waiting rows.

If the sender is working, agentMessageBadge still returns running for a queued message. The row then announces “Running, not sent yet” and receives a running badge. This conflicts with the status-free waiting-row requirement.

Pass null for the badge when waiting is true. Keep the existing badge calculation for delivered rows.

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: c438f817-3a17-494a-8430-fbc3b3e6632e
Commits

Reviewing files that changed from the base of the PR and between 3a53a93 and 36fad85.

Files selected for processing: 58

  • config/react-compiler-bailout-baseline.txt
  • mobile/src/bots/MobileBotGroupTurns.tsx
  • mobile/src/hooks/use-now.ts
  • mobile/src/i18n/locales/en.json
  • mobile/src/session/native-chat/MobileBotFirstScreen.tsx
  • mobile/src/session/native-chat/MobileNativeChatOverlay.tsx
  • mobile/src/session/native-chat/MobileNativeChatView.tsx
  • mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts
  • mobile/src/session/native-chat/composer/menus/use-mobile-native-chat-composer-tray.ts
  • mobile/src/session/native-chat/input/queued-messages/MobileNativeChatQueuedMessages.tsx
  • mobile/src/session/native-chat/input/queued-messages/use-mobile-structured-queued-message-controls.ts
  • mobile/src/session/native-chat/transcript/agent-messages/MobileNativeChatAgentMessageCard.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/MobileWaitingAgentMailActions.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/MobileWaitingAgentMailRows.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/use-mobile-footer-row-on-screen.ts
  • mobile/src/session/native-chat/transcript/messages/MobileNativeChatMessageTime.tsx
  • mobile/src/session/native-chat/transcript/messages/use-mobile-message-time.ts
  • mobile/src/session/native-chat/transcript/viewport/mobile-native-chat-list-footer.tsx
  • mobile/src/session/native-chat/transcript/viewport/mobile-native-chat-tail-viewport.ts
  • mobile/src/session/native-chat/transcript/viewport/use-mobile-native-chat-tail-follow.ts
  • src/renderer/src/components/bots/BotFirstScreen.tsx
  • src/renderer/src/components/bots/BotGroupTurn.tsx
  • src/renderer/src/components/bots/bot-workspace.ts
  • src/renderer/src/components/native-chat/NativeChatBotHomeScope.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
  • src/renderer/src/components/native-chat/messages/actions/NativeChatRowActionsProvider.tsx
  • src/renderer/src/components/native-chat/messages/agent-senders/native-chat-agent-message-sender-source.ts
  • src/renderer/src/components/native-chat/messages/rows/NativeChatAgentMessageCard.tsx
  • src/renderer/src/components/native-chat/messages/rows/NativeChatAgentMessageRow.tsx
  • src/renderer/src/components/native-chat/messages/rows/NativeChatMessageTimestamp.tsx
  • src/renderer/src/components/native-chat/pane/actions/use-structured-native-chat-submit-reveal.ts
  • src/renderer/src/components/native-chat/queue/NativeChatQueueHeader.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageCard.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageList.fixture.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageList.test.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageList.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatQueuedMessageRowTools.fixture.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatWaitingAgentMailActions.tsx
  • src/renderer/src/components/native-chat/queue/NativeChatWaitingAgentMailRows.tsx
  • src/renderer/src/components/native-chat/queue/native-chat-queue-refocus.ts
  • src/renderer/src/components/native-chat/queue/native-chat-waiting-row-visibility.ts
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-queued-reorder.ts
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-waiting-agent-mail.ts
  • src/renderer/src/components/native-chat/session/structured/use-structured-agent-session.ts
  • src/renderer/src/components/native-chat/subagents/NativeChatSubagentTranscripts.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHarness.fixture.tsx
  • src/renderer/src/components/native-chat/viewport/virtualization/NativeChatTranscriptItems.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/agent-session/view/messages/agent-message-dispatch.ts
  • src/shared/agent-session/view/messages/agent-message-presentation.ts
  • src/shared/agent-session/view/structured-agent-session-echo-rows.ts
  • src/shared/agent-session/view/structured-agent-session-message-projection.ts
  • src/shared/agent-session/view/structured-agent-session-message-stream.ts
  • src/shared/agent-session/view/structured-agent-session-queued-cards.ts
  • src/shared/agent-session/view/structured-agent-session-waiting-agent-mail.test.ts
  • src/shared/agent-session/view/structured-agent-session-waiting-agent-mail.ts
  • src/shared/collections/membership-store.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.

…w no running badge, arrivals are spoken, a screen reader reaches every row, and rows follow the drawn transcript

@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: 07d717fe-098a-490c-b2f0-322e5e331ade
Commits

Reviewing files that changed from the base of the PR and between 36fad85 and ae8bab3.

Files selected for processing: 6

  • mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts
  • mobile/src/session/native-chat/input/queued-messages/use-mobile-structured-queued-message-controls.ts
  • mobile/src/session/native-chat/transcript/agent-messages/MobileNativeChatAgentMessageCard.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/MobileWaitingAgentMailRows.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/use-mobile-waiting-agent-mail-arrival-announcement.ts
  • src/renderer/src/components/native-chat/queue/NativeChatWaitingAgentMailRows.tsx

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

…per chat, once the chat has loaded; a cancelled edit is not re-announced

@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: 6c606d8e-cff0-429e-975a-e4569eaaa08d
Commits

Reviewing files that changed from the base of the PR and between ae8bab3 and 1094db4.

Files selected for processing: 4

  • mobile/src/platform/accessibility/use-mobile-screen-reader-on.ts
  • mobile/src/session/native-chat/input/queued-messages/use-mobile-structured-queued-message-controls.ts
  • mobile/src/session/native-chat/transcript/agent-messages/MobileWaitingAgentMailRows.tsx
  • mobile/src/session/native-chat/transcript/agent-messages/use-mobile-waiting-agent-mail-arrival-announcement.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.

…; arrivals are announced only against the chat's current queue

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Keep waiting mail as cards while the transcript… · use-mobile-structured-queued-message-controls.ts:147

mobile/src/session/native-chat/input/queued-messages/use-mobile-structured-queued-message-controls.ts:147
Minor · Functional Correctness · Quick win

Keep waiting mail as cards while the transcript loads.

If projected messages exist while status is loading, transcriptShown is true. queueCurrent disables announcements, but this line still moves waiting mail out of the composer. Gate row creation on queueCurrent as well. This is the previously reported loading-state issue.

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: 175058cb-4af9-42a3-8cfa-d0ea5f347040
Commits

Reviewing files that changed from the base of the PR and between 1094db4 and 7dac091.

Files selected for processing: 3

  • mobile/src/session/native-chat/MobileBotFirstScreen.tsx
  • mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts
  • mobile/src/session/native-chat/input/queued-messages/use-mobile-structured-queued-message-controls.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.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

CLEAN: no introduced P0/P1 performance regression found in the inspected paths. Held desktop waiting rows gain a saved-name label and keyboard focus without admitting message-body preparation or live sender lookup.

Full scope: 3a53a931aff0459133f6dcc0fef8ba8f125ade62..35a3f97a22c1028c0098f3b0c875605c46d375a2. Rescan delta: 7dac0918f8d419e37dee58dbfff70650c53fdca5..35a3f97a22c1028c0098f3b0c875605c46d375a2, exactly one production file. All 231 paths in the preceding census still exist; 230 are byte-identical and the remaining path is the waiting-row component. All 54 production files in the full 60-file span remain covered. The full inventory, unchanged listener census, six-question dispositions, regression-class screen and prior deterministic evidence are retained below; equivalence was checked against the preceding head. New evidence here executes the label helpers from this head. Prior counts remain prior evidence, not newly executed measurements. No source edits, dependency installation, build, application launch or push.

Rescan inventory: trigger, population, bound and invalidation.

Changed work Price and owner
Held-row name On a held wrapper render only, desktop/page UI thread: one first-sender read, three translation calls, saved-name selection and one label string. Generic/task sources require no sender traversal; mail-notice lead classification checks sender relations with at most two passes over that message's P senders. No worker-roster access, live-name selector, body traversal, transport, storage or subprocess. The saved name is normalized to at most 200 code units before this path. Output retains one label per held row and adds up to W named accessibility groups, not another copy of any message body. Both leave with their wrappers.
Translation context read One existing context reader per W mounted wrappers, including drawn wrappers; no per-row publisher subscription. Active-language/resource changes legitimately invalidate those W readers; stable context and stable row props preserve existing row memoization. Unrelated sender/status/token events do not become a held-label trigger. W=100/1,000 adds 100/1,000 context readers, removed with their wrappers. Three fixed, option-free translation keys use the existing bounded 5,000-entry shared string cache.
Focus attributes and ring Constant attribute decisions per wrapper render; label and group role only while held. An explicit Tab/focus event reuses the existing focused state to draw that row's card; blur re-evaluates the same owner. Existing 200-pixel overscan and focused-row exception remain. No new observer, layout read, effect, timer, frame loop or broad style selector. Full card/body and live-name work is still admitted only when drawn, now also reachable intentionally by keyboard focus on a held row. Imports were already in the card's static dependency graph; no new startup SDK or awaited IO.

Fresh deterministic evidence. A controlled source-helper execution used this head's heldRowLabel, row-lead, saved-name and heading implementations. A body-access tripwire was attached to waiting-shaped rows; the independent creation/handoff control reached the tripwire, proving it was active. Waiting rows produced 0 body reads/preparations. For W=100/1,000, translation calls were exactly 300/3,000. With P=1 worker sender per mail notice, source-array index reads were 300/3,000; P=100 yielded 10,200/102,000; P=1,000 yielded 100,200/1,002,000. These counts include one primary-sender read plus one failed coordinator check and P worker-relation checks per row, namely W(P+2). Empty sender data correctly used the fallback. This executes pure production helpers with controlled translator and body-tripwire adapters, not a mounted component, browser accessibility tree, layout or speech stack. The waiting-row constructor copies sender fields but no creation/handoff flags, so the helper's otherwise body-reading creation branch is unreachable for these held rows.

Fleet pricing: with 100/1,000 held rows of one sender, each genuine full held-label invalidation makes 300/3,000 translation calls and 300/3,000 sender-index reads. At f such invalidations/s, multiply those counts by f; ordinary settled idle has f=0. New arrivals retain unchanged row identities, so they do not cause this whole-population label pass. P scales separately from W as above; the relation checks determine the required row lead, not a scan of all agents. Label construction copies the saved name and translated fixed phrases, independent of body bytes, saved-history size, worktree/terminal/ref/remotes counts or live-roster size. The explicit focus transition admits one card's existing work, not W cards. Added scheduled wakeups/s are 0→0 on desktop renderer, phone/page UI, main and daemon. No timing, CPU or heap claim is inferred.

Translation listener census added to the retained census. At this head there are exactly two direct TranslationScopeContext reader implementations: useTranslate and useIntlLocale, both in i18n/use-translate.ts. Their production leaf-call census is 2,976 and 162 call expressions respectively (excluding tests, fixtures, specs, declarations and comments); runtime population is the sum of mounted hook invocations, not the source-file count. This includes all unchanged desktop renderer callers, not only the new waiting row. Every reader falls under those two implementations; there are no other direct context readers. Context broadcast reaches all mounted readers under the changed provider, including the new W wrappers. It runs only when language/active resources change, 0 callbacks/s at settled idle; under language/resource load, R(scope changes) × mounted readers. The new row does not subscribe separately to resource events or settings.

subscribeTranslationScope has exactly two subscribing implementations: TranslationScopeProvider (one per mounted root) and createContextualCopyHintRefresh (one while its editor has text focus). Provider owners are I18nProvider, instantiated by desktop main.tsx, popout.tsx, space.tsx, browser web/main.tsx, and the component-fixture frame; detached diff-comment roots additionally wrap the two widgets in diff-comment-zone-card.tsx. The editor owner is installed by setup-contextual-copy.ts; focus acquires its translation listener, blur/dispose releases it. A scope event invokes each subscribed provider/editor callback once; the editor schedules at most one pending frame only while focused and visible. Provider unsubscribe removes its listener. The fixed publisher listens to resource-added/resource-removed and language-changed events; inactive-language bundle changes refuse scope publication. No timer or per-row listener is added upstream. Context value identity changes only with the scope key. Per process, callback rate is 0/s at settled idle and R(scope events) × (mounted providers + subscribed focused editors) under scope-change load. Option-free label cache keys are the same three regardless of W or P, not saved names. These counts are source-proven, not measured event rates.

The previous saved/loading announcement admission counts are retained unchanged: at W=100/1,000 those inputs prepare/speak zero; becoming current establishes IDs without replay; three subsequent real arrivals prepare/speak three at either population. Neither that admission nor its mobile caller changed here.

Work inventory and price. C = mounted chat controls, M = nonempty phone waiting blocks, Q = held queue entries in the affected chat, W = waiting mail entries, V = currently drawn mail cards (including overscan/focus; initially unknown or reader-enabled phone rows can make V=W), S = loaded submissions, H = loaded transcript rows, A = workers in one roster, B = body bytes being examined, R(x) = actual event rate. New/changed work is on the receiving UI's JS thread unless noted; all rates are workload/source prices, not observed traffic.

New/changed work and trigger Owner/lifetime; population, repeats, bound and invalidation
Waiting classification, handoff suppression, ordering and stable row reuse → queue/submission identity or transcript-availability change One projector per chat; O(Q + S + W log W + B), with S visited only when mail waits. Membership changes build a keyed reuse map; unchanged rows and the whole unchanged waiting array retain identity. Body equality can walk freshly decoded bodies; it is not zero upstream work. Current host admission caps published queued bodies at 1,048,576 bytes; agent-origin admission preserves 263,168 bytes for personal input, leaving 785,408 bytes. That bounds outstanding bytes, not a constant row count. Token-only frames with stable queue/submission identities do not rerun this memo. No saved-chat/journal-wide scan.
Composer split, held IDs, editability and shortcut head → queue, edit state, working/pause or reorder state O(Q + W) passes/sets per affected chat, not per card; per-row editability reads are O(1). The phone does an O(Q) returned-card .some guard on each controls render, including streaming renders; only a returned draft then consults transcript failure facts. This replaces the earlier journal-dependent card rebuild on every stream revision; it is not a zero-work per-render guard. Desktop/phone bot-group holds keeps the earlier O(Q) membership lookup per rendered group turn.
Delivered queued-ID decoration and extracted optimistic echoes → journal row/submission revision Weakly cached copy per delivered row/queued ID; echo filter/map remains O(outstanding optimistic entries). The incremental stream recognizes the decorated row, preserving its reuse path. Existing O(H) placement/identity walks and output copies remain; new waiting rows are outside those projection inputs.
Worker/bot indexes, sender snapshot narrowing and text/preview memoization → first lookup of a changed roster/catalog snapshot, body or sender status Shared weak-key O(A)/O(bot count) index once per snapshot, followed by direct dispatch/home lookups. Address/session ambiguity walks only that sender's matching subset (worst A), preserving ordering. Home index has at most two keys per bot. Previously executed N direct-dispatch lookups read 100/1,000 array entries at N=100/1,000; the base read 5,050/500,500. Full text/preview is memoized per body/message, not each sender progress event; progress is removed before single-sender snapshot equality. No new backend lookup per row.
Desktop waiting wrappers, card visibility and preview geometry → arrival, intersection, size/action-text changes, focus/blur W lightweight wrappers/targets; one intersection observer per clipping root. V drawn cards hold sender/action/detail resources; focused rows stay drawn. Up to V row-height observers. Preview candidates have one resize observer and one action-subtree mutation observer; fixed geometry reads of preview/time/actions/container, no history scan. Measured offscreen cards unmount; no periodic work. Initial unknown geometry draws before measuring.
Phone tail viewport, footer bounds and visibility → existing scroll/content-size/layout/scope events One viewport per list or separate setup scroller; one watcher per waiting block. Changed bounds invalidate a sorted O(W log W) index, rebuilt on next update; steady scrolling costs O(log W + V), plus previous/next visible-set differences. Layout bursts coalesce to one pending frame. Wrappers retain W bounds/listeners; offscreen measured cards drop sender/actions/markdown. Native 96-pixel overscan, 24-pixel cumulative metric publication gate; browser branch uses intersection callbacks. No poll or self-rescheduling frame loop.
Reader admission/windowing and arrivals → mount, reader toggle, changed waiting list, active/key/load/saved-state changes C reader hooks in controls plus M reader hooks in nonempty blocks: C+M one-time queries and removable OS-toggle listeners, never W listeners. Reader-off arrival effect does O(1) gate/reset work, zero ID/body preparation. Reader-on active/current-queue effect keeps current W IDs, scans W IDs twice per changed list and builds text only for new IDs. Enabling a reader intentionally draws W accessible phone rows. Baseline state clears while inactive/off and is replaced by chat key, not accumulated forever.
Steer/Edit/Delete, Clear/Resume, optimistic reorder and refocus/reveal → explicit press/chord/drop Existing mutation routes; one in-flight action per held ID, with start/settlement publications. Clear still covers all held IDs; phone deletes at concurrency eight and desktop retains its bulk route. Drag now computes two linear previews (display cards and whole held order), superseded by publication/scope change. Focus/reveal uses bounded DOM ancestry/focus work once per action settlement; no streaming-driven mutation.
Setup/footer placement, disclosures, clocks, labels and compiler/fixture changes → mount/switch, explicit disclosure write, timestamp presence Covered transcript/subagent/standalone-stack paths suppress duplicate mail. Setup has a separate clipping/disclosure owner. Disclosure choices cap at 512 per scope; phone retains at most eight transcript scopes. No-time rows disable timestamp subscriptions. Copy/layout/compiler-baseline edits add no timer/IO/SDK startup graph. Fixture and test edits have no app-runtime cost; existing assertions were inspected, not run as a suite.

Fleet price: take 750 worktrees, roughly a dozen repos, hundreds of terminals, 100 agents, large saved history/refs/remotes, then scale each dimension 10×. This change adds 0 fleet-wide worktree/ref/history inventories, 0 subprocesses, 0 new SQL/filesystem operations and 0 row-owned transport feeds. These counts do not grow when only worktrees, refs, remotes or saved history grow. If 100 senders deliver once every five seconds into one busy viewed chat, R(arrival)=20/s; 1,000 senders gives 200/s, subject to existing byte admission/drain. Reader off: 0 discarded body/preview preparations at either rate. Reader on: necessary new-row preparation is 20/200 per second, plus roughly 2W ID visits per changed waiting list, per active receiving copy; ordinary queue maintenance prices as R(queue/submission change) × the scoped formula above × affected copies. At W=100/1,000, a replacement editability predicate reaches V listeners, at most 100/1,000 in an all-drawn workload. Reader toggles reach C+M callbacks: e.g. C=100,M=1 → 101, and C=1,000,M=1 → 1,001 per toggle. Mount queries have the same counts, once per owner. No millisecond threshold is inferred from these counts.

Listener/publication/context census at this head. Counts below count actual subscription owners and upstream notifications, including unchanged implementations; snapshot equality is not treated as eliminating callbacks. All new surfaces add 0 steady-idle timer/IPC/subscription-frame wakeups/s in each UI process, host main process and daemon. Event listeners are passive until their event. Existing periodic owners and their nonzero rates are called out separately.

Surface → every relevant reader/owner Census, idle/load rate, fanout and teardown
subscribe: phone viewport → footer block → row createMobileFooterBlock.watch is the viewport's sole production subscriber implementation; useMobileFooterRowOnScreen is the sole subscribeRow consumer. Native: one viewport listener/block and one keyed row listener/W wrapper. MobileFooterRowsScrollerContext has one consumer, useMobileFooterBlock, choosing setup override or list. Browser: neither native subscription; one shared intersection observer with W element callbacks. 0 callbacks/s after idle settles. Scroll inputs are configured at 32-ms native/setup and 16-ms browser throttles (configuration, not measured delivery); publication occurs only after cumulative 24-pixel metric change or initialization/reset. Layout/content changes are additional real triggers. One block search/publication, row callbacks only on visibility transitions except unknown-to-known initialization. Row cleanup deletes listeners/bounds; block stop unsubscribes viewport and cancels pending frame; browser removal unobserves targets (empty singleton observer retains no rows).
Desktop intersection/height/preview observers Only waiting wrappers call useNativeChatWaitingRowShown/useNativeChatWaitingRowHeight. W targets, one observer/root, at most V height observers. NativeChatAgentMessageRow owns preview/parent resize and action-subtree mutation observers for measuring candidates, including unchanged delivered rows using that component. Load follows actual intersections/geometry/child or text mutations; settled idle 0 callbacks/s. Disconnect on effect cleanup/hold/unmount; last root target removes its registry entry. No frame-per-row loop.
Membership publication → waiting actions The only subscribing implementations are desktop NativeChatWaitingAgentMailActions and phone MobileWaitingAgentMailActions: one listener per drawn action row, scoped to submit-reveal/composer-tray store. Fallback stores have no writer. Predicate replacement synchronously calls all V listeners, each a keyed Set read; same predicate calls zero. Boolean snapshot equality prevents unchanged commits only after that read. R(predicate change) × V callbacks; 0/s idle. Both unsubscribe on row unmount. Stable edit handles prevent full actions-context replacement for every arrival.
Desktop waiting contexts Rows readers: NativeChatBotHomeScope and NativeChatWaitingAgentMailRows (normal/setup instances); actions reader: NativeChatWaitingAgentMailActions per V. Setup overrides covered transcript rows to null; NativeChatSubagentTranscripts overrides to null; stacked rows omit mail entirely. Rows change on waiting membership/body/order/edit visibility; actions change on pending/working/stopping/host hold or handler/focus changes. Token-only streaming with stable inputs changes neither. 0/s idle; R(relevant change) × mounted readers under that provider. Subtree removal releases readers.
Phone waiting actions / action store / head light MobileWaitingAgentMailActions is the only waiting-actions-context consumer, one/V. useMobileQueuedCardActions subscribes from composer tray and queue-list fallback; actual supplied-actions flow writes only the tray store, leaving the fallback unwritten. Accepted actions publish twice (start/settle), update shared controls and release pending/shown entries; overlapping held resources reject. Head-light's sole consumer implementation is MobileQueuedMessageCardRow, subscribing only for the real head card (zero when mail leads); other rows use a no-op subscription. Pending rate 2 × admitted actions/s; light publishes only boolean flips; 0/s idle.
Reader-state subscription / announcement publication useMobileScreenReaderOn has exactly two caller implementations: the arrival hook inside each controls hook, and MobileWaitingAgentMailRows per nonempty mounted block. Each invocation has one initial query and one screenReaderChanged listener. It is shared by row controls at block/chat granularity, not a process-wide singleton. Query completion is live-guarded; listener is removed. Load is C+M callbacks per OS reader toggle, not per arrival; idle 0/s. Arrival hook adds no separate timer/subscription; it runs on list/listening/chat-key/announcer/language changes; the listening gate now also requires non-loading status and no unconfirmed saved copy. Native announcer forwards accepted text; browser announcer retains its existing capability refusal. Disabled reader admits no preparation. Bridge delivery was not executed.
Desktop worker feed / roster / reread contexts Feed consumers are NativeChatWorkersProvider and useFocusedChatWorkers, through useOrchestrationSessionsWorkers, sharing by host/session. Roster readers: useNativeChatTranscriptSlots, NativeChatBotItemNoteRow, NativeChatAgentMessageCard, NativeChatWaitingAgentMailCard. Each drawn waiting wrapper selects its worker and provides a structurally stable one-worker roster to its inner card. Reread context has one consumer, useRereadWorkersOnNewRows in NativeChatMessageList. Waiting arrival outside message projection adds no transcript-row reread. Existing feed polls after a 3,000-ms settled interval only with visible viewers and a running worker, plus initial/notice/legacy-row reads; maximum scheduled cadence 1/3 per second per qualifying feed, 0 when hidden/no running worker. One in-flight read plus one reread bit; equal rosters publish zero. Changed rosters notify feed subscribers and roster consumers; no W feed owners. Existing slot rebuild is O(H) per changed roster/chat. Teardown stops active timers/listeners; retained feed entries are noted below.
Desktop addressed sender publication Subscriber wrappers: useAgentMessageSenderSource, useAgentMessageSenderSources, useAgentMessageSenderOpens, useAgentMessageSenderChat via useLeasedSenderSelector. Leaf view consumers are NativeChatAgentMessageCard and CrewAgentIcons; sender label/open consumers are the card spoken name, SenderName, RowSenderName, SenderChip in NativeChatAgentMessageSenders, plus the card's avatar bot reader. Each selector owns one sender-locations channel plus deduped row/sender channels actually read; obsolete channels are removed. R(addressed row/sender/location changes) × matching leases; location changes can fan out to all these mounted leases. No new periodic publisher; 0 added idle wakeups/s. One-sender progress snapshots retain identity; body text/preview is memoized. New drawn cards add O(V) addressed readers, not scans of all 750/7,500 worktrees on every status event.
Phone sender source and open contexts Source consumers: card primary name/view, card SenderName per shown sender (up to three), card OpenSender (one for single sender, or expanded multi-sender details), and each MobileAgentMessageSenders.SenderName. One ordinary single-sender drawn card adds four source listeners. Open-context consumers: card OpenSender, MobileAgentMessageSenders, MobileNativeChatWorkerApprovalReceipts, MobileNativeChatWorkerApproval. Provider/source/open identities change only with scope/callback changes. Existing source indexes tabs/terminal identities once per changed input; every input publication and foreground minute tick visits all L listeners, even unchanged names: L × (R(tabs/terminals changes) + 1/60) callbacks/s. Added necessary single-sender readers contribute 4V to L. This pre-existing broad source is not described as keyed notification; snapshot reads are indexed and offscreen measured cards unsubscribe. Its existing useNow(60_000) remains one timer/provider, stopped while app inactive; no new minute timer is introduced.
Bot catalog publication used by desktop sender labels All direct subscribing implementations: bot-catalog.ts's useBots, useBotHomeWorkspaces, useHostBots, useHasBot, useBotWaits, useListedBotItemsNeedingOwner, useBotThreadReplies, useBotWebhooks, useConnectorNeedsSignIn, useBotHostConnectorStatus; useBotHostOffline in bot-host-views; useAskingServers in BotPairedServersWhoCanAsk; useBotMentionTargets; useBotPaletteSource; the installation surface; useBotChatComposerRoom; useBotPreviewFacts in BotCollapsedPreview; two subscriptions in useBotSettingsComputers; direct callbacks in bot-group-face-pictures, bot-home-tab-placement, sidebar-reveal-target-state, bot-background-sessions. Re-export/import lines are not extra listeners. New sender labels enter through folder/settings-gated useBotForWorkspace → useBots. One real catalog/host/count change reaches all catalog listeners, including unchanged existing consumers; equal publication returns early. R(catalog change) × total listeners; new row labels add O(V), one shared home index/snapshot, not V inventories. Existing per-host refresh/reconnect/stale-count deadlines remain shared. Row teardown unsubscribes. No new idle schedule.
Desktop session status/name publication New sender labels use the existing keyed useStructuredSessionSummaryField: one session listener, plus an older fork's source-name listener only if needed; naming-error reader uses the same wrapper. All other keyed subscriber implementations: useNativeChatNamingFailure; useSessionFeed (four permission snapshots and one each option stamp, execution phase, program, stopping and rewind); useStructuredAgentSessionsStarting (one per selected session); background-tab settle in StructuredAgentSessionAttentionBridge; async-question skip (two snapshots); usage-limit auto-continue (four snapshots). Whole-feed subscribers: structured-chat name observation, grouped preview coalescing, bot background following and resume-run status watch. The attention bridge's turn-completion listener is a separate publication. One shared host status subscription, keyed notifications for affected sessions plus whole-feed listeners; host loss/full snapshots can notify all. Steady connected idle has no new polling; pre-existing failed reconnect backoff is 250 ms doubling to 5,000 ms, one outstanding timer per activated host. Last activation release closes subscription/reconnect. Labels add keyed readers/activations, not a new host client each.
Timestamp clocks / app activity Desktop direct subscription implementation: useNowSnapshot, also used by useNow; direct additional snapshot call sites are the two timestamp hooks and two worker-dock labels. Phone shared implementation: useSharedNowSnapshot, used by useSharedNow; leaf shared readers are message-time, WorktreeAgentList, two bot-home-row sites, MobileHomeBotRow. Separate phone useNow timers read useAppActive; useAppActive and each running shared clock are the app-state publisher's only subscribing implementations. Full current call-site census is in the appendix. For every enumerated enabled clock at configured cadence d milliseconds, the publisher rate is 1000/d ticks/s in both idle and load, and its subscriber-callback rate is that rate × enabled listeners at that cadence; disabled/hidden/inactive rate is 0. Existing d=250/1,000/30,000/60,000 gives 4/1/1⁄30/1⁄60 ticks/s, respectively. Each desktop shared cadence also holds one removable document-visibility listener; phone app-state source holds one native change listener total while subscribed. Visibility/activity transitions notify the retained subscribers once and reconcile timers; they are events, not polls. Waiting mail has zero enabled timestamp listeners. Existing 30-second timestamp cadence is one shared timer/process at 1/30 wakeups/s when needed and visible/active; 60-second shared readers similarly 1/60; other existing cadences retain their existing gates. Desktop shares per cadence; separate phone useNow retains one timer/enabled owner. All new waiting timestamp delta is 0 wakeups/s; last shared listener stops timer and app-state subscription, and inactivity stops ticking.
Disclosure contexts / setup scope New setup providers reach only their waiting rows and opened content, not another copy of the transcript. Direct current consumer sites are enumerated below. A real open/close creates one provider value and reaches all mounted readers under that scope; same stored choice is a no-op. Scroll-position maps mutate without provider publication. R(explicit disclosure write) × mounted readers, 0/s idle. Choices cap at 512; phone scope cache at eight; phone scroll roots dispose on scope/unmount.
Host queue publication → receiving desktop/phone reducer/controllers Existing subscriber frame field owner attaches queue data to initial/hydrating frames or changed canonical queue publication, not every token batch. Queue row revision/reopen floor memoizes list/serialization; serialized equality reuses list; unchanged queue/pause/head reuses publication. Existing desktop and phone controllers consume the shared live-read reducer's queue fields; this span adds local drawing, not another wire subscription. Load is real queue changes × existing subscribers, bounded by admitted queued body bytes; idle delta 0/s. Existing whole queued snapshot on a real change is pre-existing, not new N notices per waiting row. Local and remote owners retain host/session-qualified routing and existing bounded frames.

Prior deterministic evidence, retained because these production factories are byte-identical to 1094db45: production viewport/footer owners at N=100 and 10N=1,000 scheduled one coalesced layout frame; initial unknown-to-known visibility notified N rows; 1,000 identical metric records and 23 cumulative pixels notified zero; crossing 24 pixels published once; ten subsequent 40-pixel steps published ten times and notified 18 rows at both sizes, consistent with end/overscan boundaries. Unsubscribe/removal/stop left zero callbacks and no pending frame. Production membership store: same predicate 0 callbacks; replacement predicate 100/1,000 callbacks; after teardown 0. Production waiting projector/composer splitter, using explicit source-decoder/sender-field/submission-key adapters and same-realm records, retained the whole unchanged array and all 100/1,000 existing rows after an arrival; handoff removed one row, rejected handoff restored it, and editing moved only that row to its card. Worker lookup counts above execute the base and target functions. These are operation/identity/cleanup checks, not native scrolling, browser layout, frame timing or heap tests. The committed waiting-mail correctness tests and changed queue-list assertions were inspected; they were not executed.

Pre-existing work/retention, separate from this verdict: the phone sender source broadcasts all L readers on its inputs/minute tick; desktop worker-roster changes can rebuild H slots; real queue changes publish the existing whole queue snapshot. Additionally, unchanged orchestration-session-workers.ts retains a feed and its last roster in the module feeds map after the last subscriber leaves: D distinct visited host/session keys retain D entries and their roster objects, with no production eviction in that module (100/1,000 distinct keys means 100/1,000 retained feeds in either ref). Listener/timer cleanup stops active work, not this pre-existing registry retention. Waiting rows do not add feed keys per row or change these owners/cadences. No memory-size or elapsed-time measurement was made.

Six questions: (1) Reviewed producer-to-output admission: reader-off and saved/loading announcement body/ID work is zero; memo/identity guards and real queue publication traced. (2) Reviewed multiplicity: complete relevant listener/context census above, C+M reader owners, shared worker/clock/catalog feeds, V drawn cards. (3) Reviewed thread/storage: new work stays on UI JS; no newly reachable main-thread synchronous IO/SQL/spawn; existing action/publication routing traced, backend duration unmeasured. (4) Reviewed growth/progress: scoped Q/W/S/body work, byte admission, weak caches, keyed indexes, incremental delivered-row reuse, action admission and publication superseding previews; no fleet/history inventory added; pre-existing feed retention recorded. (5) Reviewed source for browser/native phone, desktop and local/remote host branches: no new host probes or per-row network requests; alternate-host/native delivery performance not executed. (6) Reviewed/exercised stop/release: observer/listener/bounds/frame removal, late reader-query completion, per-chat baseline reset, action settle and inactivity clock gates; no new self-rescheduling work. Cold mount adds C+M one-shot reader queries plus per-chat queue/geometry setup; first usable progress gains no new awaited IO gate. Typing/streaming with stable queue inputs does not rerun waiting projection or body work; explicit actions retain existing routes.

Touched recurring classes and dispositions: unused/newly reachable work before a skip gate — matched, disabled announcement counts now zero; whole keyed-map/broad subscription and snapshot fanout — matched, narrowed desktop channels, actual membership/catalog/phone-source callbacks priced above, no claim equality avoids publication; whole-collection per-row derivation/hot rescans — matched, one-per-chat queue split and shared weak indexes, direct dispatch counts verified; streaming whole-message work — matched, waiting data stays outside projection and body text is memoized, decorated delivered rows keep incremental reuse; hidden/per-instance work — matched, measured offscreen cards release their readers/content, focus and screen-reader exceptions preserve access; steady-idle wakeups/fixed cadence — matched clock/worker paths retain prior schedules, waiting timestamps disabled, no new idle scheduler; no-op identity/publication — matched stable row arrays, predicate checks, host revision/value dedup; resource lifetime/queue growth — matched byte/disclosure bounds, keyed cleanup and pending-frame cancellation, pre-existing feed retention separated; eager startup imports — inspected, no new SDK/adapter startup dependency. No new subprocess-per-item, sync filesystem/SQL, repeated unchanged file read, whole-file persistence rewrite, unbounded asynchronous fanout or retry-prefix loop matches in this diff.

Residual evidence gaps: no packaged UI/CPU/frame/heap/compositor capture; no live browser observer/native accessibility delivery/navigation; no alternate desktop/native phone host or remote reconnect/failure stress execution. The verdict covers inspected source paths and executed deterministic counts; these unmeasured environments are not claimed fast. No introduced P0/P1 is established by this scan.

Unchanged clock, app-activity and disclosure call-site census

Clock/app-activity caller census under src/renderer/src/ (one hook invocation at each listed site, multiplied by mounted enabled owners): components/activity/thread-list/activity-thread-controls.tsx:30, components/bots/BotActivityPanel.tsx:112, components/bots/BotChatTreeWorkerRow.tsx:50, components/bots/BotGroupItemsPanel.tsx:104, components/bots/BotGroupRow.tsx:48, components/bots/BotRowActivityLine.tsx:100, components/bots/WorkerActivityRow.tsx:70, components/bots/bot-palette-source.tsx:396, components/bots/items/BotItemHeader.tsx:57, components/bots/items/BotItemSnoozeDialog.tsx:53, components/bots/use-bot-usage-limit-stops.ts:33, components/bots/webhooks/BotWebhooksCard.tsx:62, components/bots/webhooks/WebhookHookRow.tsx:56, components/cmd-j/palette-live-status.tsx:66, components/editor/review-note-delivery/ReviewNotesSendMenuContent.tsx:90, components/maintenance/update-card/RequiredUpdateRestartContent.tsx:17, components/native-chat/NativeChatAutomationCardDetails.tsx:91, components/native-chat/NativeChatWebhookCard.tsx:144, components/native-chat/automation-run/NativeChatWaitRow.tsx:153, components/native-chat/automation-run/NativeChatWebhookSetupCard.tsx:54, components/native-chat/conversation/turns/use-native-chat-elapsed-seconds.ts:7, components/native-chat/messages/rows/NativeChatMessageTimestamp.tsx:14,34, components/native-chat/session/goals/NativeChatThreadGoalBanner.tsx:68, components/native-chat/subagents/NativeChatSubagentRun.tsx:39, components/native-chat/tools/tasks/NativeChatCrewBackgroundTasksStatus.tsx:215, components/native-chat/tools/tasks/dock/WorkerDockRow.tsx:17,94, components/native-chat/tools/tasks/use-structured-session-child-row-context.ts:33, components/native-chat/usage/use-native-chat-usage-limit-auto-continue.ts:88, components/orchestration-crew/CrewRowDetails.tsx:27, components/plugins/catalog/PluginCatalogHighlights.tsx:25, components/right-sidebar/ai-vault/scanning/AiVaultScanProgressStrip.tsx:198, components/right-sidebar/ai-vault/session-list/ai-vault-session-time.tsx:17, components/right-sidebar/checks-panel/comments/use-comments-list-state.tsx:140, components/right-sidebar/checks-panel/presentation/check-run-time.tsx:157, components/right-sidebar/checks-panel/presentation/empty-content.tsx:28, components/right-sidebar/checks-panel/review-state/use-checks-panel-context-state.tsx:128, components/settings/accounts/usage/ZcodePlanAccountsSection.tsx:72, components/settings/accounts/usage/accounts-pane-minimax-credentials.tsx:134, components/settings/updates/GeneralUpdateSettingsSection.tsx:56, components/settings/updates/UpdateDelaySetting.tsx:81, components/sidebar/workspace-card/activity/WorktreeCardAgents.tsx:121, components/sidebar/workspace-card/surface/worktree-card-title-status.tsx:176, components/status-bar/usage/StatusBarProviderSegment.tsx:275, components/workspace-cleanup/dialog/workspace-cleanup-freshness.tsx:20.

Clock/app-activity caller census under mobile/src/ (one hook invocation at each listed site, multiplied by mounted enabled owners): accounts/MobileAccountsScreen.tsx:127, agent-history/MobileAgentSessionHistoryPanel.tsx:97, bots/MobileBotAutomationsTab.tsx:216, bots/MobileBotChatRows.tsx:63,210, bots/MobileBotChatTree.tsx:113,179, bots/MobileBotGroupItems.tsx:117, bots/MobileBotHomeRow.tsx:48,168, bots/MobileBotPanel.tsx:119, bots/items/MobileBotItemPage.tsx:90, bots/items/MobileBotItemSnoozeSheets.tsx:68, bots/webhooks/MobileBotWebhookDetail.tsx:56, bots/webhooks/MobileBotWebhooks.tsx:116,165, dictation/MobileDictationMeter.tsx:61, home/bots/MobileHomeBotRow.tsx:39, home/tabs/MobileHomeAutomationsTab.tsx:103, home/tabs/MobileHomeUsageTab.tsx:141, home/use-mobile-home-data.ts:228, session/native-chat/composer/menus/MobileNativeChatComposerBotRows.tsx:27, session/native-chat/input/prompts/MobileNativeChatWorkerApproval.tsx:141, session/native-chat/input/tasks/MobileNativeChatBackgroundTasks.tsx:180, session/native-chat/input/tasks/MobileNativeChatThreadGoalStrip.tsx:51, session/native-chat/transcript/MobileAutomationSavedRow.tsx:63, session/native-chat/transcript/agent-messages/MobileAgentMessageProvider.tsx:24, session/native-chat/transcript/bot-cards/MobileBotWebhookCard.tsx:81, session/native-chat/transcript/bot-cards/MobileWebhookSetupCard.tsx:67, session/native-chat/transcript/messages/MobileNativeChatSubagentGroup.tsx:57, session/native-chat/transcript/messages/MobileNativeChatTurnStatus.tsx:22, session/native-chat/transcript/messages/use-mobile-message-time.ts:15, session/native-chat/usage/MobileNativeChatAccountUsageSheet.tsx:63, session/tabs/MobileSessionTabBar.tsx:95, session/tabs/MobileSessionTabsSheet.tsx:91, session/use-mobile-session-bot.tsx:90, source-control/review/diff-screen/MobileDiffReviewLines.tsx:87, source-control/review/pull-request/MobilePRSidebar.tsx:219, source-control/review/pull-request/comments/PRCommentsSection.tsx:103, source-control/review/pull-request/comments/PrCommentsScreen.tsx:47, worktree/agent-lineage/presentation/WorktreeAgentList.tsx:56, worktree/row-presentation/WorktreeListRow.tsx:84.

Disclosure-context consumer census under src/renderer/src/components/native-chat/ (same write fanout/gates as above; new setup subtree uses only its mail/details subset): NativeChatBotCreateOfferCard.tsx:164, NativeChatConnectorNoAccessNote.tsx:22, automation-run/NativeChatAutomationResultRow.tsx:52, automation-run/NativeChatAutomationRunInstructions.tsx:23, automation-run/NativeChatAutomationRunRow.tsx:55, automation-run/NativeChatAutomationSavedRow.tsx:80, automation-run/NativeChatWaitRow.tsx:94, markdown/code/NativeChatCodeBlock.tsx:28, messages/disclosure/native-chat-disclosure-store.ts:79, messages/events/NativeChatEventRow.tsx:192, messages/reasoning/NativeChatReasoningRow.tsx:44, messages/reasoning/NativeChatTurnActivityLine.tsx:47, messages/rows/NativeChatAgentMessageRow.tsx:112, messages/rows/NativeChatUserMessageFold.tsx:27, prompts/NativeChatAwaitingInputRow.tsx:37, tools/diffs/NativeChatDiffCard.tsx:131, tools/diffs/NativeChatTurnDiffRollup.tsx:42,74, tools/lines/NativeChatToolLine.tsx:88, tools/runs/NativeChatToolRun.tsx:103, tools/runs/NativeChatToolRunMembers.tsx:116, tools/tasks/NativeChatTaskList.tsx:106.

Disclosure-context consumer census under mobile/src/session/native-chat/ (same write fanout/gates as above; new setup subtree uses only its mail/details subset): input/tasks/MobileNativeChatTaskList.tsx:115, transcript/MobileAutomationRunInstructions.tsx:24, transcript/bot-cards/MobileBotCreateOfferCard.tsx:101, transcript/bot-cards/MobileBotMemoryUpdatedRow.tsx:43, transcript/messages/MobileNativeChatEventRow.tsx:103, transcript/tool-results/MobileNativeChatDiffCard.tsx:146, transcript/tool-results/MobileNativeChatToolLine.tsx:197, transcript/tool-results/MobileNativeChatToolRun.tsx:92,183, transcript/tool-results/MobileNativeChatTurnDiffRollup.tsx:25,83, transcript/viewport/MobileNativeChatOwnedScrollView.tsx:33, transcript/viewport/mobile-native-chat-disclosure-store.ts:92.

@brennanb2025
brennanb2025 merged commit 28a6043 into main Nov 24, 2026
59 checks passed
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