Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(society): show wake-word name for the lead instead of Jarvis

rubenluetke10-beepcc563e7bb9a7
diff --git a/jarvis/ui/web/frontend/src/components/society/card/AgentBrowserPreview.tsx b/jarvis/ui/web/frontend/src/components/society/card/AgentBrowserPreview.tsx
index 73af82248b..224bfb3db2 100644
--- a/jarvis/ui/web/frontend/src/components/society/card/AgentBrowserPreview.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/card/AgentBrowserPreview.tsx
@@ -5,6 +5,8 @@
import { useEffect, useState } from "react";
import { ArrowLeft, ArrowRight, Maximize2, Minimize2, RotateCw } from "lucide-react";
import { useLocaleChunk, useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { cn } from "@/lib/utils";
import { BrandedSelect } from "@/components/ui/select";
import type { SocietyAgent } from "../data";
@@ -16,6 +18,8 @@ import "./agentCard.css";
export function AgentBrowserPreview({ agent }: { agent: SocietyAgent }) {
const t = useT();
useLocaleChunk("society");
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const { canvas, state, control, approve } = useBrowserView(agent.agentId);
const install = useBrowserInstallStatus();
const [expanded, setExpanded] = useState(false);
@@ -36,7 +40,7 @@ export function AgentBrowserPreview({ agent }: { agent: SocietyAgent }) {
)}>
<div className="mb-1 flex items-center justify-between gap-1 text-[10px] text-muted-foreground">
<div className="min-w-0">
- <div className="truncate">{agent.name} · {status}</div>
+ <div className="truncate">{displayName} · {status}</div>
</div>
<button className={buttonClass} onClick={() => setExpanded((v) => !v)}
aria-label={t(expanded ? "society.browser_live.collapse" : "society.browser_live.expand")}>
@@ -61,7 +65,7 @@ export function AgentBrowserPreview({ agent }: { agent: SocietyAgent }) {
<div className={cn("relative flex items-center justify-center overflow-hidden rounded-lg bg-muted",
expanded ? "min-h-0 flex-1" : "aspect-[16/10]")}>
<canvas ref={canvas} width={1280} height={800} tabIndex={state.manual ? 0 : -1}
- aria-label={t("society.browser_live.screen").replace("{0}", agent.name)}
+ aria-label={t("society.browser_live.screen").replace("{0}", displayName)}
className="block max-h-full max-w-full object-contain focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring"
style={{ aspectRatio: "16/10", width: "100%", height: "100%", objectFit: "contain" }}
onClick={(e) => {
diff --git a/jarvis/ui/web/frontend/src/components/society/card/AgentCardOverlay.tsx b/jarvis/ui/web/frontend/src/components/society/card/AgentCardOverlay.tsx
index fcdf93ef42..2913fa9781 100644
--- a/jarvis/ui/web/frontend/src/components/society/card/AgentCardOverlay.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/card/AgentCardOverlay.tsx
@@ -9,6 +9,8 @@ import { X } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import { useLocaleChunk, useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { AgentSwatch } from "../AgentSwatch";
import type { SocietyAgent } from "../data";
@@ -48,6 +50,8 @@ export function AgentCardOverlay({
}: AgentCardOverlayProps) {
const t = useT();
useLocaleChunk("society");
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = agent ? societyDisplayName(agent, assistantName) : "";
// The modal keeps a real dialog title plus its close control. The embedded
// workspace hides this row entirely: the left rail already marks the active
// agent and the right rail names it, so the row was a second, boring band.
@@ -63,7 +67,7 @@ export function AgentCardOverlay({
<AgentSwatch agent={agent} size={32} />
<div className="min-w-0 flex-1">
<Title className="truncate font-display text-base font-semibold tracking-tight text-foreground">
- {agent.name}
+ {displayName}
</Title>
<Description className="truncate text-xs text-muted-foreground">
{agent.title}
diff --git a/jarvis/ui/web/frontend/src/components/society/card/AgentProfileDialog.tsx b/jarvis/ui/web/frontend/src/components/society/card/AgentProfileDialog.tsx
index 7f3ff0ed47..2d44608007 100644
--- a/jarvis/ui/web/frontend/src/components/society/card/AgentProfileDialog.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/card/AgentProfileDialog.tsx
@@ -8,6 +8,8 @@ import { Badge } from "@/components/ui/badge";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useLocaleChunk, useT } from "@/i18n";
import { cn } from "@/lib/utils";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { AgentSwatch } from "../AgentSwatch";
import type { SocietyAgent } from "../data";
import { AgentMemoryFiles, LearnedInstructions } from "./AgentKnowledge";
@@ -29,6 +31,8 @@ export function AgentProfileDialog({ agent, sample, onClose }: {
const t = useT();
useLocaleChunk("society");
const client = useQueryClient();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const opener = useRef(document.activeElement instanceof HTMLElement ? document.activeElement : null);
const lead = agent.tier === "lead";
const [title, setTitle] = useState(agent.title);
@@ -82,7 +86,7 @@ export function AgentProfileDialog({ agent, sample, onClose }: {
<header className="flex shrink-0 items-center gap-4 border-b border-border p-6">
<AgentSwatch agent={agent} size={56} />
<div className="min-w-0 flex-1">
- <Dialog.Title className="truncate text-xl font-semibold">{agent.name}</Dialog.Title>
+ <Dialog.Title className="truncate text-xl font-semibold">{displayName}</Dialog.Title>
<Dialog.Description className="mt-1 truncate text-sm text-muted-foreground">{agent.title || t("society.profile_card.subtitle")}</Dialog.Description>
<div className="mt-2 flex flex-wrap gap-2">
<Badge variant="secondary">{t(`society.tier.${agent.tier}`)}</Badge>
@@ -99,7 +103,7 @@ export function AgentProfileDialog({ agent, sample, onClose }: {
</TabsList>
<TabsContent value="profile" className="min-h-0 flex-1 overflow-y-auto px-6 pb-6">
<div className="grid gap-4 sm:grid-cols-2">
- <label className="space-y-1.5 text-sm">{t("society.profile_card.name")}<input className={fieldClass} value={agent.name} readOnly /></label>
+ <label className="space-y-1.5 text-sm">{t("society.profile_card.name")}<input className={fieldClass} value={displayName} readOnly /></label>
<label className="space-y-1.5 text-sm">{t("society.profile_card.role")}<input className={fieldClass} value={title} onChange={(event) => setTitle(event.target.value)} disabled={lead || sample || save.isPending} /></label>
</div>
<div className="mt-5">
diff --git a/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx b/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
index f034d21522..5b76f9141b 100644
--- a/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
@@ -37,7 +37,9 @@ import { ProviderLogo } from "@/components/providers/ProviderLogo";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Switch } from "@/components/ui/switch";
import { useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
import { cn } from "@/lib/utils";
+import { useEventStore } from "@/store/events";
import { AgentRoutinesList } from "./AgentRoutinesList";
import { RetireButton } from "./RetireButton";
@@ -210,6 +212,8 @@ export interface AgentSpecSheetProps {
export function AgentSpecSheet({ agent, onOpenChat, onRetired }: AgentSpecSheetProps) {
const t = useT();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const capabilities = useSocietyCapabilities();
const activity = useAgentActivity(agent.agentId);
const skills = useAgentSkills(agent.agentId);
@@ -265,7 +269,7 @@ export function AgentSpecSheet({ agent, onOpenChat, onRetired }: AgentSpecSheetP
<div className="ac-card" data-testid="agent-card-sheet">
<header className="ac-band" data-tier={agent.tier}>
<span className="min-w-0 flex-1">
- <span className="ac-band-name block truncate">{agent.name}</span>
+ <span className="ac-band-name block truncate">{displayName}</span>
{/* Jarvis' title IS "Lead", so the tier would otherwise read twice. */}
<span className="ac-band-title block truncate">
{[t(`society.tier.${agent.tier}`), agent.title]
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx
index d69b7dd7db..f26d232c9e 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx
@@ -55,6 +55,7 @@ import { VoiceStage } from "@/components/home/VoiceStage";
import { ProviderLogo } from "@/components/providers/ProviderLogo";
import { useT } from "@/i18n";
import { cn } from "@/lib/utils";
+import { societyDisplayName } from "@/lib/societyDisplayName";
import { createAgentChatStore, useAgentChatStore } from "@/store/agentChat";
import type { AgentChatSurface, ApprovalDecision } from "@/lib/agentChatApi";
@@ -144,7 +145,9 @@ export function AgentChatPanel(props: AgentChatPanelProps) {
const disconnect = useCallback(() => {
(props.agent.tier === "lead" ? useAgentChatStore : useSocietyChatStore).getState().disconnect();
}, [props.agent.tier]);
- return <PairConversationBoundary key={props.agent.agentId} recipient={{ id: props.agent.agentId, name: props.agent.name }}>
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(props.agent, assistantName);
+ return <PairConversationBoundary key={props.agent.agentId} recipient={{ id: props.agent.agentId, name: displayName }}>
<RoutineChatHost agentId={props.agent.agentId} onOpen={disconnect}><AgentChatPanelContent {...props} /></RoutineChatHost>
</PairConversationBoundary>;
}
@@ -218,10 +221,11 @@ function SpecialistChat({ agent, roster }: AgentChatPanelProps) {
}
}, [visibleItems, agent.agentId]);
const outgoing = useOutgoingMessages(sessionReady ? agent.agentId : null);
+ const assistantNameForRoster = useEventStore((s) => s.assistantName);
const allItems = useMemo(() => mergeOutgoingMessages(
- visibleItems, outgoing, agent.agentId, agent.name,
- new Map(roster.map((member) => [member.agentId, member.name])),
- ), [visibleItems, outgoing, agent.agentId, agent.name, roster]);
+ visibleItems, outgoing, agent.agentId, societyDisplayName(agent, assistantNameForRoster),
+ new Map(roster.map((member) => [member.agentId, societyDisplayName(member, assistantNameForRoster)])),
+ ), [visibleItems, outgoing, agent, assistantNameForRoster, roster]);
const view = useTranscriptView(sessionReady ? sessionId : null, allItems);
// Open the agent's own session before the browser paints. Waiting on bind /
@@ -642,6 +646,8 @@ export function Transcript({
}) {
const t = useT();
const sessionId = useAgentChat((state) => state.activeSessionId);
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
// Follow the newest while the view sits at the end — the rule every
// conversation surface shares (hooks/useStickToBottom). This used to scroll
// a bottom sentinel into view on `[items.length, busy]` only, so a
@@ -660,7 +666,7 @@ export function Transcript({
return (
<div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-6 text-center">
<AgentSwatch agent={agent} size={56} />
- <p className="text-sm font-medium text-foreground">{t("society.chat.empty_title").replace("{0}", agent.name)}</p>
+ <p className="text-sm font-medium text-foreground">{t("society.chat.empty_title").replace("{0}", displayName)}</p>
<p className="max-w-[32ch] text-xs text-muted-foreground">{t("society.chat.empty_hint")}</p>
</div>
);
@@ -999,6 +1005,8 @@ interface ComposerProps {
export function Composer({ agent, mentionable, busy, sessionId, cwd, provider, surface = "jarvis", onClear, onSend, onCancel }: ComposerProps) {
const t = useT();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const [modelSaving, setModelSaving] = useState(false);
const [value, setValue] = useState("");
const [plusOpen, setPlusOpen] = useState(false);
@@ -1116,7 +1124,7 @@ export function Composer({ agent, mentionable, busy, sessionId, cwd, provider, s
if (named.agents.length > 0 && surface === "society") {
const teammates = named.agents.map((a) => `${JSON.stringify(a.name)} (id ${JSON.stringify(a.agentId)})`).join(", ");
lines.push(
- `${MENTION_MARK} Current sender: the user. Current recipient: ${JSON.stringify(agent.name)} (id ${JSON.stringify(agent.agentId)}). ` +
+ `${MENTION_MARK} Current sender: the user. Current recipient: ${JSON.stringify(displayName)} (id ${JSON.stringify(agent.agentId)}). ` +
`Mentioned teammates: ${teammates}. For teammate contact requested by the user, use society_message_agent; ` +
"use kind 'query' when asking for information. If a work assignment is needed, contact Jarvis or an orchestrator with that tool. " +
"Reply to the user here. An @mention or prose addressed to a teammate does not deliver a message.",
@@ -1245,7 +1253,7 @@ export function Composer({ agent, mentionable, busy, sessionId, cwd, provider, s
</div>
<ComposerChipField
ref={fieldRef}
- placeholder={t("society.chat.placeholder").replace("{0}", agent.name)}
+ placeholder={t("society.chat.placeholder").replace("{0}", displayName)}
disabled={false}
onSubmit={() => void submit()}
onDraftChange={onDraftChange}
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx b/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx
index e1a0550861..02c1c83463 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx
@@ -4,6 +4,8 @@ import { ChatMarkdown } from "@/components/agentchat/ChatMarkdown";
import { useOpenPairConversation } from "@/components/agentchat/PairConversation";
import type { InternalMessageItem } from "@/components/agentchat/reduce";
import { useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { cn } from "@/lib/utils";
import { AgentSwatch } from "../AgentSwatch";
import type { SocietyAgent } from "../data";
@@ -40,10 +42,11 @@ export function RoutineActivity({ task, original, onOpen }: { task: string; orig
export function AgentMessageActivity({ item, roster }: { item: InternalMessageItem; roster: SocietyAgent[] }) {
const t = useT();
const openPair = useOpenPairConversation();
+ const assistantName = useEventStore((s) => s.assistantName);
const outgoing = Boolean(item.outgoing);
const id = item.outgoing?.recipientId ?? item.message.sender_id;
const participant = roster.find(agent => agent.agentId === id);
- const name = participant?.name || item.outgoing?.recipientName || item.message.sender_name;
+ const name = participant ? societyDisplayName(participant, assistantName) : (item.outgoing?.recipientName || item.message.sender_name);
const status = item.message.status;
const failed = status === "failed";
const canOpenPair = Boolean(openPair && id && id !== "user" && item.message.sender_kind !== "user");
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/AgentAppearanceDialog.tsx b/jarvis/ui/web/frontend/src/components/society/companion/AgentAppearanceDialog.tsx
index e20b1b80ce..07a434ac61 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/AgentAppearanceDialog.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/companion/AgentAppearanceDialog.tsx
@@ -3,6 +3,8 @@ import * as Dialog from "@radix-ui/react-dialog";
import { useQueryClient } from "@tanstack/react-query";
import { X } from "lucide-react";
import { useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { Button } from "@/components/ui/button";
import type { SocietyAgent } from "../data";
import { AgentSwatch } from "../AgentSwatch";
@@ -49,6 +51,8 @@ function CharacterEditor({ value, onChange, disabled, lead }: { value: FigureRec
export function AgentAppearanceDialog({ agent, sample, onClose }: { agent: SocietyAgent; sample: boolean; onClose: () => void }) {
const t = useT();
const client = useQueryClient();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const [recipe, setRecipe] = useState<FigureRecipe>(() => ({ ...(agent.figure ?? defaultRecipe()), companion: resolveCompanion(agent.agentId, agent.figure?.companion) }));
const [saved, setSaved] = useState(() => JSON.stringify(recipe));
const [tab, setTab] = useState<"character" | "companion">("companion");
@@ -71,7 +75,7 @@ export function AgentAppearanceDialog({ agent, sample, onClose }: { agent: Socie
return <Dialog.Root open onOpenChange={open => { if (!open) close(); }}><Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 z-50 bg-scrim/60 backdrop-blur-sm" />
<Dialog.Content data-testid="agent-appearance-dialog" onCloseAutoFocus={e => { e.preventDefault(); opener.current?.focus(); }} className="fixed left-1/2 top-1/2 z-50 flex max-h-[90dvh] w-[min(640px,calc(100vw-24px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-popover text-foreground shadow-float">
- <header className="flex items-center gap-3 border-b border-border p-4"><AgentSwatch agent={{ ...agent, figure: recipe }} size={48} /><div className="flex-1"><Dialog.Title className="font-semibold">{agent.name}</Dialog.Title><Dialog.Description className="text-sm text-muted-foreground">{t("society.companion.appearance")}</Dialog.Description></div><button aria-label={t("society.card.close")} onClick={close} className="rounded p-2 hover:bg-secondary"><X size={18} /></button></header>
+ <header className="flex items-center gap-3 border-b border-border p-4"><AgentSwatch agent={{ ...agent, figure: recipe }} size={48} /><div className="flex-1"><Dialog.Title className="font-semibold">{displayName}</Dialog.Title><Dialog.Description className="text-sm text-muted-foreground">{t("society.companion.appearance")}</Dialog.Description></div><button aria-label={t("society.card.close")} onClick={close} className="rounded p-2 hover:bg-secondary"><X size={18} /></button></header>
<div className="flex shrink-0 gap-2 border-b border-border p-3" role="tablist" aria-label={t("society.companion.appearance")}>{(["character", "companion"] as const).map(value => <button key={value} type="button" role="tab" aria-selected={tab === value} onClick={() => setTab(value)} className={`rounded-md px-3 py-2 text-sm ${tab === value ? "bg-secondary text-foreground" : "text-muted-foreground"}`}>{t(`society.companion.${value}`)}</button>)}</div>
<div className="min-h-0 overflow-y-auto">{tab === "character" ? <CharacterEditor value={recipe} onChange={setRecipe} disabled={saving || sample} lead={agent.tier === "lead"} /> : <CompanionEditor value={resolveCompanion(agent.agentId, recipe.companion)} onChange={companion => setRecipe(r => ({ ...r, companion }))} disabled={saving || sample} lead={agent.tier === "lead"} />}</div>
<footer className="flex shrink-0 flex-wrap justify-end gap-2 border-t border-border p-4">
diff --git a/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.test.tsx b/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.test.tsx
index 58f3d8c0ac..4158cb47f6 100644
--- a/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.test.tsx
@@ -4,6 +4,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
import type { SocietyAgent } from "@/components/society/data";
import { useRetireStore } from "@/components/society/world/retireStore";
+import { useEventStore } from "@/store/events";
import { RosterRail } from "./RosterRail";
vi.mock("@/i18n", () => ({ useT: () => (key: string) => key }));
@@ -13,6 +14,7 @@ afterEach(() => {
cleanup();
localStorage.clear();
vi.unstubAllGlobals();
+ useEventStore.setState({ assistantName: "Assistant" });
});
function agent(over: Partial<SocietyAgent> & Pick<SocietyAgent, "agentId" | "name">): SocietyAgent {
@@ -348,3 +350,31 @@ describe("RosterRail press-drag", () => {
expect(rowOf("A").className).toContain("cursor-grab");
});
});
+
+describe("RosterRail lead display name", () => {
+ const renderRail = (agents: SocietyAgent[]) => {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } });
+ return render(<QueryClientProvider client={client}>
+ <RosterRail {...baseProps} agents={agents} activeAgentId={null} />
+ </QueryClientProvider>);
+ };
+
+ it("shows the wake-word name for the lead instead of the backend name", () => {
+ useEventStore.setState({ assistantName: "Hanna" });
+ renderRail([agent({ agentId: "jarvis", name: "Jarvis", tier: "lead", title: "Lead" })]);
+ expect(screen.getByTestId("society-lead-hero")).toBeTruthy();
+ expect(screen.getByText("Hanna")).toBeTruthy();
+ expect(screen.queryByText("Jarvis")).toBeNull();
+ });
+
+ it("finds the lead by display name and by stored name", () => {
+ useEventStore.setState({ assistantName: "Hanna" });
+ const lead = agent({ agentId: "jarvis", name: "Jarvis", tier: "lead", title: "Lead" });
+ const { unmount } = renderRail([lead]);
+ fireEvent.change(screen.getByRole("searchbox"), { target: { value: "hanna" } });
+ expect(screen.getByText("Hanna")).toBeTruthy();
+ fireEvent.change(screen.getByRole("searchbox"), { target: { value: "jarvis" } });
+ expect(screen.getByText("Hanna")).toBeTruthy();
+ unmount();
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.tsx b/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.tsx
index bf0df5c81e..726637d865 100644
--- a/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/roster/RosterRail.tsx
@@ -27,7 +27,9 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area";
import { useT } from "@/i18n";
+import { societyDisplayName } from "@/lib/societyDisplayName";
import { cn } from "@/lib/utils";
+import { useEventStore } from "@/store/events";
import { AgentSwatch } from "../AgentSwatch";
import type { AgentRunState, SocietyAgent } from "../data";
@@ -111,6 +113,9 @@ export function RosterRail({
const profile = agents.find((agent) => agent.agentId === profileId);
const menuAgent = agents.find((agent) => agent.agentId === menu?.agentId);
const unread = useRosterUnread(agents, activeAgentId);
+ // The lead's visible name follows the wake word (e.g. "Hanna" for
+ // "Hey Hanna"); every other agent keeps its roster name.
+ const assistantName = useEventStore((s) => s.assistantName);
const setHidden = useCallback((agentId: string, hidden: boolean) => {
setHiddenIds((current) => {
@@ -130,10 +135,14 @@ export function RosterRail({
const { leadVisible, rows } = useMemo(() => {
const q = query.trim().toLowerCase();
- const filtered = agents.filter((a) =>
- (showHidden || !hiddenIds.includes(a.agentId)) &&
- (!q || `${a.name} ${a.title}`.toLowerCase().includes(q)),
- );
+ const filtered = agents.filter((a) => {
+ if (!showHidden && hiddenIds.includes(a.agentId)) return false;
+ if (!q) return true;
+ // The lead is shown under the wake-word name, so the search matches
+ // both the display name and the stored roster name.
+ const display = societyDisplayName(a, assistantName);
+ return `${a.name} ${display} ${a.title}`.toLowerCase().includes(q);
+ },);
const masterVisible = lead ? filtered.some((a) => a.agentId === lead.agentId) : false;
// Orchestrators, then specialists; stable within a tier. The lead lives
// in its own centered hero above and never repeats in the list.
@@ -157,7 +166,7 @@ export function RosterRail({
return rank[a.tier] - rank[b.tier];
});
return { leadVisible: masterVisible, rows: rest };
- }, [agents, hiddenIds, lead, orderIds, query, showHidden]);
+ }, [agents, assistantName, hiddenIds, lead, orderIds, query, showHidden]);
// While searching, the list is a filtered excerpt — dragging there would
// file agents by where they happen to sit in the excerpt, so rows stay put.
@@ -510,7 +519,7 @@ export function RosterRail({
lead.agentId === activeAgentId && "bg-secondary",
)}
>
- <button type="button" onClick={() => openProfile(lead.agentId)} aria-label={t("society.profile_card.open").replace("{0}", lead.name)} className="relative rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <button type="button" onClick={() => openProfile(lead.agentId)} aria-label={t("society.profile_card.open").replace("{0}", societyDisplayName(lead, assistantName))} className="relative rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
<AgentSwatch agent={lead} size={56} />
{lead.state === "working" ? (
<span
@@ -530,7 +539,7 @@ export function RosterRail({
) : null}
</button>
<button type="button" onClick={() => openAgent(lead.agentId)} aria-current={lead.agentId === activeAgentId ? "true" : undefined} className="flex max-w-full items-center justify-center gap-1.5 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
- <span className="truncate text-sm font-medium text-foreground">{lead.name}</span>
+ <span className="truncate text-sm font-medium text-foreground">{societyDisplayName(lead, assistantName)}</span>
<Badge variant="secondary" className="shrink-0 px-1.5 py-0 text-xs">
{t("society.tier.lead")}
</Badge>
diff --git a/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx b/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
index be3ea3e534..114b4b0211 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
@@ -15,6 +15,8 @@ import type { Group } from "three";
import { AgentFollower } from "../companion/AgentFollower";
import { resolveCompanion } from "../companion/appearance";
import type { AgentCheckpoint, AgentRunState, SocietyAgent } from "../data";
+import { societyDisplayName } from "@/lib/societyDisplayName";
+import { useEventStore } from "@/store/events";
import { useBuildingPoses } from "./buildingPoses";
import { useCameraStore } from "./cameraStore";
import {
@@ -152,6 +154,8 @@ function Walker({
const anim = useRef<WalkerAnim>({ mode: "rest", speed: 0 });
const gl = useThree((s) => s.gl);
const [hover, setHover] = useState(false);
+ const assistantName = useEventStore((s) => s.assistantName);
+ const displayName = societyDisplayName(agent, assistantName);
const offset = useMemo(() => lateralOffset(agent.agentId), [agent.agentId]);
/** The building-pose generation this walker last planned against. */
const poseGen = useRef(useBuildingPoses.getState().generation);
@@ -276,7 +280,7 @@ function Walker({
x: staged.x,
z: staged.z,
color: agent.palette.accent,
- name: agent.name,
+ name: displayName,
});
return;
}
@@ -365,7 +369,7 @@ function Walker({
anim.current.mode = s.mode;
g.position.set(s.x, s.y, s.z);
g.rotation.y = s.heading;
- setWalkerPin(agent.agentId, { x: s.x, z: s.z, color: agent.palette.accent, name: agent.name });
+ setWalkerPin(agent.agentId, { x: s.x, z: s.z, color: agent.palette.accent, name: displayName });
});
useEffect(() => {
@@ -397,7 +401,7 @@ function Walker({
<Html position={[0, (agent.figure ? (agent.figure.heightM ?? 1.75) * WORLD_HERO_SCALE : 2.0) + 0.35, 0]} center zIndexRange={[30, 10]} style={{ pointerEvents: "none" }}>
<div className="sw-nameplate" data-state={agent.state} data-selected={selected || undefined}>
<span className="sw-nameplate-dot" style={{ background: agent.palette.accent }} />
- {agent.name}
+ {displayName}
</div>
</Html>
</group>
diff --git a/jarvis/ui/web/frontend/src/lib/societyDisplayName.test.ts b/jarvis/ui/web/frontend/src/lib/societyDisplayName.test.ts
new file mode 100644
index 0000000000..3b817da9dc
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/societyDisplayName.test.ts
@@ -0,0 +1,26 @@
+/**
+ * The society lead follows the wake-word-derived assistant name for ANY
+ * name — never a hardcoded product name. Specialists keep their roster name.
+ */
+import { describe, expect, it } from "vitest";
+
+import { societyDisplayName } from "./societyDisplayName";
+
+describe("societyDisplayName", () => {
+ it("shows the wake-word name for the lead (wake-word agnostic)", () => {
+ for (const name of ["Hanna", "Ruben", "Athena", "Nova", "Computer"]) {
+ expect(societyDisplayName({ tier: "lead", name: "Jarvis" }, name)).toBe(name);
+ }
+ });
+
+ it("falls back to the neutral name — never the backend name", () => {
+ expect(societyDisplayName({ tier: "lead", name: "Jarvis" }, "")).toBe("Assistant");
+ expect(societyDisplayName({ tier: "lead", name: "Jarvis" }, " ")).toBe("Assistant");
+ expect(societyDisplayName({ tier: "lead", name: "Jarvis" }, "")).not.toBe("Jarvis");
+ });
+
+ it("keeps the roster name for specialists and orchestrators", () => {
+ expect(societyDisplayName({ tier: "specialist", name: "Scout" }, "Hanna")).toBe("Scout");
+ expect(societyDisplayName({ tier: "orchestrator", name: "Planner" }, "Hanna")).toBe("Planner");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/lib/societyDisplayName.ts b/jarvis/ui/web/frontend/src/lib/societyDisplayName.ts
new file mode 100644
index 0000000000..ad4ee5a5f5
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/societyDisplayName.ts
@@ -0,0 +1,47 @@
+/**
+ * Display name for society agents — the lead follows the wake word.
+ *
+ * The backend roster keeps the lead's internal identity as "jarvis"
+ * (LEAD_AGENT_ID, session id `society:jarvis`, avatar, rules). The name the
+ * person sees, however, is the wake-word-derived assistant name from the
+ * global store (e.g. "Hanna" for "Hey Hanna", "Assistant" when nothing is
+ * configured). Every other agent keeps its roster name.
+ *
+ * Internal identifiers (files, classes, i18n keys, agent ids) keep their
+ * existing naming; only display strings go through this helper — the same
+ * split as `lib/agentBrand.ts`.
+ */
+import { useEventStore } from "@/store/events";
+
+import { NEUTRAL_ASSISTANT_NAME } from "./assistantNameCache";
+
+export interface SocietyDisplayAgent {
+ tier?: string | null;
+ name: string;
+}
+
+export function societyDisplayName(
+ agent: SocietyDisplayAgent,
+ assistantName: string,
+): string {
+ if (agent.tier === "lead") {
+ const trimmed = (assistantName || "").trim();
+ return trimmed || NEUTRAL_ASSISTANT_NAME;
+ }
+ return agent.name;
+}
+
+/**
+ * Reactive hook form — re-renders when the wake-word name changes, so the
+ * lead hero live-updates after a wake-word save like every other `{name}`
+ * string.
+ */
+export function useSocietyDisplayName(agent: SocietyDisplayAgent): string {
+ const assistantName = useEventStore((s) => s.assistantName);
+ return societyDisplayName(agent, assistantName);
+}
+
+/** Imperative form for non-render contexts (toasts, event handlers). */
+export function societyDisplayNameNow(agent: SocietyDisplayAgent): string {
+ return societyDisplayName(agent, useEventStore.getState().assistantName);
+}