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
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
revert(agents): drop the rename feature
Vyapak Goyalff12278ad9de
diff --git a/src/main/hive.ts b/src/main/hive.tsindex e9d2b1c7..ff2551fa 100644--- a/src/main/hive.ts+++ b/src/main/hive.ts@@ -436,63 +436,6 @@ export class HiveManager {} catch { /* best-effort — never crash a lifecycle handler */ }}- /**- * Rename an agent, keeping its id. The id is the identity everything else is- * keyed on — workspace directory, inbox, memory.md, task assignees — so a- * rename is purely cosmetic and nothing has to be migrated. Only the registry- * (which feeds the roster other agents read) needs updating, plus the identity- * card so the agent itself knows what it is now called. Best-effort; returns- * whether anything changed.- */- rename(id: string, name: string): boolean {- const root = this.root();- if (!root) return false;- const next = name.trim();- if (!next) return false;- try {- const reg = this.registry();- const agent = reg.agents[id];- if (!agent) return false;- // Already called that ⇒ nothing to do, but the CALLER asked for a state,- // not an edit, and that state holds. Reporting false here made a no-op- // rename indistinguishable from a failed one at the IPC boundary.- if (agent.name === next) return true;- const previous = agent.name;- agent.name = next;- agent.lastSeen = Date.now();- this.writeJson(join(root, 'registry.json'), reg);- // Refresh the identity card so the agent's own prompt stops calling it by- // the old name. Written on every spawn anyway, but a rename shouldn't have- // to wait for a restart to take effect.- try {- const dir = join(root, 'agents', id);- if (existsSync(dir)) writeFileSync(join(dir, 'identity.md'), this.identityText(agent), 'utf8');- } catch { /* identity refresh is best-effort */ }- this.appendLog({ kind: 'rename', agentId: id, name: next, previous });- this.commit(`hive: rename ${id} → ${next}`);- // A RUNNING agent was told its name in the system prompt injected at spawn,- // and in AGENT_NAME — neither of which can be rewritten under a live- // process. Rewriting identity.md alone leaves it introducing itself by the- // old name until it restarts, and nothing would ever tell it to reread the- // file. Mail is the one channel a running agent already drains, so use it.- try {- this.send({- to: id,- act: 'inform',- subject: `You are now called ${next}`,- body: [- `You have been renamed from "${previous}" to "${next}".`,- 'Your agent id is unchanged, so your workspace, inbox, memory and task assignments all stay exactly as they are — nothing to migrate.',- 'Use the new name from now on. Your identity.md has been updated; the name in your original system prompt is stale.'- ].join(' ')- }, 'system');- } catch { /* the rename itself succeeded; the courtesy note is best-effort */ }- return true;- } catch {- return false; // best-effort — never crash a lifecycle handler- }- }-/*** Persist the agent's Claude Code session_id (Lane A #6.6a). Captured from hook* payloads; written only when it actually changes (a new session), so this is adiff --git a/src/main/index.ts b/src/main/index.tsindex a1e14db1..36eac6eb 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -1987,25 +1987,6 @@ ipcMain.handle('hive:setArchived', (_evt, id: unknown, archived: unknown) => {return { ok: true };});-// Rename an agent. Cosmetic only — the agent id stays put, so its workspace,-// inbox, memory and any task assigned to it are untouched.-ipcMain.handle('hive:rename', (_evt, id: unknown, name: unknown) => {- if (typeof id !== 'string' || typeof name !== 'string') {- return { ok: false, error: 'invalid id or name' };- }- const next = name.trim();- if (!next) return { ok: false, error: 'name cannot be empty' };- if (next.length > 40) return { ok: false, error: 'name is too long (max 40)' };- if (!hive.enabled()) return { ok: false, error: 'hive disabled (no harnessHome)' };- // Propagate the outcome. Swallowing a false here let the UI keep a name the- // registry had rejected, so the roster every SIBLING agent reads still had the- // old one — two names for one agent, with nothing on screen to say so.- if (!hive.rename(id, next)) {- return { ok: false, error: 'no such agent in the hive registry, or the registry could not be written' };- }- return { ok: true };-});-// ─── IPC: semantic memory (MemPalace CLI) ───────────────────────────────────ipcMain.handle('hive:memoryStatus', () => { memory.resetBinCache(); return memory.status(); });ipcMain.handle('hive:searchMemory', (_evt, query: unknown, wing: unknown) => {diff --git a/src/preload/index.ts b/src/preload/index.tsindex 69e42790..ff832f6a 100644--- a/src/preload/index.ts+++ b/src/preload/index.ts@@ -719,10 +719,6 @@ const api = {* archives it automatically via pty:kill; this is the explicit primitive. */hiveSetArchived: (id: string, archived: boolean): Promise<{ ok: boolean; error?: string }> =>ipcRenderer.invoke('hive:setArchived', id, archived),- /** Rename an agent in the hive registry. The agent id is unchanged, so its- * workspace, inbox, memory and task assignments all follow the rename. */- hiveRename: (id: string, name: string): Promise<{ ok: boolean; error?: string }> =>- ipcRenderer.invoke('hive:rename', id, name),// ─── Slack integration (Slack message → Michael's queue) ─────────────────────/** Register a listener for inbound Slack messages; returns an unsubscribe fn.diff --git a/src/renderer/src/components/FullscreenTerminal.tsx b/src/renderer/src/components/FullscreenTerminal.tsxindex bd0ee063..e7195043 100644--- a/src/renderer/src/components/FullscreenTerminal.tsx+++ b/src/renderer/src/components/FullscreenTerminal.tsx@@ -137,7 +137,6 @@ export function FullscreenTerminal({ config }: FullscreenTerminalProps) {const setAddAgentOpen = useStore(s => s.setAddAgentOpen);const addAgentOpen = useStore(s => s.addAgentOpen);const setAgentNote = useStore(s => s.setAgentNote);- const renameAgent = useStore(s => s.renameAgent);const updateAgent = useStore(s => s.updateAgent);// The floor strip (and with it the restore button) is hidden behind the// overlay, so the roster carries restore too.@@ -289,7 +288,6 @@ export function FullscreenTerminal({ config }: FullscreenTerminalProps) {active={a.id === agent.id}onClick={() => { select(a.id); setFullscreen(a.id); }}onNoteChange={(note) => setAgentNote(a.id, note)}- onRename={(name) => renameAgent(a.id, name)}drag={drag}scale={scale}/>@@ -326,7 +324,6 @@ export function FullscreenTerminal({ config }: FullscreenTerminalProps) {active={a.id === agent.id}onClick={() => { select(a.id); setFullscreen(a.id); }}onNoteChange={(note) => setAgentNote(a.id, note)}- onRename={(name) => renameAgent(a.id, name)}drag={drag}scale={scale}/>@@ -455,7 +452,6 @@ function SidebarRow({active,onClick,onNoteChange,- onRename,drag,scale}: {@@ -463,7 +459,6 @@ function SidebarRow({active: boolean;onClick: () => void;onNoteChange: (note: string) => void;- onRename: (name: string) => void;drag: RowDrag;scale: ReturnType<typeof rosterScale>;}) {@@ -480,22 +475,12 @@ function SidebarRow({const noteWidth = Math.min(300, Math.round(noteFontSize * 20));const noteHeight = Math.round(noteFontSize * 9);// Total popover height, used only to keep it on screen near the bottom edge:- // the note textarea plus the name field, two labels, the hint and the padding.- const popoverHeight = noteHeight + Math.round(noteFontSize * 1.9) + noteLabelSize * 3 + 48;+ // the note textarea plus its label, the hint and the padding.+ const popoverHeight = noteHeight + noteLabelSize * 2 + 40;// One line of the note = one bullet on the row.const bullets = (agent.note ?? '').split('\n').map(s => s.trim()).filter(Boolean);- // Rename is local-until-committed: typing straight into the store would rename- // the agent on every keystroke and write the registry each time.- const [draftName, setDraftName] = useState(agent.name);- useEffect(() => { setDraftName(agent.name); }, [agent.name]);- const commitName = () => {- const next = draftName.trim();- if (!next || next === agent.name) { setDraftName(agent.name); return; }- onRename(next);- };-useEffect(() => () => {if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);}, []);@@ -637,45 +622,6 @@ function SidebarRow({boxSizing: 'border-box'}}>- {/* Rename lives here rather than on the row: the row is a <button>,- and an input nested inside one swallows its own clicks. */}- <div style={{- marginBottom: 3,- fontFamily: 'var(--cth-font-display)',- fontSize: noteLabelSize,- lineHeight: `${Math.round(noteLabelSize * 1.5)}px`,- color: 'var(--cth-ink-700)'- }}>NAME</div>- <input- value={draftName}- onChange={(e) => setDraftName(e.target.value)}- onFocus={() => {- if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);- }}- // Commit on blur as well as Enter — a rename typed and then clicked- // away from should not be silently discarded.- onBlur={() => { commitName(); scheduleClose(); }}- onKeyDown={(e) => {- e.stopPropagation();- if (e.key === 'Enter') { e.preventDefault(); commitName(); }- // Escape abandons the edit and restores the current name.- if (e.key === 'Escape') { setDraftName(agent.name); setNotePosition(null); }- }}- aria-label={`Rename ${agent.name}`}- maxLength={40}- style={{- width: '100%',- height: Math.round(noteFontSize * 1.9),- marginBottom: 8,- padding: '2px 8px',- border: 'none', outline: 'none', boxSizing: 'border-box',- background: 'var(--cth-cream-100)',- boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)',- fontFamily: 'var(--cth-font-mono)',- fontSize: noteFontSize,- color: 'var(--cth-ink-900)'- }}- /><div style={{marginBottom: 6,fontFamily: 'var(--cth-font-display)',diff --git a/src/renderer/src/store/store.ts b/src/renderer/src/store/store.tsindex f3f830fd..05d43e56 100644--- a/src/renderer/src/store/store.ts+++ b/src/renderer/src/store/store.ts@@ -149,10 +149,6 @@ interface State {select: (id: string) => void;updateAgent: (id: string, patch: Partial<Agent>) => void;setAgentNote: (id: string, note: string) => void;- /** Rename an agent everywhere it is shown, and in the hive registry so its- * siblings and its own identity card agree. The agent id never changes — it- * is what the workspace, inbox, memory and task assignees are keyed on. */- renameAgent: (id: string, name: string) => void;pushFeed: (id: string, line: string) => void;addAgent: (agent: Agent) => void;removeAgent: (id: string) => void;@@ -382,7 +378,7 @@ function newQueuedId(): string {return `q-${Date.now()}-${queuedSeq}`;}-export const useStore = create<State>((set, get) => ({+export const useStore = create<State>((set) => ({agents: initialAgents,archivedAgents: initialArchivedAgents,restorableAgents: initialRestorableAgents,@@ -411,32 +407,6 @@ export const useStore = create<State>((set, get) => ({persistAgents(agents, s.selectedId);return { agents };}),- renameAgent: (id, name) => {- const next = name.trim();- if (!next) return;- const applyName = (value: string): void => {- set((s) => {- const agents = s.agents.map((a) => a.id === id ? { ...a, name: value } : a);- // Restorable entries carry their own copy of the roster; rename there too- // or a restart would resurrect the agent under its old name.- const restorable = s.restorableAgents.map((a) => a.id === id ? { ...a, name: value } : a);- persistAgents(agents, s.selectedId);- persistRestorable(restorable);- return { agents, restorableAgents: restorable };- });- };- const previous = get().agents.find((a) => a.id === id)?.name- ?? get().restorableAgents.find((a) => a.id === id)?.name;- applyName(next);- // The registry is the roster every OTHER agent reads. If it refuses the- // rename there is no such thing as a local-only success — keeping the new- // name here would mean this agent answers to two different names depending- // on who is asking. Put it back and let the user see the rename didn't take.- const rollBack = (): void => { if (previous !== undefined) applyName(previous); };- void window.cth.hiveRename(id, next)- .then((res) => { if (!res?.ok) rollBack(); })- .catch(rollBack);- },pushFeed: (id, line) =>set((s) => ({ feeds: { ...s.feeds, [id]: [...(s.feeds[id] ?? []), line] } })),addAgent: (agent) =>