Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(spawn): let Michael choose a worker's avatar and accent

Chaitanya Giri0bc551687ba8
diff --git a/src/main/hive.ts b/src/main/hive.ts
index fd63f718..ee702ee8 100644
--- a/src/main/hive.ts
+++ b/src/main/hive.ts
@@ -2397,7 +2397,9 @@ the hive root:
"model": "model override (optional)",
"isolate": true,
"tokenCap": 0,
- "slack": { "channel": "C…", "thread_ts": "…" }
+ "slack": { "channel": "C…", "thread_ts": "…" },
+ "character": "meredith",
+ "accent": "coral"
}
\`\`\`
@@ -2407,6 +2409,10 @@ defaults to true, giving the worker its own git worktree. \`slack\` routes its f
thread. This is the ONLY spawn route you can complete on your own: a hire manifest under
\`research/hires/\` needs the human to confirm it in the UI.
+\`character\` and \`accent\` set how the worker looks on the office floor, and both are optional.
+Naming a worker after a cast member already gets you that avatar, so you only need \`character\` when
+the name and the face should differ. An unrecognised value falls back rather than failing the spawn.
+
**It can be switched off.** The operator controls this under Settings → Autonomy & Budgets, and it is
OFF by default, because every worker you start spends tokens nobody approved. While it is off your
request is NOT failed or deleted, it waits in \`spawn-requests/\` and runs if the operator turns it on.
diff --git a/src/main/index.ts b/src/main/index.ts
index 7d3ce681..e720ce23 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -4305,6 +4305,17 @@ interface SpawnRequest {
slack?: { channel: string; thread_ts: string }; // reply target + where failures surface
isolate?: boolean; // default true (fresh worktree)
tokenCap?: number; // optional per-worker token cap (advisory P1)
+ // Appearance on the office floor. Both optional and both validated renderer-side
+ // against the real cast and accent lists, so a bad value degrades to the default
+ // rather than breaking the card.
+ //
+ // Naming a worker after a cast member ALREADY gets you their avatar: the floor
+ // card infers it from the name. These two exist for the case that inference
+ // cannot express, an agent called something else that should still look like a
+ // particular character, and picking the accent instead of taking the one hashed
+ // from the worker id.
+ character?: string;
+ accent?: string;
}
/** Polling cadence — matches the hive router. */
@@ -4475,7 +4486,9 @@ async function processSpawnRequest(filePath: string): Promise<void> {
cwd: res.worktreePath ?? cwd,
command: launch.command,
role: meta.role,
- worktreePath: res.worktreePath
+ worktreePath: res.worktreePath,
+ character: typeof raw.character === 'string' ? raw.character : undefined,
+ accent: typeof raw.accent === 'string' ? raw.accent : undefined
});
} catch { /* window torn down */ }
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 5bbd0376..8e35015d 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -869,6 +869,7 @@ const api = {
cb: (rec: {
id: string; name: string; provider?: string; cwd: string;
command?: string; role?: string; worktreePath?: string;
+ character?: string; accent?: string;
}) => void
): (() => void) => {
const listener = (_e: IpcRendererEvent, payload: Parameters<typeof cb>[0]) => cb(payload);
diff --git a/src/renderer/src/hooks/useHive.ts b/src/renderer/src/hooks/useHive.ts
index 139fbd85..5e10fbca 100644
--- a/src/renderer/src/hooks/useHive.ts
+++ b/src/renderer/src/hooks/useHive.ts
@@ -997,10 +997,21 @@ export function useHive(config: HarnessConfig | null): void {
if (!rec?.id) return;
// addAgent is idempotent, but bail early if the renderer already carded it.
if (useStore.getState().agents.some((a) => a.id === rec.id)) return;
- const key = (rec.name || rec.id).toLowerCase();
+ // An explicit character wins; otherwise infer it from the name, which is
+ // what makes "spawn one called Meredith" land on the Meredith avatar with
+ // nothing else asked for. The explicit field covers what inference cannot
+ // express: an agent named something else that should still look like a
+ // particular character. Unknown values fall through to the inference rather
+ // than breaking the card.
+ const castMember = (q?: string) =>
+ q ? OFFICE_CAST.find((m) => m.name === q || m.displayName.toLowerCase() === q)?.name : undefined;
const character =
- OFFICE_CAST.find((m) => m.name === key || m.displayName.toLowerCase() === key)?.name ??
+ castMember(rec.character?.trim().toLowerCase()) ??
+ castMember((rec.name || rec.id).toLowerCase()) ??
DEFAULT_CHARACTER;
+ // Accent is otherwise hashed from the worker id, which is stable but not
+ // choosable. An unrecognised accent keeps the hash.
+ const askedAccent = SPAWN_ACCENTS.find((a) => a === rec.accent?.trim().toLowerCase());
let h = 0;
for (const ch of rec.id) h = (h + ch.charCodeAt(0)) % SPAWN_ACCENTS.length;
const project = (rec.cwd || '').split(/[\\/]/).filter(Boolean).pop() || 'hive';
@@ -1008,7 +1019,7 @@ export function useHive(config: HarnessConfig | null): void {
id: rec.id,
name: rec.name || rec.id,
character,
- accent: SPAWN_ACCENTS[h],
+ accent: askedAccent ?? SPAWN_ACCENTS[h],
description: rec.role || 'a fresh harness',
project,
tmuxTarget: '',