cmux NEXT agent chat: a Chief's message shows the Chief's name and avatar (#27914)

Merged
AU
6d ago
+418-19

Fixes https://github.com/manaflow-ai/cmux/issues/27914

What

When a Chief sends a message into a GUI agent chat, the line and the opened message's From: line now show that Chief's name and avatar, the same ones Home and the sidebar show. Before, they showed the Chief turn's internal session name (optchat-b902d10e-2991) and a robot icon.

Why it happened

A Chief runs each turn as an acpmux session named optchat-<home id>-<n>. When that turn sends another chat a message, acpmux signs it as a session_message using the sender session's name. The receiving page could not find that session in its chat list, because Chief sessions are hidden, so it had no harness or avatar to draw and fell back to Bot. Nothing on the session said which Chief it belonged to.

Change

  • optchat-chief (acpmux::turn_tags): each turn session is now tagged with the Chief's participant id (cmux.chief.participant) and the Chief's own name (mux.label, from MUX_CHIEF_TITLE, falling back to "Chief"). Approval cards already read mux.label, so they now name the Chief too.
  • acpmux (prompt_provenance::session_message_from): a session_message from a Chief's turn is signed with that label and gets fromChief (the participant id). Every other sender is unchanged.
  • agent page (incomingMessage.ts, chiefFace.ts, IncomingMessageCard.tsx): the message carries chief. The line asks the app chief.face {chief} and draws the returned name and picture (or text avatar). It no longer offers Open chat on the Chief's hidden turn session.
  • app (chief.face request, HomeService.agentPageFace, AgentAvatars.chiefFace): returns the Chief's name from the Home participants and Chief records, and its face from chiefFaces, falling back to its character picture (the default Chief's sidebar picture for agent_mux). A rename shows up the next time the page asks.

Changelog

  • Fixed: A Chief's messages to an agent chat show the Chief's name and avatar instead of an internal session name.

Summary by cubic

Fixes the agent chat so a Chief's messages show the Chief's name and avatar instead of an internal session name (optchat-…) and a robot icon.

  • A Chief's turn session is tagged with its participant id and its own name (from MUX_CHIEF_TITLE, falling back to "Chief").
  • acpmux stamps a message from a Chief's turn — sent by in-turn acpmux send (session_message) or by agents_chat_send (agent_message via the daemon's pump) — with that name and fromChief; other senders are unchanged.
  • The agent page asks the host for the Chief's face via a new chief.face request and draws the returned name and avatar on the message line and its From: line. An empty or failed answer is not kept, so a later line asks again.
  • "Open chat" on the Chief's hidden turn session is no longer offered.
  • A Chief's rename shows up the next time the page asks for its face.