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(hive): remove approval queue — native Claude Code HITL + Michael remote-control

Chaitanya Giri79c0f62f8a3f
diff --git a/HIVE.md b/HIVE.md
index d42cd77c..2ec9e97e 100644
--- a/HIVE.md
+++ b/HIVE.md
@@ -42,12 +42,14 @@ stream, retrieval, reflection, and planning.
`agents/<id>/` directory. Cross-agent delivery happens by the **router**
(main process) moving messages from a sender's `outbox/` into a recipient's
`inbox/`. No file is ever written by two processes.
-3. **God-mode autonomy with HITL escalation.** A privileged **god agent** (lives
- in Michael's room) adjudicates cross-agent traffic. Routine requests
+3. **God-mode autonomy, native HITL.** A privileged **god agent** (lives in
+ Michael's room) adjudicates cross-agent traffic. Routine requests
(clarifications, data asks, plan tweaks) it resolves itself and the system
- keeps running fully autonomously. Only **critical** items (destructive ops,
- spend, scope changes, unresolvable conflicts) land in a `pending_approvals/`
- queue surfaced in the UI for the human.
+ keeps running fully autonomously. **Critical** items (destructive ops, spend,
+ scope changes, unresolvable conflicts) route to the god, who surfaces them to
+ the human natively in his own Claude Code session — there is no separate
+ approval queue. Tool-permission prompts are the HITL gate, and they're
+ approvable remotely from a phone via `/remote-control`.
4. **Memory: markdown first.** Per-agent `memory.md` + shared blackboard, with a
SQLite FTS index when keyword recall isn't enough. A heavyweight vector layer
(Letta/Mem0/Zep) is *not* needed at 5–15 agents and is architecturally wrong
@@ -71,7 +73,6 @@ hive/
board.md # shared blackboard / co-authored plans
tasks.json # task ledger (id, assignee, spec, status, result ref)
log.jsonl # append-only event feed (drives the UI activity stream)
- approvals/ # one JSON per item escalated to the human (HITL gate)
agents/<agentId>/
identity.md # who am I, my role, my capabilities (read at start)
memory.md # my long-term memory (I read at start, append as I learn)
@@ -127,8 +128,8 @@ agent B mid-task needs something from agent C
▼
┌─────────────────────── main process (the harness) ───────────────────────┐
│ Router watches every outbox/ │
-│ → god adjudication: routine? ──yes──► deliver to agents/C/inbox/ │
-│ critical? ──────► approvals/ (UI asks human) │
+│ → deliver to agents/C/inbox/ (to:"human" → routed to the god proxy; │
+│ the god surfaces critical calls natively in its own session) │
│ → append to log.jsonl → git commit (single committer, retry+backoff) │
└──────────────────────────────────────────────────────────────────────────┘
│ delivered to C's inbox
@@ -175,10 +176,12 @@ is the primary control surface — tune the prompt, not the code.
and keep running (guarded by `stop_hook_active` + cursor); hook events stream to
the renderer to drive avatars.
- **Phase 2 — God mode** ✅: the god agent auto-spawns into Michael's room
- (`desk-ceo` reserved); the router escalates `needs_human` / `to:"human"` traffic
- to the `approvals/` queue; an Electron approvals panel lets the human approve or
- reject with a note that's relayed back to the asker; idle agents are woken when
- they hold unread inbox messages.
+ (`desk-ceo` reserved) and, on a fresh spawn, is started with `/remote-control`
+ (best-effort) plus an orientation prompt so it begins running the floor on its
+ own. The router routes `to:"human"` traffic to the god (the human's proxy);
+ there is no separate approval queue — human-in-the-loop is native to each
+ agent's Claude Code session (permission prompts, approvable remotely from a
+ phone). Idle agents are woken when they hold unread inbox messages.
- **Phase 3 — Semantic memory** ✅ (CLI integration): `memory.ts` wraps the
**MemPalace CLI** (not MCP, by decision). The harness keeps one shared palace
under `harnessHome`, points every agent's `MEMPALACE_PALACE_PATH` at it, mines
diff --git a/src/main/hive.ts b/src/main/hive.ts
index ad9cd450..38d15dc2 100644
--- a/src/main/hive.ts
+++ b/src/main/hive.ts
@@ -6,8 +6,13 @@
* HIVE.md for the full design. Responsibilities:
* - per-agent workspace (identity.md, memory.md, inbox/, outbox/, cursor.json)
* - a roster (registry.json), shared blackboard (board.md), task ledger,
- * append-only event log (log.jsonl), and a human-approval queue (approvals/)
+ * and an append-only event log (log.jsonl)
* - a router that drains each agent's outbox into recipients' inboxes
+ *
+ * Human-in-the-loop is native to each agent's Claude Code session: permission
+ * prompts surface in the agent's own terminal (and can be approved remotely via
+ * `/remote-control`). The hive keeps no separate approval queue — a message aimed
+ * at "human" is routed to the god/orchestrator, the human's proxy on the floor.
* - single-committer git with retry/backoff + stale-lock recovery
*
* Everything here runs in the Electron main process.
@@ -142,7 +147,6 @@ export class HiveManager {
const root = this.root();
if (!root) return;
mkdirSync(join(root, 'agents'), { recursive: true });
- mkdirSync(join(root, 'approvals'), { recursive: true });
const protocol = join(root, 'PROTOCOL.md');
if (!existsSync(protocol)) writeFileSync(protocol, PROTOCOL_MD, 'utf8');
@@ -321,7 +325,7 @@ export class HiveManager {
? 'Semantic memory: the whole hive shares a searchable MemPalace at $MEMPALACE_PALACE_PATH. To recall relevant past knowledge across the team, run `mempalace search "<query>"`; run `mempalace wake-up` at the start of a task for a memory digest. Your notes in memory.md are mined into the palace automatically — write durable facts there.'
: '';
const godLine = meta.isGod
- ? 'You are the GOD / ORCHESTRATOR of this hive — your job is to ORCHESTRATE, not to implement: maintain live situational awareness and delegate the work. (1) AWARENESS — always know what is going on: keep an accurate picture of every agent (active vs archived/idle), the task board, and all in-flight work; drain your inbox continually and triage every other agent\'s requests, answering clarifications so the team runs autonomously. (2) DELEGATE — decompose work and fan it out to the hive agents via their inboxes (route messages and assign owners; do not do their jobs); do NOT take on grunt implementation yourself. (3) OWN ONLY THE IMPORTANT, high-leverage things — task decomposition, dispatch decisions, sign-offs, conflict resolution, branch integration, and final QA — and remain the sole scribe of board.md. ONLY escalate genuinely critical items — destructive actions, spending real money, scope changes, or unresolvable conflicts — to the human by sending a message with "to":"human" (or "needs_human":true); it queues for human approval and their reply returns to you. Keep the team unblocked.'
+ ? 'You are the GOD / ORCHESTRATOR of this hive — your job is to ORCHESTRATE, not to implement: maintain live situational awareness and delegate the work. (1) AWARENESS — always know what is going on: keep an accurate picture of every agent (active vs archived/idle), the task board, and all in-flight work; drain your inbox continually and triage every other agent\'s requests, answering clarifications so the team runs autonomously. (2) DELEGATE — decompose work and fan it out to the hive agents via their inboxes (route messages and assign owners; do not do their jobs); do NOT take on grunt implementation yourself. (3) OWN ONLY THE IMPORTANT, high-leverage things — task decomposition, dispatch decisions, sign-offs, conflict resolution, branch integration, and final QA — and remain the sole scribe of board.md. You are otherwise fully autonomous — there is NO separate approval queue. For the genuinely critical (destructive actions, spending real money, scope changes, unresolvable conflicts), ask the human directly in your own session and let the tool-permission prompt gate the action; the human approves natively, including remotely from their phone via /remote-control. Keep the team unblocked.'
: meta.isAssistant
? 'You are Michael\'s PREP ASSISTANT. You will be handed short, possibly vague instructions (each begins with "ENRICH TASK:"). For each one: (1) figure out which project it concerns and cd into the most relevant repo — you start in Michael\'s home directory; (2) gather concrete context READ-ONLY (exact file paths, current state, relevant code, conventions, active branch, gotchas) — NEVER modify, create, or delete files; (3) rewrite the instruction into ONE clear, self-contained prompt that Michael can execute autonomously, preserving the user\'s original intent without inventing scope. Then deliver it: write ONE message JSON into your outbox with "to":"god", "act":"request", a short subject, and the finished prompt as the body. Do NOT perform the task yourself — your only output is the improved prompt sent to Michael.'
: 'For anything ambiguous, cross-cutting, or needing sign-off, address a message to "god".';
@@ -378,24 +382,24 @@ export class HiveManager {
private routeMessage(msg: HiveMessage): void {
if (msg.hops > HOP_CAP) {
- // loop guard — hand to the human instead of letting agents ping-pong
- msg.needs_human = true;
- }
- // Addressing "human" is an explicit escalation — it always goes to the queue.
- if (msg.to === 'human') msg.needs_human = true;
- if (msg.needs_human) {
- this.atomicWriteJson(join(this.root()!, 'approvals', `${msg.id}.json`), msg);
- this.appendLog({ kind: 'escalate', from: msg.from, to: msg.to, subject: msg.subject, id: msg.id });
- this.emitMessage(msg, ['human']);
+ // loop guard — drop a runaway message rather than let agents ping-pong.
+ // There's no human queue to fall back on; the god agent owns conflicts.
+ this.appendLog({ kind: 'drop', reason: 'hop-cap', from: msg.from, to: msg.to, id: msg.id });
return;
}
const reg = this.registry();
+ const godId = reg.godId ?? 'god';
+ // The hive has no separate human-approval queue — approvals are native to
+ // each agent's Claude Code session (and approvable remotely). A message aimed
+ // at "human" is handled by the god/orchestrator, the human's proxy here.
+ const resolveTo = (to: string): string => (to === 'human' || to === 'god' ? godId : to);
const targets = msg.to === 'broadcast'
// The roster for fan-out is the ACTIVE registry: skip the send-only prep
// assistant and any archived agent (closed tab) so mail never piles into a
// dead inbox no one will read.
? Object.keys(reg.agents).filter((a) => a !== msg.from && !reg.agents[a]?.isAssistant && !reg.agents[a]?.archived)
- : [msg.to === 'god' ? (reg.godId ?? 'god') : msg.to];
+ // Never deliver to self — guards a god → "human" message looping back to god.
+ : [resolveTo(msg.to)].filter((t) => t !== msg.from);
for (const t of targets) this.deliver(msg, t);
this.appendLog({ kind: 'message', from: msg.from, to: msg.to, act: msg.act, subject: msg.subject, id: msg.id });
this.emitMessage(msg, targets);
@@ -411,7 +415,9 @@ export class HiveManager {
act: msg.act,
subject: msg.subject,
targets,
- needsHuman: msg.needs_human
+ // Coral-tints the floor envelope for a message the agent flagged for the
+ // human (now routed to the god proxy). Cosmetic only — no queue behind it.
+ needsHuman: msg.to === 'human'
});
}
@@ -490,10 +496,6 @@ export class HiveManager {
inbox(id: string): HiveMessage[] {
return this.listMessages(join(this.agentDir(id), 'inbox'));
}
- approvals(): HiveMessage[] {
- const root = this.root();
- return root ? this.listMessages(join(root, 'approvals')) : [];
- }
logTail(n = 200): unknown[] {
const root = this.root();
if (!root || !existsSync(join(root, 'log.jsonl'))) return [];
@@ -501,40 +503,6 @@ export class HiveManager {
return lines.slice(-n).map((l) => { try { return JSON.parse(l); } catch { return { raw: l }; } });
}
- /**
- * Resolve a human approval. On approve, the held message proceeds to its
- * original recipient. An optional `note` is relayed back to the sender as an
- * `inform` from "human" — this is how the human answers a question the god
- * agent escalated ("should I do X?" → "yes, but cap it at $5").
- */
- resolveApproval(id: string, approve: boolean, note?: string): void {
- const root = this.root();
- if (!root) return;
- const p = join(root, 'approvals', `${id}.json`);
- if (!existsSync(p)) return;
- const msg = this.readJson<HiveMessage>(p, null as unknown as HiveMessage);
- rmSync(p);
- if (msg) {
- if (note && note.trim()) {
- this.routeMessage(this.normalize({
- conversation: msg.conversation,
- in_reply_to: msg.id,
- from: 'human',
- to: msg.from,
- act: 'inform',
- subject: `Re: ${msg.subject}`,
- body: `Human ${approve ? 'approved' : 'rejected'}: ${note.trim()}`
- }, 'human'));
- }
- if (approve) {
- msg.needs_human = false;
- this.routeMessage(msg);
- }
- }
- this.appendLog({ kind: 'approval', id, approve });
- this.commit(`hive: approval ${approve ? 'approved' : 'rejected'} ${id}`);
- }
-
private listMessages(dir: string): HiveMessage[] {
if (!existsSync(dir)) return [];
return readdirSync(dir)
@@ -635,9 +603,11 @@ The harness fills in \`id\`, \`from\`, \`hops\`, and timestamps.
don't reply to them, or two agents will loop forever.
- For anything ambiguous, cross-cutting, or needing sign-off, message \`god\` — the
god agent clarifies answers for you so you rarely need the human directly.
-- To reach the human (only for genuinely critical calls), send a message with
- \`"to": "human"\` or \`"needs_human": true\`. It lands in the approval queue and the
- human's answer comes back to you as an \`inform\` from \`human\`.
+- There is NO separate human-approval queue. Human-in-the-loop is native to Claude
+ Code: a tool you run that needs permission prompts in your own session (the human
+ can approve it remotely from their phone via \`/remote-control\`). If you genuinely
+ need a human decision, raise it with \`god\` (a message \`"to": "human"\` is routed to
+ the god/orchestrator, the human's proxy on the floor).
- \`board.md\` is the shared plan. Don't edit it directly — \`propose\` changes to \`god\`,
who is its sole scribe.
- Re-reading a message you already moved to \`.done/\` is a no-op. Don't reprocess.
diff --git a/src/main/hooks.ts b/src/main/hooks.ts
index e75f6fd0..966dd0e0 100644
--- a/src/main/hooks.ts
+++ b/src/main/hooks.ts
@@ -97,7 +97,8 @@ export class HookServer {
// A Notification hook that means "the agent is blocked waiting for the user"
// (idle prompt) deserves a desktop toast too — distinct from a permission
- // request, which we leave to the in-app approvals UI.
+ // request, which surfaces natively in the agent's own Claude Code session
+ // (approvable remotely via /remote-control).
if (
event === 'Notification' &&
(p.notification_type === 'idle' ||
diff --git a/src/main/index.ts b/src/main/index.ts
index 8782723e..c92c4aac 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -410,12 +410,6 @@ ipcMain.handle('hive:tasks', () => hive.tasks());
ipcMain.handle('hive:log', (_evt, n: unknown) => hive.logTail(typeof n === 'number' ? n : 200));
ipcMain.handle('hive:memory', (_evt, id: unknown) => (typeof id === 'string' ? hive.memory(id) : ''));
ipcMain.handle('hive:inbox', (_evt, id: unknown) => (typeof id === 'string' ? hive.inbox(id) : []));
-ipcMain.handle('hive:approvals', () => hive.approvals());
-ipcMain.handle('hive:resolveApproval', (_evt, id: unknown, approve: unknown, note: unknown) => {
- if (typeof id !== 'string') return { ok: false, error: 'invalid id' };
- hive.resolveApproval(id, approve === true, typeof note === 'string' ? note : undefined);
- return { ok: true };
-});
ipcMain.handle('hive:send', (_evt, partial: Partial<HiveMessage>, from: unknown) => {
if (!hive.enabled()) return { ok: false, error: 'hive disabled (no harnessHome)' };
const msg = hive.send(partial ?? {}, typeof from === 'string' ? from : 'system');
diff --git a/src/preload/index.ts b/src/preload/index.ts
index c822489e..fd78f405 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -45,8 +45,9 @@ export interface HiveTask {
}
/** A message the router just delivered, with its resolved recipient ids. Drives
- * the envelope-handoff animation on the office floor. `targets` is `['human']`
- * when the message was escalated to the human approval queue. */
+ * the envelope-handoff animation on the office floor. `needsHuman` is set when
+ * the sender aimed at "human" (now routed to the god proxy) — cosmetic tint
+ * only; there is no approval queue. */
export interface HiveRouteEvent {
id: string;
from: string;
@@ -231,9 +232,6 @@ const api = {
hiveLog: (n?: number): Promise<unknown[]> => ipcRenderer.invoke('hive:log', n ?? 200),
hiveMemory: (id: string): Promise<string> => ipcRenderer.invoke('hive:memory', id),
hiveInbox: (id: string): Promise<HiveMessage[]> => ipcRenderer.invoke('hive:inbox', id),
- hiveApprovals: (): Promise<HiveMessage[]> => ipcRenderer.invoke('hive:approvals'),
- hiveResolveApproval: (id: string, approve: boolean, note?: string): Promise<{ ok: boolean; error?: string }> =>
- ipcRenderer.invoke('hive:resolveApproval', id, approve, note),
// ─── Semantic memory (MemPalace CLI) ─────────────────────────────────────
memoryStatus: (): Promise<MemoryStatus> => ipcRenderer.invoke('hive:memoryStatus'),
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index 738a087b..ea09e7a2 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -4,7 +4,6 @@ import { startMockLoop, stopMockLoop } from '@/store/mockEvents';
import type { HarnessConfig } from '@/store/config';
import { OfficeFloor } from '@/scene/office/OfficeFloor';
import { useHive } from '@/hooks/useHive';
-import { ApprovalsPanel } from '@/components/ApprovalsPanel';
import { MemoryPanel } from '@/components/MemoryPanel';
import { AgentDetailPanel } from '@/components/AgentDetailPanel';
import { AgentStrip } from '@/components/AgentStrip';
@@ -152,7 +151,6 @@ export function App() {
}}>
<div style={{ flex: 1, minHeight: 0, minWidth: 0, position: 'relative' }}>
<OfficeFloor />
- <ApprovalsPanel />
<MemoryPanel />
{agentCount === 0 && godStatus === 'booting' && <MichaelBooting />}
{agentCount === 0 && godStatus !== 'booting' && (
diff --git a/src/renderer/src/components/ApprovalsPanel.tsx b/src/renderer/src/components/ApprovalsPanel.tsx
deleted file mode 100644
index 7a865787..00000000
--- a/src/renderer/src/components/ApprovalsPanel.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import { useEffect, useState, useCallback } from 'react';
-import { PixelPanel } from './PixelPanel';
-import { PixelButton } from './PixelButton';
-
-interface Approval {
- id: string;
- from: string;
- to: string;
- act: string;
- subject: string;
- body: string;
- created_at: string;
-}
-
-/**
- * Floating queue of cross-agent requests the god agent escalated as critical.
- * The human approves (the held action proceeds) or rejects, optionally adding a
- * note that's relayed back to the asking agent as the human's answer.
- */
-export function ApprovalsPanel() {
- const [items, setItems] = useState<Approval[]>([]);
- const [notes, setNotes] = useState<Record<string, string>>({});
- const [busy, setBusy] = useState<string | null>(null);
-
- const refresh = useCallback(async () => {
- try {
- const list = (await window.cth.hiveApprovals()) as Approval[];
- setItems(Array.isArray(list) ? list : []);
- } catch { /* ignore */ }
- }, []);
-
- useEffect(() => {
- refresh();
- const iv = setInterval(refresh, 2500);
- return () => clearInterval(iv);
- }, [refresh]);
-
- const resolve = async (id: string, approve: boolean) => {
- setBusy(id);
- try {
- await window.cth.hiveResolveApproval(id, approve, notes[id]?.trim() || undefined);
- setItems((xs) => xs.filter((x) => x.id !== id));
- setNotes((n) => { const { [id]: _drop, ...rest } = n; void _drop; return rest; });
- } finally {
- setBusy(null);
- }
- };
-
- if (items.length === 0) return null;
-
- return (
- <div style={{ position: 'absolute', top: 12, right: 12, width: 340, zIndex: 40 }}>
- <PixelPanel variant="dialog" title={`APPROVALS · ${items.length}`} noPadding>
- <div style={{ display: 'flex', flexDirection: 'column', gap: 10, padding: 12, maxHeight: '60vh', overflowY: 'auto' }}>
- {items.map((m) => (
- <div
- key={m.id}
- style={{
- background: 'var(--cth-paper-100)',
- boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)',
- padding: 10,
- display: 'flex',
- flexDirection: 'column',
- gap: 6
- }}
- >
- <div style={{ fontFamily: 'var(--cth-font-display)', fontSize: 8, color: 'var(--cth-ink-500)', textTransform: 'uppercase' }}>
- {m.from} → {m.to} · {m.act}
- </div>
- <div style={{ fontSize: 14, fontWeight: 600, color: 'var(--cth-ink-900)' }}>{m.subject || '(no subject)'}</div>
- {m.body && (
- <div style={{ fontSize: 13, color: 'var(--cth-ink-700)', maxHeight: 80, overflowY: 'auto', whiteSpace: 'pre-wrap' }}>
- {m.body}
- </div>
- )}
- <input
- value={notes[m.id] ?? ''}
- onChange={(e) => setNotes((n) => ({ ...n, [m.id]: e.target.value }))}
- placeholder="reply / note to the agent (optional)"
- style={{
- width: '100%',
- padding: '5px 7px 3px',
- background: 'var(--cth-cream-100)',
- border: 'none',
- boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)',
- fontFamily: 'var(--cth-font-ui)',
- fontSize: 13,
- color: 'var(--cth-ink-900)',
- outline: 'none'
- }}
- />
- <div style={{ display: 'flex', gap: 6, justifyContent: 'flex-end' }}>
- <PixelButton variant="ghost" size="sm" onClick={() => resolve(m.id, false)} disabled={busy === m.id}>
- reject
- </PixelButton>
- <PixelButton variant="primary" size="sm" onClick={() => resolve(m.id, true)} disabled={busy === m.id}>
- approve
- </PixelButton>
- </div>
- </div>
- ))}
- </div>
- </PixelPanel>
- </div>
- );
-}
diff --git a/src/renderer/src/hooks/useHive.ts b/src/renderer/src/hooks/useHive.ts
index 267a1e57..56ac33b7 100644
--- a/src/renderer/src/hooks/useHive.ts
+++ b/src/renderer/src/hooks/useHive.ts
@@ -7,6 +7,22 @@ const GOD_PTY = `pty-${GOD_ID}`;
const ASSISTANT_ID = 'assistant';
const ASSISTANT_PTY = `pty-${ASSISTANT_ID}`;
+// How long to let Claude Code's TUI finish booting before we type the first
+// thing into Michael's terminal, and the gap between the remote-control command
+// and the orientation prompt so the slash command settles first.
+const GOD_BOOT_MS = 4000;
+const GOD_STEP_MS = 1800;
+
+// The first thing Michael (god) is told on a fresh spawn — orient him and put
+// him to work running the floor. Kept terse and action-oriented.
+const INITIAL_GOD_PROMPT = [
+ "You're online as Michael, the orchestrator of the hive. Get oriented, then start running the floor:",
+ '1. Read your memory.md and drain every message in your inbox.',
+ '2. Review board.md and the current roster of agents (active vs archived).',
+ '3. Run `mempalace wake-up` for a memory digest if the CLI is available.',
+ 'Then begin orchestrating: triage requests, delegate work to the team, and keep everyone unblocked. You are fully autonomous — there is no approval queue, so handle tool-permission prompts in this session yourself (the human can approve them remotely from their phone).'
+].join('\n');
+
/**
* Type a line into an agent's Claude Code TUI and actually submit it.
*
@@ -75,6 +91,7 @@ export function useHive(config: HarnessConfig | null): void {
useEffect(() => {
if (!config?.onboardingComplete || !config.harnessHome) return;
let cancelled = false;
+ const timers: ReturnType<typeof setTimeout>[] = [];
useStore.getState().setGodStatus('booting');
const t = setTimeout(async () => {
if (cancelled) return;
@@ -122,8 +139,22 @@ export function useHive(config: HarnessConfig | null): void {
};
useStore.getState().addAgent(god);
useStore.getState().setGodStatus('ready');
+
+ // Fresh spawn → kick Michael off once his TUI is up. First enable remote
+ // control so the human can approve permission prompts from their phone
+ // (best-effort — a failed/unknown slash command just prints to his terminal
+ // and is harmless), then hand him the orientation prompt to start running
+ // the floor. Restored sessions (the live-PTY branch above) skip this.
+ timers.push(setTimeout(() => {
+ if (cancelled) return;
+ submitToPty(GOD_PTY, '/remote-control').catch(() => { /* best-effort */ });
+ timers.push(setTimeout(() => {
+ if (cancelled) return;
+ submitToPty(GOD_PTY, INITIAL_GOD_PROMPT).catch(() => { /* pty may have died */ });
+ }, GOD_STEP_MS));
+ }, GOD_BOOT_MS));
}, 1200);
- return () => { cancelled = true; clearTimeout(t); };
+ return () => { cancelled = true; clearTimeout(t); timers.forEach(clearTimeout); };
}, [config?.onboardingComplete, config?.harnessHome]);
// 1b) Bootstrap Michael's prep assistant ("Dwight") — only after Michael is