Skip to content

Agent message cards find their sender's agent and status in the same store as the sidebar - #36660

Merged
brennanb2025 merged 55 commits into
mainfrom
brennanb2025/worker-card-identity
Nov 3, 2026
Merged

brennanb2025 merged 55 commits into
mainfrom
brennanb2025/worker-card-identity

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4077 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4058
Prod 86 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3617 $\color{#cf222e}{\Huge{\mathbf{−}}}$​537 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3080

Builds on merged #36653, which saves each card's sender agent kind. This PR targets main. Tracked in STA-13124.

Problem

Agent message cards in a native chat ("Started worker", "Update from worker", "Task from coordinator", "Message from coordinator") show who sent them: an agent icon, a live status dot, and the sender's name as a "Go to agent" link. A teammate saw coordinator cards with a "?" icon and no dot for workers the left sidebar showed fine, with their icon and live status.

Why: each card worked out its sender with its own lookup (the chat's tab by session id, or a status row that happened to carry the terminal's handle) instead of the agent rows the sidebar uses. That lookup missed terminal agents the sidebar knows only by title or process, chats whose tab wasn't loaded yet, chats after /clear, workers reopened in a new terminal, and workers on another paired computer. Clicking the name used yet another lookup, so after a worker was reopened elsewhere the avatar and the click could disagree: one agent shown, another opened, or "Agent's pane is no longer available" while the agent was running.

What changes for users

Each card's sender is worked out once, and the avatar, the name, whether the name is a link, and the click all use that one answer, from the same agent rows the sidebar shows:

  • Terminal senders are found by the terminal handle every card already saves. That works for agents with status hooks, with hooks turned off, plain shells (orca orchestration send), and replies.
  • After a normal restart terminals keep running with the same handle, so cards keep their dot and keep opening their terminal with no new agent activity needed.
  • A worker reopened in a new pane is followed there.
  • Chat senders are found by their chat session and follow a /clear into the new session. A closed chat still reopens from its card.
  • Workers on another paired computer show their live dot when that computer is connected.
  • A different agent in the sender's terminal: if a Claude card's terminal now runs Codex, the card keeps the Claude icon with no dot, and the name is plain text. Before, it showed Codex's status and opened Codex.
  • If this window hasn't loaded the sender's terminal yet, clicking the name still opens that same terminal, through the computer it runs on.
  • If something changes between drawing the card and clicking it, the click shows one message that names the agent, says what happened and what to do.

How

  • Each host derives which public agent row every sender identity points at now, from what it already keeps (live terminal handles, worker follow-up and terminal-transfer records, chat /clear lineage, paired-computer attachments), and publishes that next to the agent rows the sidebar already gets: in the local window graph and in each host's session-tab updates, the same path paired computers already use for sidebar status. Only public row keys are published, never worker credential handles.
  • The host sends this only when it changes, with a revision per host and per workspace. Sender projection starts only for desktop consumers; phone-only and internal subscriptions skip it before construction. Mixed clients share one publication pass. Cached history is released when the last desktop consumer leaves, and removed workspace caches are retired.
  • Ordinary worker follow-up chains share one index of direct lineage facts. Transfers, cycles and incomplete chains keep the established lookup, so the optimization preserves their existing identity behavior. These exceptional paths can still require work per sender; the PR does not claim a linear bound for every graph shape.
  • The window keeps one index over those publications. The card's avatar, name, link and click read it, then read the icon and dot from the sidebar's existing row source.
  • Hosts on an older Orca don't publish this; their cards keep the previous lookup.
  • No new saved data and no new RPC method. A one-off read or targeted navigation cannot acknowledge a sender update still owed to another desktop.

Differences and limits

  • Same-kind successor, intended (same as before this change): Orca knows which terminal sent a card, not always which agent runs in it now. If the sender exits and a later agent of the same kind starts in that terminal, the old card shows that agent's dot and opens it. Nothing saved can tell the two apart for agents without hooks, and Orca never changes the command the user typed.
  • Cards saved before agent kinds were saved (before Agent message cards keep their sender's agent icon when the agent can't be found #36653), intended: with no saved kind, the different-agent check can't apply; they behave as before.
  • Terminal that died and was replaced (reboot, respawn), temporary, pending Brennan's decision: old cards show no dot; by default their click still asks the host as today, which may open the new shell in the old pane. One switch, GONE_TERMINAL_SENDER_CLICK in native-chat-agent-message-sender-target.ts, turns these into plain names.
  • Older paired hosts, intended: their cards keep the previous lookup, except that a card whose terminal now runs a known different kind of agent shows the saved icon, no dot and a plain name, as on newer hosts.
  • Opening a sender, matches the common pattern: a found sender opens through the same path as clicking it in the sidebar, so it also marks it read, flashes the pane and scrolls it into view.
  • A different agent in the sender's terminal, intended: the common design never needs this check because its sender ids are never reused. Orca's terminals are reused shells, so the saved kind is compared with the kind running there now.
  • Two places claim one sender, intended: with several hosts and mirrored panes, one sender can be claimed twice; the card then shows the saved icon, no dot and a plain name instead of guessing.
  • Raced clicks, intended: the answer can change between drawing and clicking across hosts, so the click checks again and names the agent if it no longer opens.
  • Senders on another paired computer, intended: their names stay plain text, as before; making them clickable is a new capability left to Brennan (possible follow-up).
  • Downgrade, intended: this PR saves nothing new. With Agent message cards keep their sender's agent icon when the agent can't be found #36653's saved agent kind, a chat that received one of the new cards shows it was written by a newer Orca after a downgrade to an older version, and opens again after updating; nothing is lost.
  • Commits from another database connection, intended: they make the host rebuild sender history in full rather than incrementally; only two rare WSL paths open a second connection.

Tests

  • Host: associations for terminals (including title/process-only panes), chats before tab load, /clear successors, reopened-worker lineage, paired-computer routes, credential handles excluded; handles are read, never issued; incremental history equals a full rebuild across follow-ups, transfers, respawns, deletes and rollbacks; cost contracts at N and 10N live workers, terminals and saved chats.
  • Performance and recovery: operation and retained-state counts at N and 10N; phone-only admission and mixed-client publication; cache retirement and re-addition; overlapping reads and broadcast delivery; differential comparison with the existing lineage lookup across 4,000 graph cases; unavailable database cleanup.
  • Window: delivery through the real receive path on both transports (no-op updates send no rows and render no cards; older updates never overwrite newer; worktree removal keeps other workspaces), the card's avatar, link and click agreeing for reopened workers, replaced agents, unknown kinds, closed chats and older hosts; opening an unloaded terminal through its host with the real host resolver; a paired host's pane shown under this window's mirrored tab (both mirror forms) gets the sidebar's dot and opens there; render counts for unrelated updates.

Final validation (2026-11-02)

Current reviewed head 781bfff320dd4fd75ca425408e5aeb09c187a64b: all 61 CI checks passed, with no pending checks or merge conflicts. Independent review verified the latest main integration; 55 targeted integration tests passed. The mobile callback-capability repair passed production/test typechecks and relevant renderer/navigation tests in CI. The broad local related-unit selection exceeded its limit; scoped regression tests, typechecks and static checks passed. No full local unit pass is claimed.

Real Claude and Codex questions, follow-ups and completions showed the correct sender identities and opened the correct worker terminals on desktop 37abb7c91efc69b68772604864664d0023365410. Existing restart, replaced-agent and paired-host evidence carries for unchanged flows. Later commits change the mobile caller and merge main; they do not invalidate that desktop evidence.

The controlled warm comparison used the same 172 saved chats and 208 message bodies on main aab098fb307 and desktop 37abb7c91ef, with 129 naturally mounted chat roots and four mounted sender cards. Full content, sender controls, footer, DOM and scroll projections matched before capture and at the end and ten seconds afterward. In one 30-second window per build, renderer task CPU rate fell 9.14%; sampled renderer RSS peak rose 28.08 MiB from a 35.33 MiB higher starting value. Frame p95 was 18.5 ms on both; maximum frame gap rose 18.7 ms, long-task total rose 6 ms, workspace switches were 42–56 ms faster and draft entry was 7 ms slower. The earlier unmatched CPU increase and 203 MiB peak gap did not reproduce at that magnitude. These measurements cover saved-history navigation and draft entry in a development build, not active sender updates, streaming, 172 mounted cards or universal performance. The RSS difference is unattributed; source counters were unavailable. No leak or zero-work claim is made. Independent verification recomputed the raw CPU/frame/action results and compared every mounted root at each checkpoint. It found no concrete production performance defect requiring another patch or run. Equality excludes per-copy identity/timestamps and measurement/memory fields; actual rendered content, controls and geometry match. The bounded performance review is complete.

The separate repeated unknown-sender wake was traced to a local helper stripping its caller identity. Its authenticated identity preservation is repaired and tracked separately in STA-13515; this PR alone is not presented as fixing that helper.

Claude sender Codex sender
Claude sender Codex sender

Click destinations: Claude worker terminal, Codex worker terminal. Main comparison: Claude, Codex.

…'t be found

A card names its sender by a snapshot written with the message, but drew the
icon only from a live lookup, so a sender the lookup missed (a worker on
another host, a terminal after restart, a closed agent) showed "?". Every
writer (worker start, mail, task, federated start) now saves the sender's
agent kind beside its name, and the card draws it when no live row names
the agent. Live rows stay the source of icon and status whenever they match.
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/worker-card-icon to main October 31, 2026 11:24
- A worktree removal frame drops only its own scope; a host stays
  publishing once any frame carried the field.
- Identity history rebuilds follow writes to the facts it reads
  (connection-local triggers), not heartbeats, read marks or receipts;
  new mail is read incrementally.
- One principal per paired peer replaces every federated route ever made.
- Unchanged worktrees keep their scope object; a refresh republishes only
  worktrees whose scope changed. Chat records key on the store's state
  generation instead of serialising every record.
- The publication rides client frames only, and phone frames drop it.
- A failed history read keeps the last good publication and is not
  marked indexed; malformed rows are skipped; opening the database for
  display never throws.
- A located chat keeps its tab's agent icon for cards saved without one.
Orca now records who sent each agent message and created each task when it accepts them, and the chat card resolves that saved identity against what each host says runs now. The avatar dot, label and click all read that one answer: a located terminal opens through the sidebar's own activation path, a closed chat reopens through its lineage, and a sender no host can prove shows its saved icon and says it is no longer available instead of opening whichever agent now holds the old pane.

Publication now has the host's pairing key from the RPC server, so it no longer fails on every build.
A card's sender is now the terminal its saved handle names, the worker lineage its Dispatch continued into, or its chat session. That survives a normal restart, works with hooks off, from a plain shell and for replies, and needs no newly saved sender data, so the hook-conversation records, their table and the saved identity key are gone.

The avatar, link and click read one answer. A terminal that now runs a different kind of agent than the card saved, or a sender two places claim, shows the saved icon as a plain name. A terminal that exited or was respawned keeps the host's own lookup on click without a status dot, behind one switch.

Chat senders rebuild only when a chat appears, moves, clears or closes, and each live pane's worker reads go through the existing partial indexes.
The host's sender publication now carries an in-memory epoch and content revision that move only when what clients read changes. A window's graph sync sends the revision it applied and gets "unchanged" instead of the rows; each session-tab stream sends a worktree's scope once per revision. The window keeps the whole-host publication as its baseline and a newer worktree scope over it, by revision, so a delayed reply never undoes a newer scope and repeated deliveries cost nothing.

An older paired host's cards now go through the same resolution as everyone else's: a terminal that runs a known different agent shows the saved icon as a plain name, and what the host's lookup returns is judged by the same row. Pi and OMP, and Claude and its teams wrapper, count as one agent. Failure text names the agent and says what to do.

WSL chats are published, closed chat history no longer counts as open before the tab table exists, and paired principals are read again only after a pairing changes.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 31, 2026 14:43
… fix its types

The cross-process delivery test moves to tests/e2e, where tests that span main and renderer live, so the web typecheck no longer pulls main files in. It now drives the stream encoder main uses. The worker lineage walk takes a reader type without a this binding, the stream delta composes with the proof delta's own frame type, alias buckets accept terminal and chat tab arrays, and the publication test builds fully typed fixtures.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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
Walkthrough

The change adds agent identity to sender records and message projections. Runtime code builds and publishes sender associations for workers, chats, and federated peers. Graph and session-tab paths carry full or revisioned publications to the renderer. The renderer resolves senders using published associations or legacy data, detects ambiguous or replaced terminals, and opens located senders. Launch observations are retained for worker dispatches. Tests cover persistence, indexing, publication delivery, federation, caching, and sender opening.

Merge Risk: Low · up to 1bb54

This change resolves sender cards through published agent identities. The earlier build-blocking type errors are no longer present in the inspected source. Two limited issues remain. A frames-draw test case does not exercise the path it describes. After a rare transient database read failure, a chat opened in that same refresh can show no sender match until another identity change occurs. Neither is likely to cause widespread impact.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 48.61% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: agent message cards resolve their sender's agent and status from the same store the sidebar uses. The changeset publishes sender identities from each host and indexes …
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 follows the repository template closely. It has a plain-language Problem and What changes for users section, a How section explaining the mechanism, a Why-style rationale with alternat…
Full details: Title check

Explanation

The title names the main change: agent message cards resolve their sender's agent and status from the same store the sidebar uses. The changeset publishes sender identities from each host and indexes them in the window, so cards read the sidebar's agent rows. The title is specific and matches the PR objectives, and it is one sentence without file lists or vague wording. It is somewhat long at 89 characters, but it is clear.

Full details: Description check

Explanation

The description follows the repository template closely. It has a plain-language Problem and What changes for users section, a How section explaining the mechanism, a Why-style rationale with alternatives noted in Differences and limits, and a Risk-like Differences and limits section that names the riskiest switch (GONE_TERMINAL_SENDER_CLICK) and the downgrade behavior. Testing is described in detail, including host, window, and performance tests, along with manual validation on desktop with Claude and Codex. Visual proof is supplied through before/after and click-destination media. Gaps: the template's ELI5 heading is not present as a labeled section; the Risk section lacks an explicit risk level (Low/Medium/High) and a clear revert plan; the Linked Issue is tracked via Linear STA-13124 rather than a GitHub 'Fixes #' line; the AI Disclosure section is absent; the Agent skill upstream boundary checkbox and the Checklist are not present; the Testing checkboxes are not ticked. These are important template items, but the description is mostly complete, so the check passes with notes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 48.61% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 72 functions across 84 files.

Resolution

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

Finishing Touches
Generate docstrings
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
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: f8d86693-dda4-4d60-a75e-5f2e8224da1d
Commits

Reviewing files that changed from the base of the PR and between fc12196 and 1bb54d8.

Files selected for processing: 17
  • src/main/native-chat/agent-session-wire/structured-agent-session-receiving-account-perf.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-receiving-account.test-support.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-receiving-nested.test.ts
  • src/main/runtime/agent-session-record-store.ts
  • src/main/runtime/agent-session-sender-identity-revision.ts
  • src/main/runtime/agent-session-store-transactions.ts
  • src/main/runtime/orchestration/structured-session-lineage.ts
  • src/main/runtime/runtime-agent-sender-associations.test.ts
  • src/main/runtime/runtime-agent-sender-associations.ts
  • src/main/runtime/runtime-agent-sender-chat-lineage.test.ts
  • src/main/runtime/runtime-agent-sender-history.ts
  • src/main/runtime/runtime-agent-sender-publication.ts
  • src/main/runtime/session-tabs/session-tabs-change-publication.ts
  • src/main/runtime/session-tabs/session-tabs-inventory.ts
  • src/main/runtime/session-tabs/session-tabs-sender-pass.test.ts
  • src/renderer/src/runtime/agent-sender-alias-projection.ts
  • tests/e2e/agent-sender-delivery.unit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 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: 4

Caution

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

⚠️ Outside diff range comments (1)

Major · Add the required agent field to the three… · worker-start-card-operations.test.ts:215-267

src/main/runtime/rpc/methods/orchestration/worker-start-card-operations.test.ts:215-267
Major · Functional Correctness · Quick win

Add the required agent field to the three recordStart argument objects. Typecheck fails with TS2741.

prepareWorkerStartCard now requires agent: AgentType | null in its callback arguments (worker-start-card.ts, lines 10-16). The pipeline log reports three test objects at lines 215-267 that lack agent. This blocks the typecheck step.

Add agent: null, or a concrete agent where the test checks the recorded worker, to each object. Also add one assertion that a non-null agent reaches the recorded worker. That assertion covers the new { ...worker, agent: args.agent } branch. No test covers this branch.

This range is outside the changed lines in this diff. Line 182 only switches the spy to snapshotOf.

Source: Pipeline failures


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: 75e3e65c-5f1b-4c9c-837d-f46b7b7d8c4a
Commits

Reviewing files that changed from the base of the PR and between b69a5c6 and 37fb76a.

Files selected for processing: 82
  • src/main/native-chat/agent-session-journal/journal-storage-schema.ts
  • src/main/orcad/orcad-entry.ts
  • src/main/runtime/agent-session-record-store.ts
  • src/main/runtime/agent-session-sender-identity-revision.ts
  • src/main/runtime/agent-session-store-transactions.ts
  • src/main/runtime/construction/runtime-agent-projections.ts
  • src/main/runtime/construction/runtime-construction-services.ts
  • src/main/runtime/construction/runtime-service-state.ts
  • src/main/runtime/orchestration/agent-facing-parity.test.ts
  • src/main/runtime/orchestration/agent-message-sender.ts
  • src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts
  • src/main/runtime/orchestration/dispatch-task-source.ts
  • src/main/runtime/orchestration/environment-transport.ts
  • src/main/runtime/orchestration/orchestration-sender-name.ts
  • src/main/runtime/orchestration/structured-mail-source.test.ts
  • src/main/runtime/orchestration/structured-mail-source.ts
  • src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts
  • src/main/runtime/orchestration/structured-mailbox-pointer-delivery.ts
  • src/main/runtime/orchestration/structured-session-lineage.ts
  • src/main/runtime/orchestration/worker-start-card.ts
  • src/main/runtime/rpc/agent-sender-refresh.test.ts
  • src/main/runtime/rpc/dispatcher.ts
  • src/main/runtime/rpc/methods/orchestration-structured-worker-retry.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts
  • src/main/runtime/rpc/methods/orchestration/runs/dispatch-methods.ts
  • src/main/runtime/rpc/methods/orchestration/worker-start-card-operations.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.ts
  • src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
  • src/main/runtime/rpc/methods/session-tabs-inventory.ts
  • src/main/runtime/rpc/methods/session-tabs-sender-delta.ts
  • src/main/runtime/rpc/methods/session-tabs.ts
  • src/main/runtime/runtime-agent-sender-associations.test.ts
  • src/main/runtime/runtime-agent-sender-associations.ts
  • src/main/runtime/runtime-agent-sender-history.ts
  • src/main/runtime/runtime-agent-sender-publication.ts
  • src/main/runtime/runtime-orchestration-sender-names.test.ts
  • src/main/runtime/runtime-orchestration-sender-names.ts
  • src/main/runtime/session-graph/session-window-graph.ts
  • src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts
  • src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts
  • src/main/runtime/session-tabs/mobile-session-membership.ts
  • src/main/runtime/session-tabs/session-tabs-change-publication.ts
  • src/main/runtime/session-tabs/session-tabs-inventory.ts
  • src/main/runtime/terminal/launch/mobile-terminal-owned-create.ts
  • src/main/startup/main-process-runtime-launch.ts
  • src/main/startup/main-process-runtime-service.ts
  • src/renderer/src/components/native-chat/NativeChatAgentMessageCard.test.tsx
  • src/renderer/src/components/native-chat/NativeChatAgentMessageCard.tsx
  • src/renderer/src/components/native-chat/NativeChatAgentMessageRow.test.tsx
  • src/renderer/src/components/native-chat/NativeChatAgentMessageSenders.test.tsx
  • src/renderer/src/components/native-chat/NativeChatAgentMessageSenders.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-compatibility.ts
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-identity.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-label.ts
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-open.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-publication.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-source.ts
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-target.ts
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-view.ts
  • src/renderer/src/components/sidebar/use-worktree-agent-activation.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/open-agent-message-sender.test.ts
  • src/renderer/src/lib/open-agent-message-sender.ts
  • src/renderer/src/runtime/agent-sender-alias-projection.ts
  • src/renderer/src/runtime/agent-sender-associations.ts
  • src/renderer/src/runtime/agent-sender-delivery.test.tsx
  • src/renderer/src/runtime/agent-sender-publication-patch.ts
  • src/renderer/src/runtime/sync-runtime-graph/graph-publication.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts
  • src/renderer/src/runtime/web-session-tabs-sync/frame-drawn-server-workspaces.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync/state.ts
  • src/renderer/src/store/slices/agent-status/agent-status-slice-contract.ts
  • src/renderer/src/store/slices/agent-status/agent-status.ts
  • src/shared/agent-sender-associations.ts
  • src/shared/agent-session/agent-message-presentation.ts
  • src/shared/agent-session/agent-session-message-source.test.ts
  • src/shared/agent-session/agent-session-message-source.ts
  • src/shared/agent-title-owner.ts
  • src/shared/native-chat-types.ts
  • src/shared/runtime-environment-store-file.ts
  • src/shared/runtime-session-contracts.ts
  • src/shared/structured-agent-start-projection.ts

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

…st with saved-kind icons

The base's worker command contract test reads the shared rule that a
dispatch: address is never a link; the card's link check now calls that
shared rule instead of repeating it. The base's sender view test expected a
different agent's live row to replace the saved icon; this branch shows the
saved kind without that row's status, so the test asserts that.

@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: 09b223a1-0676-4f87-b27e-dccc17f28d12
Commits

Reviewing files that changed from the base of the PR and between 37fb76a and ce6d1bb.

Files selected for processing: 24
  • src/main/native-chat/agent-session-journal/journal-storage-admission.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-queued-message-rig-provider.test-fixture.ts
  • src/main/runtime/orchestration/agent-facing-parity.test.ts
  • src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts
  • src/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-outcome.ts
  • src/main/runtime/orchestration/orchestration-sender-name.ts
  • src/main/runtime/orchestration/structured-mailbox-held-worker-report.test-fixture.ts
  • src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts
  • src/main/runtime/orchestration/worker-launch-observation.ts
  • src/main/runtime/rpc/methods/orchestration/agent-message-command-contract.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts
  • src/main/runtime/rpc/methods/orchestration/rpc-test-harness.ts
  • src/main/runtime/rpc/methods/orchestration/worker-start-card-operations.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker-start-card-population.test-fixture.ts
  • src/main/runtime/rpc/methods/orchestration/worker-start-card.test.ts
  • src/main/runtime/rpc/methods/session-tabs-sender-delta.ts
  • src/main/runtime/runtime-orchestration-sender-names.test.ts
  • src/main/runtime/runtime-orchestration-sender-names.ts
  • src/renderer/src/components/native-chat/NativeChatAgentMessageRow.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-publication.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-view.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/agent-sender-alias-projection.ts
  • tests/e2e/agent-sender-delivery.unit.test.ts
Files skipped from review as they are similar to previous changes: 2
  • src/main/runtime/orchestration/agent-facing-parity.test.ts
  • src/renderer/src/i18n/locales/en.json

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

…its replaced check

A hooks-off agent whose last status came from a terminal report without an app id saves the kind
"unknown". That kind proved nothing, yet it vetoed the live agent in its own terminal: the card
showed "?" with no dot as a plain name, and a raced click said another agent was running there.
One shared read now treats it as no saved kind for the veto and the icon, on every path.
… each scope's own revision

A stream counts a sender scope as sent once a frame carries it, but the window applied it only
inside the tab apply, behind the tab version, resume census, receipt recovery and frames-draw
checks. A frame those checks dropped could hold the only copy, so a paired host's cards stayed
on stale rows (no dot while the sidebar showed the agent) until that worktree's senders changed
again. Each receipt path now folds the frame's sender scopes in right after its connection,
pairing and runtime checks; the tab apply keeps only a worktree's removal.

A scope now also yields to that scope's own newer delivery, not only to a newer whole-host
baseline, so a delayed list reply can't put back older rows. Every publishing host stamps a
revision, so the content-comparison path for unrevisioned publications is gone.

@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: 21168761-222f-4327-83ef-cac6baff57c5
Commits

Reviewing files that changed from the base of the PR and between fa037fd and fc12196.

Files selected for processing: 18
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-identity.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-open.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-publication.test.tsx
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-target.ts
  • src/renderer/src/components/native-chat/native-chat-agent-message-sender-view.ts
  • src/renderer/src/runtime/agent-sender-publication-patch.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts
  • src/renderer/src/runtime/web-runtime-session-snapshot.ts
  • src/renderer/src/runtime/web-session-tabs-sync/active-session-subscription.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts
  • src/renderer/src/runtime/web-session-tabs-sync/frame-drawn-server-workspaces.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync/global-session-events.ts
  • src/renderer/src/runtime/web-session-tabs-sync/global-session-inventory-event.ts
  • src/renderer/src/runtime/web-session-tabs-sync/load-initial.ts
  • src/renderer/src/runtime/web-session-tabs-sync/received-agent-sender-publications.ts
  • src/shared/agent-sender-associations.ts
  • src/shared/agent-session/agent-message-presentation.ts
  • tests/e2e/agent-sender-delivery.unit.test.ts

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

…every saved chat

Each chat tab opened or closed, chat created or moved, or /clear committed rebuilt the chat
senders by listing every saved chat (42 ms at 10,000 on the main thread) only to keep the open
ones. The record store now keeps an in-memory reverse of the saved /clear pointer, built at
load and updated for the rows each commit writes; nothing new is saved. The sender read starts
from the open chats and follows that index to their predecessors, so its work no longer grows
with closed history.
…once per worktree

A one-shot inventory or a broadcast built every worktree's frame through its own sender
refresh, and each refresh walks every live terminal: 20,000 visits for 1,000 terminals over 20
worktrees. Both passes now build their frames from one refresh. The publisher counts its leaf
and terminal visits, and a test drives the real inventory and broadcast methods at 100 and
1,000 terminals.
The window's sender aliases were recomputed for every open tab whenever any workspace-owner input
changed, such as switching workspaces or writing a setting, though a bucket reads those inputs
only through one host per worktree. Each bucket now keeps the host values it read and, when
owner inputs move, checks just those before reusing its aliases. The delivery contract test
counts alias work through workspace switches, settings writes and a title-only change.
…ontent without its revision

R4 swapped the inventory's abstract single-frame declaration for the batch one, but the
headless browser-tab emit and the runtime-owned terminal create still build one worktree's
frame through it; both keep the per-frame sender scope. The publisher's content comparison now
takes publications without their revision stamp, which R4 made required.
The sender publication walked every live terminal through the runtime's handle-issuing functions,
so each display build could mint, adopt or rebind terminal handles. During a renderer reload or a
split close that changed which handle a terminal held and what retirement frames published. Sender
rows now read only the handles terminals already hold; a terminal with no issued handle has no row,
and no card can name it.
…s no tab for it

When a card's sender was found in a pane this window had not loaded yet, the click asked the host
about the card's saved terminal instead. For a worker reopened by a follow-up, that opened its first
terminal, or said the pane was gone, while the card showed the reopened worker running. The click
now opens that same pane: by the handle its status row holds on that host, else by asking the host
for that pane in the host's own coordinates. It checks the card again after the host answers, and a
closed pane says the agent is no longer running. The saved-address lookup stays only for senders no
host has located.
…w graph exists

When the window graph went away, the host cleared its handle records but kept each terminal's
start-time handle, which its agent's mail cards save as the sender. The read-only handle lookup
required a record, so the running terminal lost its sender row and its cards showed no dot until a
window came back. It now returns the handle issuing would reuse, record or not, and still changes
nothing.
…r does

A sender name drawn without an avatar (queued mail, a card's later senders) checked for a different
agent through a source nothing leased, so every store write rebuilt that worktree's sidebar rows.
The name's link now holds the same lease the avatar does, and a card with no saved agent kind
skips the row read entirely.
… per terminal

The read-only handle lookup fell back to a scan of every handle record for each leafless terminal
holding no handle, on every sender build. A build now gets one reader that indexes the records on
its first miss and answers each terminal from that index, with the same handles issuing reuses.
…e the kind check

A card whose terminal now runs a different agent resolved no location, so it leased no row
source and rebuilt its worktree's rows on every store write. Both the avatar and the link now
lease from the candidate location the kind check reads; their answers are unchanged.
…irrors the whole tab

A paired host names a pane <tab>:<leaf>; this window mirrors that tab whole as web-terminal-<tab>
with the leaf ids kept, and its status rows use that key. The alias projection mapped only
per-pane mirrors, so the card located the host's key and found no row to draw a dot from. The
terminal bucket now also maps a whole-tab mirror's host tab, and a host pane takes this window's
name from either form; two names for one pane still locate neither.
@brennanb2025

brennanb2025 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Review finished on current head; CI, functional QA and the bounded performance review completed (2026-11-02). The latest reviewed main integration is pushed as 781bfff320dd4fd75ca425408e5aeb09c187a64b; all 61 current-head CI checks passed, with no pending or failed checks and no merge conflicts at verification. The narrow independent merge review agreed, and 55 targeted integration tests passed. All 61 CI checks passed on the previous head 01a65baf30e5f1f3c72d6eb850026e9a63838e36, including the mobile production/test typechecks and all 17 relevant provider/navigation tests.

Fresh Codex and Claude worker messages displayed known identities and opened the correct worker terminals on desktop 37abb7c91efc69b68772604864664d0023365410; its direct child changes only the mobile caller and rendered test, and the later main merge preserves this evidence. All six copies, drivers and samplers from that round stopped and its slot was released. The separate controlled warm comparison is complete, using identical completed conversation content and timed actions; no agents ran during those measurements.

The final controlled saved-history comparison completed with exact output equality at start, end and ten seconds afterward: 172 saved chats, 208 messages, 129 mounted roots and four sender cards. In one 30-second window per pinned build, branch renderer task CPU rate fell 9.14%; sampled RSS peak was 28.08 MiB higher from a 35.33 MiB higher start. Frame p95 stayed 18.5 ms; maximum frame gap rose 18.7 ms, long-task total rose 6 ms, workspace switches were 42–56 ms faster and draft entry was 7 ms slower. The earlier unmatched CPU increase and 203 MiB peak gap did not reproduce at that magnitude. The RSS difference is unattributed. Source counters were unavailable; this measures saved-history navigation/draft entry in a development build, not active sender updates, streaming or universal performance. Independent verification recomputed the raw CPU/frame/action results and compared every mounted root at each checkpoint. It found no concrete production performance defect requiring another patch or run. Equality excludes per-copy identity/timestamps and measurement/memory fields; actual rendered content, controls and geometry match. The bounded performance review is complete.

Earlier failed fixture/output gates are retained as failures. They were repaired with original nonsecret sender handles, ordinary model/notice UI actions and matched saved startup routes; no production patch or output normalization was used. All owned QA copies, drivers and samplers stopped gracefully, config hashes were unchanged, and both QA slots were released.

The broad local changed check did not complete its related-unit selection within 30 minutes; subsequent bounded attempts also remained incomplete. Scoped regression tests, static checks and the 1,591-test runtime integration passed, and the previous-head CI was green; all 61 current-head CI checks passed. The final before-push check passed 40 checks and timed out only its broad unit selection at the disclosed two-minute limit. An unchanged profile-transfer timeout remains an unresolved main/rig candidate; no separate product defect has been proven or included in this PR.

The repeated unknown-sender screenshots were separately traced to a local wake helper stripping its caller identity. That helper is repaired: bounded CLI tests and authenticated live delivery/readback confirm the originating Codex identity is retained. Tracked separately in STA-13515.

Retained functional review on 35e6c55 (full path; real-app QA on 0d2eff6)

The problem. Agent message cards in a native chat ("Started worker", "Update from worker", replies) show who sent them: an agent icon, a live status dot, and the sender's name as a "Go to agent" link. Coordinators saw a "?" icon and no dot for workers the sidebar showed fine. Each card found its sender with its own lookup, which missed title/process-only terminals, unloaded chats, chats after /clear, reopened workers and paired computers. The click used yet another lookup, so after a worker was reopened elsewhere the avatar and the click could point at different agents.

What changes for users. Each card's sender is worked out once, from the same agent rows the sidebar shows, and the icon, dot, link and click all use that answer. Terminal senders are found by their saved terminal handle (with or without status hooks, plain shells too), survive a normal restart, follow a reopened worker, and show their live dot when they run on a paired computer. When a different kind of agent now runs in a sender's terminal, the old card keeps its own icon, shows no dot and becomes plain text.

What was fixed in review. Six review rounds and five design-panel rulings settled the design. The host publishes, next to the sidebar rows, which agent each saved sender identity points at now, sends it only when it changes, and rebuilds only what a write touches. The window reads one index of those publications. Late fixes:

  • Terminal handles are read, never issued, by this display bookkeeping (it was changing terminal identity during reloads).
  • A sidebar-row lease stops cards rebuilding rows on unrelated store writes.
  • Real-app QA found paired-computer cards never showed their dot: this window names a mirrored whole tab web-terminal-<tab>, and the card only knew the per-pane form. Fixed in 0d2eff6, then re-run on the app.
  • A review-bot thread found that a chat opening, closing or running /clear during a refresh whose terminal read failed was never published. Fixed in 35e6c55 (failure path only; covered by the extended failure test in runtime-agent-sender-associations.test.ts, which fails without the fix). It changes no flow QA exercised, so QA evidence carries from 0d2eff6.

Verified.

  • CI is green on 35e6c55.
  • All 31 of the PR's test files pass.
  • Real app on the M4Air with Claude and Codex workers. First run at 80920f0, rerun of the paired flows and a local control at 0d2eff6:
    • warm restart keeps every card's dot and link, and clicks open the right pane;
    • a worker in an unvisited worktree opens its pane;
    • cold respawn shows no dot;
    • a different agent in the shell turns old cards plain;
    • the same-kind successor behaves as labelled;
    • with status hooks off, cards keep the Claude icon, dot and link;
    • paired-computer cards show the sidebar's dot, follow Working to Done, and open the mirrored terminal.
  • Real config hashes were unchanged.

Not verified. Windows/WSL chat senders (optional flow E): no Windows+WSL slot, so tests cover them.

Deferred follow-ups.

  • STA-13212: a card whose sender's pane this window names two ways keeps a link instead of a plain name.
  • A doc-comment placement nit in the start-card dispatch id.

For Brennan's review

  • Decision pending (labelled temporary): what clicking a card whose terminal died and was replaced does. Default GONE_TERMINAL_SENDER_CLICK='host-lookup' (src/renderer/src/components/native-chat/native-chat-agent-message-sender-target.ts:27) keeps main's behaviour: the name stays a link and the click asks the host. QA showed that when the replacement shell runs another agent, every click says "T1 is no longer running in its terminal; another agent is running there now. Open that terminal from the sidebar if you need it." and opens nothing. 'plain' would show a plain name instead. The launcher's pick is 'plain'.
  • Where the card decides its sender: resolveAgentMessageSender (src/renderer/src/runtime/agent-sender-associations.ts:194) and the saved-kind check in resolveAgentMessageSenderTarget (native-chat-agent-message-sender-target.ts:62).
  • What the host publishes: RuntimeAgentSenderAssociations.readTerminals (src/main/runtime/runtime-agent-sender-associations.ts:263).
  • Seen on main, outside this PR:
    • after a cold respawn the sidebar keeps a retained "T1 - Claude / Done" row for the fresh shell;
    • supervised workers' tabs aren't restored after a cold respawn (recovery marks them abandoned);
    • a batched notice card naming two senders shows only the first sender's avatar and dot;
    • federated senders' names stay plain text (making them clickable would be a new feature).
Warm restart (dots and links kept) Click opens the worker's pane
A1-cards-after-warm-restart.png A2-click-W1-claude.png
Cold respawn: no dot Different agent in the shell: plain names
C1-cards-after-cold-respawn.png D1-claude-card-codex-in-shell.png
Same-kind successor (labelled) Status hooks off
D2-same-kind-successor.png G1-hooks-off-card.png
Paired computer, Claude worker (dot shown) Paired computer, Codex worker (dot shown)
R-B2-paired-card-claude.png R-B2-paired-card-codex.png
Paired new worker after Done Replaced terminal click toast (pending decision)
R-F1-paired-new-worker-done.png C3d-after-1s.png

Fresh real-agent proof (desktop 37abb7c91ef, carried as described above)

Claude sender card Codex sender card
Claude sender identity Codex sender identity
Claude click destination Codex click destination
Claude worker terminal Codex worker terminal

Main comparison: Claude card, Codex card.

Final review and evidence carry. The original six review rounds and corrected whole-mechanism comparison, plus independent affected-mechanism checks of the Nov2 ownership, delivery and lineage repairs, cover the final diff. Intended and temporary differences above remain labelled. The late main merge 781bfff320dd4fd75ca425408e5aeb09c187a64b preserves incoming main behavior and the sender regression contract; an independent review agreed, 55 targeted tests passed and all 61 current-head CI checks passed. Desktop real-agent QA is on 37abb7c91efc69b68772604864664d0023365410; mobile-only commit 01a65baf30e5f1f3c72d6eb850026e9a63838e36 changes a tests-row callback-capability flow and passed production/test typechecks plus provider/navigation/rendered coverage in CI. The later main merge does not stale this desktop evidence. The earlier unavailable-Claude seats were substituted under Brennan's explicit task instruction; the tooling's newer ruling-check schema was not claimed green. No independent seat or tool pass was invented.

…refresh fails

The chat rows and their key were stored before the terminal read; when that read threw, nothing
was published, and the next build saw both keys as handled, so the chat change waited for an
unrelated identity change. The refresh now publishes whatever changed beside the last good
terminal rows, and the read's error still reaches the build's warning.
@brennanb2025
brennanb2025 merged commit 8eba2a0 into main Nov 3, 2026
80 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