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: settings reset, boot loader, lingering god + quit-crash fix (0.1.3)

Chaitanya Giri366f7e3cc45b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d855e758..fb6df60f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,24 @@ All notable changes to this project are documented here. The format is based on
## [Unreleased]
+## [0.1.3] — 2026-06-01
+
+### Added
+- **Settings panel** (title-bar gear) with a **Reset & start over** action that wipes
+ Michael's memories, the entire hive (every agent, message, task, and the board), and
+ the semantic-memory palace, then relaunches the app into onboarding.
+- Boot loader ("clocking in") shown while the GOD agent initializes, so returning users
+ no longer see the empty "add agent" screen during startup.
+
+### Fixed
+- Crash dialog on quit caused by sending IPC to an already-destroyed window during
+ teardown; all renderer sends are now destroyed-safe and shutdown steps are best-effort.
+- Michael no longer marches to the door flagged "needs you" right after finishing a turn —
+ idle "waiting for input" notifications now let him linger at his desk instead of
+ escalating as a blocked/needs-action state.
+
+## [Brand & rename]
+
### Added
- Brand identity: **Munder Difflin** — logo (`docs/logo.svg`), square mark
(`docs/logo-mark.svg`), and hero banner (`docs/banner.svg`).
diff --git a/RELEASE.md b/RELEASE.md
index 00e648c4..4bd9258a 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -1,4 +1,4 @@
-# Munder Difflin v0.1.2
+# Munder Difflin v0.1.3
**A local hive of Claude Code agents that run themselves** — messaging, routing, and
remembering, coordinated by a GOD orchestrator you talk to. Local-first and open source.
@@ -15,22 +15,22 @@ Apple Silicon and Intel.
### 🍎 macOS
| Build | File |
|---|---|
-| Universal (Apple Silicon + Intel) | [`Munder-Difflin-0.1.2-mac-universal.dmg`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.2-mac-universal.dmg) |
+| Universal (Apple Silicon + Intel) | [`Munder-Difflin-0.1.3-mac-universal.dmg`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.3-mac-universal.dmg) |
### 🪟 Windows
| Build | File |
|---|---|
-| Installer (x64) — *recommended* | [`Munder-Difflin-0.1.2-win-x64-setup.exe`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.2-win-x64-setup.exe) |
-| Portable (x64, no install) | [`Munder-Difflin-0.1.2-win-x64-portable.exe`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.2-win-x64-portable.exe) |
+| Installer (x64) — *recommended* | [`Munder-Difflin-0.1.3-win-x64-setup.exe`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.3-win-x64-setup.exe) |
+| Portable (x64, no install) | [`Munder-Difflin-0.1.3-win-x64-portable.exe`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.3-win-x64-portable.exe) |
### 🐧 Linux
| Build | File |
|---|---|
-| AppImage (x86_64) | [`Munder-Difflin-0.1.2-linux-x86_64.AppImage`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.2-linux-x86_64.AppImage) |
+| AppImage (x86_64) | [`Munder-Difflin-0.1.3-linux-x86_64.AppImage`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/Munder-Difflin-0.1.3-linux-x86_64.AppImage) |
### 📦 Source
-[Source code (zip)](https://github.com/chaitanyagiri/munder-difflin/archive/refs/tags/v0.1.2.zip) ·
-[Source code (tar.gz)](https://github.com/chaitanyagiri/munder-difflin/archive/refs/tags/v0.1.2.tar.gz)
+[Source code (zip)](https://github.com/chaitanyagiri/munder-difflin/archive/refs/tags/v0.1.3.zip) ·
+[Source code (tar.gz)](https://github.com/chaitanyagiri/munder-difflin/archive/refs/tags/v0.1.3.tar.gz)
> **Verify your download:** [`SHA256SUMS.txt`](https://github.com/chaitanyagiri/munder-difflin/releases/latest/download/SHA256SUMS.txt) — then `shasum -a 256 -c SHA256SUMS.txt` (macOS/Linux) or `Get-FileHash` (Windows).
diff --git a/docs/index.html b/docs/index.html
index 963101b8..39e808e9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -836,7 +836,7 @@
// download picker — pick macOS / Windows / Linux, click starts the download
(function () {
var REPO = 'chaitanyagiri/munder-difflin';
- var REL = '0.1.2'; // fallback version; live links are resolved from the GitHub API below
+ var REL = '0.1.3'; // fallback version; live links are resolved from the GitHub API below
var BASE = 'https://github.com/' + REPO + '/releases/latest/download/';
var PLATFORMS = [
{ key: 'mac', icon: '🍎', os: 'macOS', sub: 'Universal · Apple Silicon + Intel', match: 'mac-universal.dmg', file: 'Munder-Difflin-' + REL + '-mac-universal.dmg' },
diff --git a/package.json b/package.json
index a8b73fc0..432df400 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "munder-difflin",
- "version": "0.1.2",
+ "version": "0.1.3",
"private": true,
"description": "Local multi-agent harness for Claude Code: autonomous agents that message, route, and remember — coordinated by a GOD orchestrator and visualized as avatars at work.",
"main": "out/main/index.js",
diff --git a/src/main/config.ts b/src/main/config.ts
index 87805f82..3866bfee 100644
--- a/src/main/config.ts
+++ b/src/main/config.ts
@@ -54,6 +54,15 @@ export function writeConfig(patch: Partial<HarnessConfig>): HarnessConfig {
return next;
}
+/** Wipe the persisted config back to first-run defaults so the app boots into
+ * onboarding again. Used by the "reset & start over" flow. */
+export function resetConfig(): HarnessConfig {
+ const p = configPath();
+ mkdirSync(dirname(p), { recursive: true });
+ writeFileSync(p, JSON.stringify(DEFAULTS, null, 2), 'utf8');
+ return { ...DEFAULTS };
+}
+
/** Auto-suggested command string given current autoMode preference. */
export function commandForAutoMode(config: HarnessConfig): string {
if (config.autoMode) {
diff --git a/src/main/hooks.ts b/src/main/hooks.ts
index bf55336d..f33a3eeb 100644
--- a/src/main/hooks.ts
+++ b/src/main/hooks.ts
@@ -27,6 +27,9 @@ interface HookPayload {
prompt?: string;
source?: string;
notification_type?: string;
+ /** Notification hook text, e.g. "Claude is waiting for your input" (idle) vs a
+ * permission request. Used to tell "needs you" from "just done / lingering". */
+ message?: string;
}
export class HookServer {
@@ -94,7 +97,8 @@ export class HookServer {
event,
tool: p.tool_name,
notificationType: p.notification_type,
- source: p.source
+ source: p.source,
+ message: p.message
});
}
}
diff --git a/src/main/index.ts b/src/main/index.ts
index 30f3dd0e..214bb2a7 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1,9 +1,10 @@
import { app, BrowserWindow, dialog, ipcMain, shell } from 'electron';
import { spawn } from 'node:child_process';
+import { rmSync } from 'node:fs';
import { join } from 'node:path';
import { PtyManager, type SpawnOptions } from './pty';
import {
- readConfig, writeConfig, ensureHarnessHome,
+ readConfig, writeConfig, resetConfig, ensureHarnessHome,
type HarnessConfig
} from './config';
import { listDir, readFileText, writeFileText } from './fs';
@@ -18,9 +19,9 @@ const isDev = !!process.env.ELECTRON_RENDERER_URL;
const ptyManager = new PtyManager();
const hive = new HiveManager(
() => readConfig().harnessHome,
- (channel, payload) => mainWindow?.webContents?.send(channel, payload)
+ (channel, payload) => { try { liveWebContents()?.send(channel, payload); } catch { /* window tore down */ } }
);
-const hookServer = new HookServer(hive, () => mainWindow?.webContents ?? null);
+const hookServer = new HookServer(hive, () => liveWebContents());
const memory = new MemoryManager(
() => readConfig().harnessHome,
() => { const c = readConfig(); return { enabled: c.semanticMemory !== false, model: c.embeddingModel ?? 'minilm' }; }
@@ -30,6 +31,16 @@ let mainWindow: BrowserWindow | null = null;
/** When true, skip the quit interceptor (user already confirmed). */
let allowQuit = false;
+/** The live renderer webContents, or null if the window is gone/destroyed.
+ * Anything that emits to the renderer from a timer/socket/child callback must
+ * route through here — during quit the window can be destroyed while those
+ * callbacks are still in flight, and `.send()` on a destroyed webContents
+ * throws "Object has been destroyed" (the main-process crash dialog). */
+function liveWebContents(): Electron.WebContents | null {
+ const wc = mainWindow?.webContents;
+ return wc && !wc.isDestroyed() ? wc : null;
+}
+
function createWindow(): void {
const win = new BrowserWindow({
width: 1440,
@@ -226,16 +237,41 @@ ipcMain.handle('hive:mineNow', () => { memory.mineNow(); return { ok: true }; })
// ─── IPC: quit confirmation ─────────────────────────────────────────────────
ipcMain.handle('app:confirmClose', () => {
allowQuit = true;
- hive.stopRouter();
- hookServer.stop();
- memory.stop();
- ptyManager.killAll();
+ // Each teardown step is best-effort: a throw here (e.g. a dying child or a
+ // half-torn-down socket) must never abort the quit or pop a crash dialog.
+ try { hive.stopRouter(); } catch (e) { console.error('[quit] stopRouter:', e); }
+ try { hookServer.stop(); } catch (e) { console.error('[quit] hookServer.stop:', e); }
+ try { memory.stop(); } catch (e) { console.error('[quit] memory.stop:', e); }
+ try { ptyManager.killAll(); } catch (e) { console.error('[quit] killAll:', e); }
app.quit();
});
ipcMain.handle('app:cancelClose', () => {
// no-op — modal will close on the renderer side
});
+// ─── IPC: full reset (wipe data + config, relaunch into onboarding) ──────────
+ipcMain.handle('app:resetAll', () => {
+ allowQuit = true;
+ // Tear everything down first so nothing writes back into the dirs we wipe.
+ try { hive.stopRouter(); } catch (e) { console.error('[reset] stopRouter:', e); }
+ try { hookServer.stop(); } catch (e) { console.error('[reset] hookServer.stop:', e); }
+ try { memory.stop(); } catch (e) { console.error('[reset] memory.stop:', e); }
+ try { ptyManager.killAll(); } catch (e) { console.error('[reset] killAll:', e); }
+ // Erase the hive (Michael's + every agent's memory, inboxes, tasks, board,
+ // git history) and the semantic-memory palace. Only these harness-created
+ // subdirs are removed — never the user's whole harnessHome folder.
+ for (const dir of [hive.root(), memory.palacePath()]) {
+ if (!dir) continue;
+ try { rmSync(dir, { recursive: true, force: true }); }
+ catch (e) { console.error('[reset] rm', dir, e); }
+ }
+ // Back to first-run defaults, then relaunch clean so all in-memory services
+ // re-bootstrap from scratch and the renderer lands on onboarding.
+ resetConfig();
+ app.relaunch();
+ app.exit(0);
+});
+
app.whenReady().then(() => {
// Bootstrap the hive (if harnessHome is configured) and start the message router.
if (hive.enabled()) {
diff --git a/src/main/pty.ts b/src/main/pty.ts
index 3e204794..c24b3473 100644
--- a/src/main/pty.ts
+++ b/src/main/pty.ts
@@ -29,6 +29,16 @@ export class PtyManager {
this.webContents = wc;
}
+ /** Send to the renderer only if it's still alive. During app quit, killing a
+ * PTY fires onExit asynchronously — by then app.quit() may have destroyed the
+ * window, and `.send()` on a destroyed webContents throws "Object has been
+ * destroyed", which surfaces as the main-process crash dialog. Guard it. */
+ private safeSend(channel: string, payload: unknown): void {
+ const wc = this.webContents;
+ if (!wc || wc.isDestroyed()) return;
+ try { wc.send(channel, payload); } catch { /* window tore down mid-send */ }
+ }
+
/** Resolve a bare command (e.g. 'claude') against the user's PATH +
* common install locations. Needed because Electron's spawn env on
* macOS launches without the user's interactive shell PATH. */
@@ -97,10 +107,10 @@ export class PtyManager {
this.sessions.set(opts.id, { id: opts.id, proc, cwd: opts.cwd, command: resolved });
proc.onData((data) => {
- this.webContents?.send(`pty:data:${opts.id}`, data);
+ this.safeSend(`pty:data:${opts.id}`, data);
});
proc.onExit(({ exitCode, signal }) => {
- this.webContents?.send(`pty:exit:${opts.id}`, { exitCode, signal });
+ this.safeSend(`pty:exit:${opts.id}`, { exitCode, signal });
this.sessions.delete(opts.id);
});
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 1e39af88..88ded44d 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -182,9 +182,9 @@ const api = {
hiveSend: (msg: Partial<HiveMessage>, from?: string): Promise<{ ok: boolean; error?: string; message?: HiveMessage }> =>
ipcRenderer.invoke('hive:send', msg, from),
onHiveHookEvent: (
- cb: (e: { agentId?: string; event: string; tool?: string; notificationType?: string; source?: string }) => void
+ cb: (e: { agentId?: string; event: string; tool?: string; notificationType?: string; source?: string; message?: string }) => void
): (() => void) => {
- const listener = (_e: IpcRendererEvent, payload: { agentId?: string; event: string; tool?: string; notificationType?: string; source?: string }) => cb(payload);
+ const listener = (_e: IpcRendererEvent, payload: { agentId?: string; event: string; tool?: string; notificationType?: string; source?: string; message?: string }) => cb(payload);
ipcRenderer.on('hive:hookEvent', listener);
return () => ipcRenderer.removeListener('hive:hookEvent', listener);
},
@@ -201,7 +201,12 @@ const api = {
return () => ipcRenderer.removeListener('app:closeRequested', listener);
},
confirmClose: (): Promise<void> => ipcRenderer.invoke('app:confirmClose'),
- cancelClose: (): Promise<void> => ipcRenderer.invoke('app:cancelClose')
+ cancelClose: (): Promise<void> => ipcRenderer.invoke('app:cancelClose'),
+
+ // ─── Reset ─────────────────────────────────────────────────────────────────
+ /** Wipe all hive data + the memory palace, reset config, and relaunch the app
+ * into onboarding. The process exits, so this promise never resolves. */
+ resetAll: (): Promise<void> => ipcRenderer.invoke('app:resetAll')
};
contextBridge.exposeInMainWorld('cth', api);
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index 25af56b0..d447d97b 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -9,8 +9,10 @@ import { MemoryPanel } from '@/components/MemoryPanel';
import { AgentDetailPanel } from '@/components/AgentDetailPanel';
import { AgentStrip } from '@/components/AgentStrip';
import { AddAgentModal } from '@/components/AddAgentModal';
+import { MichaelBooting } from '@/components/MichaelBooting';
import { OnboardingWizard } from '@/components/OnboardingWizard';
import { QuitWarningModal } from '@/components/QuitWarningModal';
+import { SettingsModal } from '@/components/SettingsModal';
import { PixelPanel } from '@/components/PixelPanel';
import { PixelButton } from '@/components/PixelButton';
import { Icon } from '@/components/Icon';
@@ -25,12 +27,14 @@ export function App() {
const agentCount = agents.length;
const addAgentOpen = useStore(s => s.addAgentOpen);
const setAddAgentOpen = useStore(s => s.setAddAgentOpen);
+ const godStatus = useStore(s => s.godStatus);
const fullscreenAgentId = useStore(s => s.fullscreenAgentId);
const fullscreenFilePath = useStore(s => s.fullscreenFilePath);
const sidebarWidth = useStore(s => s.sidebarWidth);
const setSidebarWidth = useStore(s => s.setSidebarWidth);
const [config, setConfig] = useState<HarnessConfig | null>(null);
+ const [settingsOpen, setSettingsOpen] = useState(false);
const [quitWarn, setQuitWarn] = useState<{ ptyCount: number } | null>(null);
const [vpWidth, setVpWidth] = useState<number>(window.innerWidth);
@@ -134,6 +138,21 @@ export function App() {
}}>
v0.1 · {config.autoMode ? 'auto mode on' : 'auto mode off'}
</span>
+ <button
+ className="cth-titlebar-nodrag"
+ onClick={() => setSettingsOpen(true)}
+ title="Settings"
+ aria-label="Settings"
+ style={{
+ marginLeft: 'auto',
+ display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
+ width: 24, height: 24, padding: 0,
+ background: 'transparent', border: 'none', cursor: 'pointer',
+ color: 'var(--cth-ink-700)'
+ }}
+ >
+ <Icon name="gear" />
+ </button>
</div>
<div style={{
@@ -146,7 +165,8 @@ export function App() {
<OfficeFloor />
<ApprovalsPanel />
<MemoryPanel />
- {agentCount === 0 && (
+ {agentCount === 0 && godStatus === 'booting' && <MichaelBooting />}
+ {agentCount === 0 && godStatus !== 'booting' && (
<div style={{
position: 'absolute', inset: 0,
display: 'flex', alignItems: 'center', justifyContent: 'center',
@@ -182,6 +202,21 @@ export function App() {
}}>
{agent ? (
<AgentDetailPanel agent={agent} />
+ ) : godStatus === 'booting' ? (
+ <PixelPanel variant="default" noPadding style={{
+ padding: 16, height: '100%',
+ display: 'flex', flexDirection: 'column',
+ justifyContent: 'center', alignItems: 'center', gap: 12
+ }}>
+ <div style={{
+ fontFamily: 'var(--cth-font-display)', fontSize: 10, lineHeight: '14px',
+ color: 'var(--cth-ink-500)'
+ }}>WAKING THE FLOOR</div>
+ <p style={{ margin: 0, fontSize: 14, textAlign: 'center', color: 'var(--cth-ink-700)' }}>
+ Michael is clocking in.<br />
+ The terminal will land here once he's seated.
+ </p>
+ </PixelPanel>
) : (
<PixelPanel variant="default" noPadding style={{
padding: 16, height: '100%',
@@ -212,6 +247,10 @@ export function App() {
<AddAgentModal onClose={() => setAddAgentOpen(false)} config={config} />
)}
+ {settingsOpen && (
+ <SettingsModal config={config} onClose={() => setSettingsOpen(false)} />
+ )}
+
{quitWarn && (
<QuitWarningModal
ptyCount={quitWarn.ptyCount}
diff --git a/src/renderer/src/components/MichaelBooting.tsx b/src/renderer/src/components/MichaelBooting.tsx
new file mode 100644
index 00000000..bfe01dd5
--- /dev/null
+++ b/src/renderer/src/components/MichaelBooting.tsx
@@ -0,0 +1,48 @@
+import { PixelPanel } from '@/components/PixelPanel';
+
+/**
+ * Loader shown on the empty floor while the god agent ("Michael") is clocking
+ * in on launch. Replaces the "add agent" prompt so a returning user doesn't see
+ * the empty-floor call-to-action before Michael has booted.
+ */
+export function MichaelBooting() {
+ return (
+ <div style={{
+ position: 'absolute', inset: 0,
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
+ pointerEvents: 'none'
+ }}>
+ <div style={{ pointerEvents: 'auto', width: 360 }}>
+ <PixelPanel variant="dialog" title="CLOCKING IN" noPadding>
+ <div style={{
+ padding: 20,
+ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14
+ }}>
+ {/* Stepped pixel blocks — staggered blink, no easing (matches aesthetic) */}
+ <div style={{ display: 'flex', gap: 6 }}>
+ {[0, 1, 2, 3].map((i) => (
+ <span
+ key={i}
+ style={{
+ width: 14, height: 14,
+ background: '#6E1423',
+ boxShadow: 'var(--cth-shadow-hard)',
+ animation: 'cth-blink 1s steps(1, end) infinite',
+ animationDelay: `${i * 0.2}s`
+ }}
+ />
+ ))}
+ </div>
+ <p style={{
+ margin: 0, fontSize: 14, lineHeight: '20px', textAlign: 'center',
+ color: 'var(--cth-ink-700)'
+ }}>
+ Michael is settling into the corner office and getting the floor
+ ready. Hang tight…
+ </p>
+ </div>
+ </PixelPanel>
+ </div>
+ </div>
+ );
+}
diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx
new file mode 100644
index 00000000..cdded42f
--- /dev/null
+++ b/src/renderer/src/components/SettingsModal.tsx
@@ -0,0 +1,123 @@
+import { useState } from 'react';
+import type { HarnessConfig } from '@/store/config';
+import { PixelPanel } from './PixelPanel';
+import { PixelButton } from './PixelButton';
+import { Icon } from './Icon';
+
+export interface SettingsModalProps {
+ config: HarnessConfig;
+ onClose: () => void;
+}
+
+/** Clear every renderer-side persisted key so a relaunch starts truly empty. */
+function clearLocalState(): void {
+ try {
+ const keys: string[] = [];
+ for (let i = 0; i < window.localStorage.length; i++) {
+ const k = window.localStorage.key(i);
+ if (k && k.startsWith('cth.')) keys.push(k);
+ }
+ for (const k of keys) window.localStorage.removeItem(k);
+ } catch { /* noop */ }
+}
+
+export function SettingsModal({ config, onClose }: SettingsModalProps) {
+ const [confirming, setConfirming] = useState(false);
+ const [busy, setBusy] = useState(false);
+
+ const reset = async () => {
+ setBusy(true);
+ clearLocalState();
+ // Wipes hive + palace, resets config, and relaunches into onboarding.
+ // The app exits, so this never resolves — no need to clear `busy`.
+ await window.cth.resetAll();
+ };
+
+ const rows: Array<[string, string]> = [
+ ['Home folder', config.harnessHome ?? '—'],
+ ['Auto mode', config.autoMode ? 'on' : 'off'],
+ ['Semantic memory', config.semanticMemory ? 'on' : 'off'],
+ ['Command', config.defaultCommand]
+ ];
+
+ return (
+ <div
+ onClick={busy ? undefined : onClose}
+ style={{
+ position: 'fixed', inset: 0,
+ background: 'rgba(26, 19, 32, 0.7)',
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
+ zIndex: 300
+ }}
+ >
+ <div onClick={(e) => e.stopPropagation()} style={{ width: 520, maxWidth: '92vw' }}>
+ <PixelPanel variant="dialog" title={confirming ? 'RESET EVERYTHING?' : 'SETTINGS'} noPadding>
+ {!confirming ? (
+ <div style={{ padding: 20, display: 'flex', flexDirection: 'column', gap: 16 }}>
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
+ {rows.map(([label, value]) => (
+ <div key={label} style={{ display: 'flex', gap: 12, fontSize: 14, lineHeight: '20px' }}>
+ <span style={{ width: 140, flexShrink: 0, color: 'var(--cth-ink-500)' }}>{label}</span>
+ <span style={{
+ color: 'var(--cth-ink-900)', wordBreak: 'break-all',
+ fontFamily: label === 'Home folder' || label === 'Command' ? 'var(--cth-font-mono, monospace)' : undefined
+ }}>{value}</span>
+ </div>
+ ))}
+ </div>
+
+ <div style={{ height: 2, background: 'var(--cth-ink-300)' }} />
+
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+ <div style={{
+ fontFamily: 'var(--cth-font-display)', fontSize: 10, lineHeight: '14px',
+ color: '#6E1423'
+ }}>DANGER ZONE</div>
+ <p style={{ margin: 0, fontSize: 14, lineHeight: '20px', color: 'var(--cth-ink-700)' }}>
+ Reset wipes Michael's memories, the entire hive (every agent, message,
+ task, and the board), the semantic-memory palace, and all settings —
+ then takes you back to onboarding.
+ </p>
+ </div>
+
+ <div style={{ display: 'flex', justifyContent: 'flex-end', gap: 8 }}>
+ <PixelButton variant="secondary" size="md" onClick={onClose}>close</PixelButton>
+ <PixelButton variant="destructive" size="md" onClick={() => setConfirming(true)}>
+ reset &amp; start over
+ </PixelButton>
+ </div>
+ </div>
+ ) : (
+ <div style={{ padding: 20, display: 'flex', flexDirection: 'column', gap: 16 }}>
+ <div style={{ display: 'flex', gap: 12, alignItems: 'flex-start' }}>
+ <div style={{
+ width: 32, height: 32,
+ background: 'var(--cth-coral-light)',
+ boxShadow: 'inset 0 0 0 2px var(--cth-ink-900)',
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
+ flexShrink: 0
+ }}>
+ <Icon name="bell" />
+ </div>
+ <div style={{ flex: 1, fontSize: 15, lineHeight: '22px', color: 'var(--cth-ink-700)' }}>
+ This permanently erases all of Michael's memories and the entire hive,
+ and cannot be undone. Any running sessions will be terminated and the app
+ will relaunch into onboarding. Are you sure?
+ </div>
+ </div>
+
+ <div style={{ display: 'flex', justifyContent: 'flex-end', gap: 8 }}>
+ <PixelButton variant="secondary" size="md" onClick={() => setConfirming(false)} disabled={busy}>
+ cancel
+ </PixelButton>
+ <PixelButton variant="destructive" size="md" onClick={reset} disabled={busy}>
+ {busy ? 'resetting…' : 'erase everything & restart'}
+ </PixelButton>
+ </div>
+ </div>
+ )}
+ </PixelPanel>
+ </div>
+ </div>
+ );
+}
diff --git a/src/renderer/src/hooks/useHive.ts b/src/renderer/src/hooks/useHive.ts
index c8cac3b0..154419b7 100644
--- a/src/renderer/src/hooks/useHive.ts
+++ b/src/renderer/src/hooks/useHive.ts
@@ -47,10 +47,15 @@ export function useHive(config: HarnessConfig | null): void {
useEffect(() => {
if (!config?.onboardingComplete || !config.harnessHome) return;
let cancelled = false;
+ useStore.getState().setGodStatus('booting');
const t = setTimeout(async () => {
if (cancelled) return;
const live = await window.cth.listPtys().catch(() => []);
- if (cancelled || live.some((p) => p.id === GOD_PTY)) return; // already running
+ if (live.some((p) => p.id === GOD_PTY)) { // already running — keep restored entry
+ if (!cancelled) useStore.getState().setGodStatus('ready');
+ return;
+ }
+ if (cancelled) return;
useStore.getState().removeAgent(GOD_ID); // clear any stale restored entry
const command = buildSpawnCommand(config);
@@ -64,7 +69,8 @@ export function useHive(config: HarnessConfig | null): void {
rows: 30,
hive: { id: GOD_ID, name: 'Michael', cwd: config.harnessHome!, isGod: true, role: 'orchestrator (god)' }
});
- if (!res.ok || cancelled) return;
+ if (cancelled) return;
+ if (!res.ok) { useStore.getState().setGodStatus('failed'); return; }
const god: Agent = {
id: GOD_ID,
name: 'Michael',
@@ -84,6 +90,7 @@ export function useHive(config: HarnessConfig | null): void {
recentTextTs: Date.now()
};
useStore.getState().addAgent(god);
+ useStore.getState().setGodStatus('ready');
}, 1200);
return () => { cancelled = true; clearTimeout(t); };
}, [config?.onboardingComplete, config?.harnessHome]);
@@ -107,10 +114,30 @@ export function useHive(config: HarnessConfig | null): void {
} else if (e.event === 'Stop' || e.event === 'SubagentStop') {
updateAgent(e.agentId, { status: 'idle', action: 'idle', carrying: undefined });
} else if (e.event === 'Notification') {
- // Only the god agent escalates to the human ("needs you"). Sub-agents
- // are autonomous — a notification means they're parked waiting on god,
- // not on you, so they read as "waiting" rather than "blocked".
- updateAgent(e.agentId, { status: self.isGod ? 'blocked' : 'waiting' });
+ // Claude Code fires Notification for two very different situations:
+ // 1. it genuinely needs the human (a permission / approval prompt), or
+ // 2. the prompt has merely gone idle ("Claude is waiting for your
+ // input") — i.e. the agent answered and has nothing queued.
+ // Only (1) is a real "needs you". Treating (2) as blocked made Michael
+ // march to the door with a red "!" right after finishing, so detect the
+ // idle case and let him linger on the floor instead.
+ const msg = (e.message ?? '').toLowerCase();
+ const idleWaiting = !msg
+ || msg.includes('waiting for your input')
+ || msg.includes('is idle')
+ || msg.includes('waiting for input');
+ const needsHuman = msg.includes('permission')
+ || msg.includes('approve')
+ || msg.includes('confirm')
+ || msg.includes('needs your');
+ if (needsHuman && !idleWaiting) {
+ // Only the god agent escalates to the human; sub-agents are autonomous
+ // and read as "waiting" (parked on god, not on you).
+ updateAgent(e.agentId, { status: self.isGod ? 'blocked' : 'waiting' });
+ } else {
+ // Idle notification — responded, nothing to do. Linger, don't flag.
+ updateAgent(e.agentId, { status: 'idle', action: 'idle', carrying: undefined });
+ }
}
});
}, []);
diff --git a/src/renderer/src/store/store.ts b/src/renderer/src/store/store.ts
index b84ec1f2..f4161467 100644
--- a/src/renderer/src/store/store.ts
+++ b/src/renderer/src/store/store.ts
@@ -65,6 +65,12 @@ export interface FeedEntry {
export type SidebarTab = 'terminal' | 'files';
+/** Lifecycle of the god agent ("Michael") bootstrap on launch.
+ * 'booting' until his PTY is confirmed live, then 'ready' (or 'failed' if the
+ * spawn errored). The empty-floor UI shows a loader while 'booting' so users
+ * don't see the "add agent" prompt before Michael has clocked in. */
+export type GodStatus = 'booting' | 'ready' | 'failed';
+
interface State {
agents: Agent[];
selectedId: string | null;
@@ -74,6 +80,8 @@ interface State {
fullscreenFilePath: string | null;
sidebarWidth: number;
sidebarTab: SidebarTab;
+ godStatus: GodStatus;
+ setGodStatus: (status: GodStatus) => void;
select: (id: string) => void;
updateAgent: (id: string, patch: Partial<Agent>) => void;
pushFeed: (id: string, line: string) => void;
@@ -165,6 +173,8 @@ export const useStore = create<State>((set) => ({
fullscreenFilePath: null,
sidebarWidth: initialSidebarWidth,
sidebarTab: initialSidebarTab,
+ godStatus: 'booting',
+ setGodStatus: (status) => set({ godStatus: status }),
select: (id) => set((s) => { persistAgents(s.agents, id); return { selectedId: id }; }),
updateAgent: (id, patch) =>
set((s) => ({ agents: s.agents.map(a => a.id === id ? { ...a, ...patch } : a) })),