@@ -155,19 +155,30 @@ export const TEAM_AVATAR_STACK_LIMIT = 6;
155155 * are always "active" — they have no presence concept of their own) plus
156156 * every human currently reflected in live presence. Agents first since
157157 * they're a workbench's stable roster; humans are who's here right now.
158+ *
159+ * Each agent gets its own `generatedAvatarStyle` fill keyed by address
160+ * (CL-6594) — the same deterministic-per-principal machinery humans
161+ * already use — rather than one shared CSS accent color for every
162+ * agent, so two agents in the same room never render as
163+ * indistinguishable avatars.
158164 */
159165export function buildTeamAvatarStack (
160166 participants : readonly ParticipantRecord [ ] ,
161167 presenceMembers : readonly PresenceMember [ ] ,
162168) : readonly TeamAvatarEntry [ ] {
163169 const agents = participants
164170 . filter ( ( participant ) => isAgentAddress ( participant . address ) )
165- . map ( ( participant ) => ( {
166- key : participant . address ,
167- initials : participant . handle ,
168- label : participant . handle ,
169- tone : "agent" as const ,
170- } ) ) ;
171+ . map ( ( participant ) => {
172+ const style = generatedAvatarStyle ( participant . address ) ;
173+ return {
174+ key : participant . address ,
175+ initials : participant . handle . slice ( 0 , 1 ) . toUpperCase ( ) ,
176+ label : participant . handle ,
177+ tone : "agent" as const ,
178+ color : style [ "--avatar-identity-bg" ] ,
179+ textColor : style [ "--avatar-identity-fg" ] ,
180+ } ;
181+ } ) ;
171182 const humans = presenceMembers . map ( ( member ) => ( {
172183 key : member . principalId ,
173184 initials : member . displayName . slice ( 0 , 1 ) . toUpperCase ( ) ,
@@ -1142,30 +1153,22 @@ function ChatWorkspaceInner({
11421153 className = "chat-team-stack"
11431154 aria-label = { CHAT_STRINGS . workbenchMembersLabel }
11441155 >
1145- { visibleTeamStack . map ( ( entry ) =>
1146- entry . tone === "agent" ? (
1147- < span
1148- key = { entry . key }
1149- className = "chat-presence-avatar"
1150- data-agent = "true"
1151- title = { entry . label }
1152- >
1153- { entry . initials . slice ( 0 , 1 ) . toUpperCase ( ) }
1154- </ span >
1155- ) : (
1156- < span
1157- key = { entry . key }
1158- className = "chat-presence-avatar"
1159- style = { {
1160- backgroundColor : entry . color ,
1161- color : entry . textColor ,
1162- } }
1163- title = { entry . label }
1164- >
1165- { entry . initials }
1166- </ span >
1167- ) ,
1168- ) }
1156+ { visibleTeamStack . map ( ( entry ) => (
1157+ < span
1158+ key = { entry . key }
1159+ className = "chat-presence-avatar"
1160+ data-agent = {
1161+ entry . tone === "agent" ? "true" : undefined
1162+ }
1163+ style = { {
1164+ backgroundColor : entry . color ,
1165+ color : entry . textColor ,
1166+ } }
1167+ title = { entry . label }
1168+ >
1169+ { entry . initials }
1170+ </ span >
1171+ ) ) }
11691172 { teamStackOverflow > 0 ? (
11701173 < span
11711174 className = "chat-team-stack-overflow"
0 commit comments