This repository was archived by the owner on Apr 14, 2026. It is now read-only.
show per-message assistant identity from metadata instead of props - #156
Merged
Merged
Conversation
- Introduced `getPendingAssistantProviderId` function to retrieve the current pending assistant provider ID for a session. - Updated `useAcpStream` and `useChat` hooks to manage and utilize the pending assistant provider ID during message handling. - Modified message metadata to include `providerId` for better identification of assistant messages. - Improved tests to validate the correct handling of pending assistant provider changes and message creation. - Refactored UI components to remove unused agent name and avatar props, streamlining the message display logic.
Replace the Goose-specific loading row with calmer Thinking/Responding shimmer states so progress feels consistent across providers and less visually noisy.
Align the assistant identity row more cleanly with inline provider branding and nudge the user avatar to match the first line of message text.
…r rendering - Renamed `getPendingAssistantProviderId` to `getAssistantProviderId` for clarity and updated its logic to return the correct provider ID based on session state. - Added a key to the `LoadingGoose` component for improved rendering consistency. - Removed unused logic in `MessageBubble` to simplify the component. - Updated tests to reflect changes in message rendering behavior for in-progress assistant messages.
- Increased file size limit for `useAcpStream.test.ts` to accommodate additional test cases. - Expanded justification for the test to include provider identity persistence. - Simplified rendering logic in `LoadingGoose` by removing unnecessary class names. - Refactored `MessageBubble` component for improved readability and consistency in JSX formatting. - Updated tests for `LoadingGoose` and `MessageBubble` to reflect changes in rendering behavior.
- Updated test assertions in `MessageBubble.test.tsx` to enhance clarity by using consistent formatting for text queries. - Ensured that the checks for the presence of "Codex" are more readable and maintainable.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d511c7e21a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
lifeizhou-ap
added a commit
to lifeizhou-ap/goose2
that referenced
this pull request
Apr 13, 2026
* main: show per-message assistant identity from metadata instead of props (block#156) add file-aware widgets to context panel, simplify session search (block#154) Add i18n and cross-boundary dead data checks to code review skill (block#153) search session message content (block#152) add workspace widget with git branch and worktree management (block#151) fix: strip XML wrapper from replayed user messages (block#150) feat: add file @-mention autocomplete with project file scanning (block#147) improve sidebar contrast and constrain model picker (block#149)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: improvement
User Impact: Each assistant message now shows the correct provider name and icon for the model that actually generated it, even when switching providers mid-conversation.
Problem: Assistant identity (name, avatar, icon) was passed down as props from the chat view, meaning every message displayed the current agent's identity rather than the identity of the model that actually generated that message. Switching providers mid-conversation would retroactively relabel old messages.
Solution: Identity is now derived per-message from metadata (
providerId,personaId) stamped at send time. ApendingAssistantProviderIdin the chat runtime captures the provider before the backend confirms the message, ensuring the correct provider is recorded even if the session provider changes between send and message creation. The loading indicator was also simplified from animated icons to a shimmer-based "Thinking..." / "Responding..." status.Note: Session replay will fallback to providerID at the session level, not per message. Following up with separate PRs for storing per message provider in backend.
File changes
src/shared/types/chat.ts
Added
pendingAssistantProviderIdtoSessionChatRuntimeso the provider chosen at send time is available before the backend creates the assistant message.src/shared/types/messages.ts
Added
providerIdtoMessageMetadataso each message records which provider generated it.src/features/chat/stores/chatStore.ts
Added
setPendingAssistantProvideraction to set and clear the pending provider ID on the session runtime.src/features/chat/hooks/acpStreamTypes.ts
Extracted ACP event payload type definitions from
useAcpStream.tsto keep the hook file under the size limit.src/features/chat/hooks/useAcpStream.ts
Stamps
providerIdon assistant messages at creation time using the pending provider, with a fallback to the session's provider. Clears the pending provider after message creation and on completion.src/features/chat/hooks/useChat.ts
Sets
pendingAssistantProviderIdbefore sending, and clears it on error, stop, and reset paths.src/features/chat/ui/ChatView.tsx
Removed
agentNameandagentAvatarUrlprops that were being threaded through to child components. Wrapped the loading indicator inAnimatePresencefor smooth enter/exit transitions.src/features/chat/ui/LoadingGoose.tsx
Replaced animated icon indicators with a shimmer-based status. Simplified from four state-specific copy strings to two ("Thinking..." / "Responding..."). Removed the
agentNameprop since the indicator is now agent-agnostic. Added properuseReducedMotionsupport.src/features/chat/ui/MessageBubble.tsx
Derives assistant identity (name, icon, avatar) from per-message metadata instead of props. Shows the provider icon and display name from the provider catalog, with persona name taking priority when present. Migrated the fallback Bot icon from lucide to
@tabler/icons-react.src/features/chat/ui/MessageTimeline.tsx
Removed
agentNameandagentAvatarUrlprops. Added filtering for empty in-progress assistant shell messages.src/shared/ui/ai-elements/shimmer.tsx
Added
delay,repeatDelay, andtoneprops to support the loading indicator's softer shimmer variant.src/shared/i18n/locales/en/chat.json
Replaced four loading state keys with two simplified ones:
thinkingandresponding.src/shared/i18n/locales/es/chat.json
Updated Spanish translations to match the simplified loading state keys.
scripts/check-file-sizes.mjs
Bumped the test file size limit for
useAcpStream.test.tsto accommodate provider identity tests.src/features/chat/hooks/tests/useAcpStream.test.ts
Added tests verifying that
providerIdis stamped on created messages and that the pending provider is preserved when the session provider changes before message creation.src/features/chat/ui/tests/LoadingGoose.test.tsx
New test file covering thinking/responding copy, idle state rendering, with assertions driven from translation JSON.
src/features/chat/ui/tests/MessageBubble.test.tsx
Updated tests to verify provider-based identity rendering, persona name priority, and empty in-progress message handling.
Reproduction Steps
just devto start the app.