Skip to content

Agent message cards keep their sender's agent icon when the agent can't be found - #36653

Merged
brennanb2025 merged 11 commits into
mainfrom
brennanb2025/worker-card-icon
Nov 1, 2026
Merged

brennanb2025 merged 11 commits into
mainfrom
brennanb2025/worker-card-icon

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​850 $\color{#cf222e}{\Huge{\mathbf{−}}}$​58 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​792
Prod 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​488 $\color{#cf222e}{\Huge{\mathbf{−}}}$​91 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​397

Problem

A coordinator chat can show a "Started worker" card with "?" and no status dot while the sidebar shows that same worker's agent icon and live status. The same issue affects "Update from worker", "Task from coordinator" and "Message from coordinator" cards.

Messages saved the sender's name, but their icons depended on finding a live agent. A missing status row, closed terminal, restart or worker on another host could leave the card with nothing to draw.

What changes for users

New cards retain the sender's agent icon when the agent is known, even if the live agent cannot be found. A live agent row still supplies the current icon and status. Cards written before this build keep their existing behavior.

How

  • Worker-start, mail, task and coordinator writers save the sender's agent beside its name. The current chat provider or qualified terminal agent takes priority; an exact worker association can supply its saved launch information when live state is gone.
  • A remote worker's reported agent is retained in its existing saved launch information. Later updates and completion cards can use it after restart, independently of whether a Started-worker card was published. The user's launcher command, requested model and effort, and follow-up launch choices remain intact.
  • Name and icon share one sender observation. A chat's committed /clear lineage is traversed once per snapshot; worker fallback uses indexed identity lookups.
  • The saved field is optional and bounded. Future agent kinds survive with the existing letter-icon fallback; malformed metadata is ignored without losing the sender or failing launch or message delivery. Saved agent kind never creates a live status dot.

Plan

This is the first of two independently useful changes:

  1. This PR saves known agent kinds on every sender and uses them when live identity is unavailable.
  2. Agent message cards find their sender's agent and status in the same store as the sidebar #36660 finds the sender through the same agent store the sidebar uses, so live identity, labels and status also agree after restart, /clear, worker reopening and across hosts.

Differences from the common pattern:

  • Durable worker identity supplies each message's saved sender presentation: adopted.
  • Intended: known remote agent kinds remain available without a visible remote row, and bounded future kinds survive independently updated clients and servers.
  • Intended: saved kind supplies an icon only; current status comes from the live row. Older cards are not backfilled when their agent was never saved.
  • Intended downgrade behavior: after downgrading to an older Orca, a chat that received one of these new cards shows that it was written by a newer version and opens again after updating; nothing is lost. This follows the journal's existing preservation behavior and the policy that saved data does not require downgrade compatibility by default.
  • Live identity still comes from the card's own lookup: temporary, replaced by Agent message cards find their sender's agent and status in the same store as the sidebar #36660, tracked in STA-13124.

Tests

  • Real CLI → RPC → production writers → journal and queue for worker start, saved tasks, dispatch and ordinary mail, with distinct Claude coordinator and Codex worker identities.
  • Configured remote launchers, unchanged command/preferences, and new status/completion mail after reopening the actual home database; absent, pending and failed Started-worker publication.
  • Failed, unknown, foreign, older, malformed and future launch metadata; isolated metadata read/write failures preserve the user's action and prior information.
  • Held local worker completion delivered after terminal loss through the legitimate journal wake, with marking only after acceptance and live-agent precedence retained.
  • Sender/storage round-trip and salvage for start, message and queued bodies; legacy and saved card icons, unchanged mobile/queue/copy/open behavior, and no saved status dot.
  • N/10N operation-count contracts for one fresh lineage walk and indexed worker lookups without population or history scans.

…'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 marked this pull request as ready for review October 31, 2026 10:52
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

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: 68a267ba-16e4-48ae-9613-bac82a7aaafb
Commits

Reviewing files that changed from the base of the PR and between a426d68 and 1a93505.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

Sender metadata now includes an optional agent value alongside the sender name. Runtime resolution derives both values from one observation and can use persisted worker launch options when live agent data is unavailable. Orchestration task and mailbox delivery pass sender snapshots. Worker-start paths record launch agent data, and native chat falls back to saved sender metadata when live status is absent. Tests cover persistence, delivery, worker-start cases, and rendering.

Merge Risk: Low · previous review a426d

A small set of worker messages can show an incorrect agent icon, but delivery and launch behavior remain intact; the change is otherwise low risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.04% 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 clearly and concisely describes the main change: preserving sender agent icons when live agent lookup fails.
Description check Passed The description explains the problem, user-visible behavior, implementation, rationale, linked follow-up issue, and extensive test coverage. It is mostly complete, although it does not use every templ…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, user-visible behavior, implementation, rationale, linked follow-up issue, and extensive test coverage. It is mostly complete, although it does not use every template heading or include the checklist fields explicitly.

Full details: Docstring Coverage

Explanation

Docstring coverage is 37.04% 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 27 functions across 37 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

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

Follow-up Comments

Nitpick Exercise malformed launch metadata through message delivery.

475-479: Trivial · Functional Correctness · Quick win

Exercise malformed launch metadata through message delivery.

The malformed-federated case returns after checking worker start success. It does not call worker-show, so the configured federationPull fixture and its sender assertions remain untested for malformed metadata. Add the same subsequent delivery flow and assert that the pulled message retains the saved sender name and agent.

Open the source location


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: 50454082-3807-48e5-be32-186c91ce8fcc
Commits

Reviewing files that changed from the base of the PR and between ce8fffd and c27de2a.

Files selected for processing: 1
  • src/main/runtime/rpc/methods/orchestration/agent-message-command-contract.test.ts
Files skipped from review as they are similar to previous changes: 1
  • src/main/runtime/rpc/methods/orchestration/agent-message-command-contract.test.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.

@brennanb2025

brennanb2025 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Worker cards could show “?” after their live agent row disappeared because messages saved the sender's name without its agent kind. New start, task and message cards now retain a known sender icon. A live row still supplies current identity and status; saved metadata never creates a status dot.

The review fixed configured remote launchers losing their known agent on later mail, held completion messages losing it after terminal exit, malformed optional launch receipts failing a successful action, and duplicate lineage reads. The user's command, requested model/effort and follow-up choices are preserved. Three review rounds, the design ruling, fresh architecture/performance checks and final readiness/reference comparison are complete. One subsequent CI repair only combined duplicate test imports; its independent review confirmed unchanged production and assertions.

Temporary follow-up: the card's live identity/status/label lookup remains in #36660, tracked in STA-13124. Older cards without saved agent information retain their existing behavior. Intended downgrade behavior: an older Orca preserves a chat with new sender fields but reports that it needs a newer version; updating opens it again without data loss. Known remote metadata and bounded future agent kinds are intended adaptations for independently updated hosts; saved icon-only fallback is also intended.

Verification: current-head CI passed, including static analysis/typecheck, all 12 test shards, packaging, mobile verification and cross-version wire compatibility. Focused execution covered 12 named files / 158 tests, followed by affected helper/fixture checks (3 files / 63 tests), test-pruning checks (4 files / 77 tests and the final 40-test resolver suite), and the import-only repair's 5 CLI contracts. Coverage includes actual CLI → RPC → production writers → journal/queue fixtures with distinct Claude coordinator and Codex worker identities; reopen, held completion, malformed/future metadata, renderer precedence and N/10N operation bounds. These are integration fixtures, not real provider executions. The QA table classifies these changes as tests-only: no app run or screenshot was required because icon geometry, layout, copy and interaction are unchanged.

QA evidence is retained at 33bc763973bd9dd3239bf9901562dffb86179344. The subsequent clean main merge ce8fffdda3c0105b5d5fc428f0cd80801c4916a2 received a narrow independent review; c27de2a3a171b4047ff65fdd33518ff14f1b65f2 changes test imports only. All 18 PR production files remain identical to the reviewed production commit. A second clean main merge a62d7f4c771 brought in #30955, whose three new receiving-account tests used the renamed sender resolver; fe50fad6beb942a57878d90c4ba2a7b3d6119790 updates only those three test call sites (senderName → senderSnapshot), and the seven affected files (88 tests) pass. A third clean main merge, 30b1176d04bd544ddb2ed25a5f3b43a707eeb3aa, resolved a test-only conflict in journal-storage-admission.test.ts by keeping both sides' new tests (12 tests pass).

For Brennan’s 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.

Caution

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

⚠️ Outside diff range comments (1)

Minor · Resolve the sender snapshot for each reported dispatch. · structured-mail-source.ts:27-44

src/main/runtime/orchestration/structured-mail-source.ts:27-44
Minor · Functional Correctness · Quick win

Resolve the sender snapshot for each reported dispatch.

When one structured-mail group contains valid worker_done reports for different dispatches, group.find(...) supplies the first dispatch to the single sender shared by the group. This makes later cards use the first dispatch's saved agent icon when live identity is unavailable. Resolve the sender per message, or include the valid dispatch ID in the grouping key so messages with different reports receive distinct snapshots.


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: 25f49c56-faab-4971-ad38-ad9c387b3b0e
Commits

Reviewing files that changed from the base of the PR and between 30b1176 and a426d68.

Files selected for processing: 3
  • src/main/runtime/rpc/methods/orchestration-structured-worker-retry.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/deliver-worker-dispatch-preamble.ts
  • src/renderer/src/components/native-chat/NativeChatAgentMessageCard.test.tsx

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

@brennanb2025
brennanb2025 merged commit aa3979d into main Nov 1, 2026
51 checks passed
nwparker added a commit that referenced this pull request Nov 1, 2026
…cap (#36875)

#36653 added five lines to federated-worker-start.ts, which was already
near the 300-line cap, so main's Lint step fails (305 lines) and every
PR based on main fails static analysis.

Recording a ready remote dispatch's resources and its input-accepted
stage moves, unchanged, into federated-worker-ready-record.ts.
brennanb2025 added a commit that referenced this pull request Nov 1, 2026
Resolve conflicts with the session-module reorganization and with the
worker-start card's launched-agent fallback (#36653): the handoff card
uses the same fallback, keeping the launched agent's kind when the
sender lookup can't find it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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