Repository navigation
🪪 fix: Draw a Subagent's Brief as the Dispatching Agent's Turn - #18278
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🟡 Changes recommended
Restored self-spawn briefs can show the wrong agent name and avatar, while parent-author headings can display and announce the child agent’s model instead of the parent’s name.
2 open issues
What changed in this PR
Restores dispatching-agent attribution for subagent briefs in the conversation-style panel introduced by #18197, while preserving ordinary user-turn rendering elsewhere.
Changes:
- Adds an optional author context for user-side turns in followed conversations.
- Passes the parent agent’s name and avatar from the subagent panel to message rows.
- Adds tests for brief attribution and panel prop wiring.
| File | Description |
|---|---|
packages/chat/src/react/messages/author.tsx |
Defines the optional user-turn author context and hook. |
packages/chat/src/components/subagents/panel.tsx |
Supplies parent-agent attribution for followed briefs. |
packages/chat/src/components/subagents/followed.tsx |
Forwards the brief author to the followed conversation. |
packages/chat/src/components/subagents/__tests__/panel.spec.tsx |
Checks that the panel passes the resolved author. |
packages/chat/src/components/subagents/__tests__/followed.spec.tsx |
Tests brief rendering with and without attribution. |
packages/chat/src/components/pane/Followed.tsx |
Provides author context around the message list. |
packages/chat/src/components/messages/MessageRender.tsx |
Displays explicit author headings on plain user-side turns. |
Review effort: Balanced
| label={authored != null ? authored.label : (messageLabel ?? '')} | ||
| showAuthor={authored != null} | ||
| hoverLabel={getHeaderHoverLabel( | ||
| hasConfiguredSender, |
There was a problem hiding this comment.
Valid. Fixed in dee57ad: a turn drawn for an explicit author gets no model hover label. The label on offer was the model of the conversation's agent, which for a child thread is the child, so the brief's heading named the parent and revealed the child's model on hover and to screen readers. Pinned in subagents/__tests__/followed.spec.tsx (the brief's heading does not contain the child's model), which fails against the previous code.
| threadId={threadId} | ||
| followed={followed} | ||
| agentId={taskView?.agentId ?? foregroundAgentId} | ||
| briefAuthor={briefAuthor} |
There was a problem hiding this comment.
Valid. Fixed in dee57ad: the brief's author is now the same value the durable view passes as its turn's parent author, childAuthor for a self-spawn that is not an event thread and parentAuthor otherwise. It is computed once (dispatcher) and used by both bodies, so they cannot name the brief differently. Pinned in panel.spec.tsx (a self-spawn's brief is named for the agent it runs as), which fails with the parent author used unconditionally.
…'s Model From the Brief's Heading
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

Summary
Since #18197 the subagent panel draws a background child's thread as a conversation, with main chat's own message list. A child's first turn is its brief, which the agent that dispatched it wrote. In that list the brief is the thread's user message, so it was drawn as an unlabelled user-side bubble, the way the reader's own messages are drawn. The view it replaced drew the same turn as a briefing from the parent agent, with that agent's name and face. A reader opening a child now sees a message that looks like one they sent and did not.
This draws the brief as the dispatching agent's turn again: the same user-side bubble, under the parent agent's name and avatar.
Related to #18197.
How it works
Main chat's row already has what is needed:
MessageRowtakesshowAuthor, aniconand alabel, and the wake-up row uses them to put an author over a user-side turn. What was missing is a way for a list to say that its user-side turns are someone else's.UserTurnAuthorContextis absent everywhere else, so main chat, the added pane and the shared view draw the reader's turns as they did. It applies to plain user-side turns only; a wake-up row keeps its own author.Type of change
Testing
Tested environments/configuration:
Chromium via Playwright,
e2e/playwright.config.mock.ts, server and client built from this branch, in-memory Mongo, fake model, Linux (WSL2).Automated tests:
packages/chat/src/components/subagents/__tests__/followed.spec.tsx(2 new): with a brief author the brief's heading is visible and carries that author's name and icon; without one the turn stays a plain user-side turn.panel.spec.tsx: the panel hands the followed thread the parent author it resolved.packages/chat:npx jest src/components/subagents src/components/pane src/components/messages(758 tests),npx tsc --noEmit.npm run static-checks -- --against origin/dev.Manual: opened a running background child in the mock lane; the brief shows the parent agent's name and avatar above the bubble (capture below).
Screenshots / recordings
Risk / compatibility
Only a followed child thread sets the new context. A child whose parent author cannot be resolved gets the localized "Parent agent" fallback the durable view already uses.