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
feat(realtime): rt-7 dual-orchestrator coordination (Realtime Michael P2)
Chaitanya Giri85c4684e1c09
diff --git a/src/main/realtimeActions.ts b/src/main/realtimeActions.tsindex b07a396e..97346e8a 100644--- a/src/main/realtimeActions.ts+++ b/src/main/realtimeActions.ts@@ -203,6 +203,30 @@ function attribute(deps: RealtimeActionDeps, verb: string, target: string, extra} catch {/* attribution is best-effort — never block the action */}+ // rt-7 dual-orchestrator coord: tell the god PTY what voice-Michael just COMMITTED, so+ // the two autonomous orchestrators stay aware and don't make duplicate/contradictory+ // moves. attribute() only runs on committed writes (soft execs + post-confirm commits),+ // so god is never notified for a merely-proposed/uncommitted destructive action.+ try {+ const detail =+ typeof extra.objective === 'string' ? `: ${extra.objective}`+ : typeof extra.text === 'string' ? `: ${extra.text}`+ : typeof extra.title === 'string' ? `: ${extra.title}`+ : typeof extra.status === 'string' ? ` → ${extra.status}`+ : typeof extra.action === 'string' ? ` (${extra.action})`+ : '';+ deps.hiveSend(+ {+ to: 'god',+ act: 'inform',+ subject: `voice action: ${verb} ${target}`,+ body: `Michael (voice orchestrator, ${VOICE_ACTOR}) just did: ${verb} on ${target}${detail}. Heads-up so we don't duplicate — the board is the single source of truth.`+ },+ VOICE_ACTOR+ );+ } catch {+ /* god cross-notify is best-effort — never block the action */+ }}function findTasks(deps: RealtimeActionDeps): HiveTask[] {diff --git a/src/renderer/src/realtime/session.ts b/src/renderer/src/realtime/session.tsindex c6bc6a20..8d00d1a3 100644--- a/src/renderer/src/realtime/session.ts+++ b/src/renderer/src/realtime/session.ts@@ -72,6 +72,8 @@ WHAT YOU CAN DO. Beyond reporting, you can now ACT on the hive by voice: ping anCONFIRMATION POLICY (safety-critical). For any destructive or expensive action: (1) call the tool, which returns a spoken echo-back naming the exact action and target; (2) say that echo-back and ASK the human to confirm; (3) only after they clearly confirm — by saying the word "confirm" or the action verb itself, for example "confirm" or "kill", and NEVER just "yes" — call confirm_action with their exact words; (4) if they decline, hesitate, or change the subject, call cancel_action. Never confirm on the human's behalf, never treat a bare "yes" or ambient speech as consent, and if you're unsure whether they really confirmed, ask again rather than acting. Killing the god orchestrator and acting on all agents at once are forbidden — if asked, refuse and say why. Every action you take is attributed to you as michael-voice. Never claim to have done something you didn't, and never invent state.+SHARED FLOOR (you are not the only orchestrator). god — the typing orchestrator — also acts on this hive, and every action you take is announced to god as michael-voice. The task board is the single source of truth. Before you dispatch work, create or assign tasks, or hire, glance at recent activity (your get_activity tool, and the snapshot you were given) so you don't duplicate or contradict something god just did. If you see god already handled what's asked, say so instead of doing it again.+INTERACTION. If a request is ambiguous, briefly confirm what you understood before answering. Keep the human oriented and in control.`;let state: RealtimeMichaelState = {diff --git a/src/renderer/src/realtime/tools.ts b/src/renderer/src/realtime/tools.tsindex 92a2895d..1aed6ec5 100644--- a/src/renderer/src/realtime/tools.ts+++ b/src/renderer/src/realtime/tools.ts@@ -369,19 +369,41 @@ export function realtimeReadTools(): ReturnType<typeof tool>[] {*/export async function realtimeSessionSummary(): Promise<string> {try {- const [reg, tasksRaw] = await Promise.all([window.cth.hiveRegistry(), window.cth.hiveTasks()]);+ // rt-7: also pull the recent hive log so the warm-start carries what the OTHER+ // orchestrator (god) + the floor have just been doing — dual-orchestrator awareness+ // so voice-Michael doesn't duplicate or contradict god's moves.+ const [reg, tasksRaw, logRaw] = await Promise.all([+ window.cth.hiveRegistry(),+ window.cth.hiveTasks(),+ window.cth.hiveLog(20).catch(() => [] as unknown[])+ ]);const agents = Object.entries(obj(reg.agents));const active = agents.filter(([, a]) => !obj(a).archived).length;const godName = reg.godId ? str(obj(obj(reg.agents)[reg.godId]).name) || reg.godId : null;const list = Array.isArray(obj(tasksRaw).tasks) ? (obj(tasksRaw).tasks as unknown[]) : [];const doing = list.map(obj).filter((t) => str(t.status) === 'doing').length;const blocked = list.map(obj).filter((t) => str(t.status) === 'blocked').length;+ // Last few meaningful events (spawns, messages, voice actions), newest first.+ const events = Array.isArray(logRaw) ? logRaw : [];+ const recent = events+ .slice(-6)+ .reverse()+ .map((e) => {+ const o = obj(e);+ const kind = str(o.kind) || str(o.event) || 'event';+ const who = str(o.actor) || str(o.from) || str(o.agentId) || str(o.name);+ return who ? `${kind} by ${who}` : kind;+ })+ .filter(Boolean);+ const activity = recent.length ? ` Recent floor activity: ${recent.join('; ')}.` : '';return (`Current hive snapshot: ${plural(active, 'agent')} active` +- `${godName ? `, ${godName} orchestrating` : ''}; ` ++ `${godName ? `, ${godName} orchestrating alongside you` : ''}; ` +`${doing} task${doing === 1 ? '' : 's'} in progress` +- `${blocked ? ` and ${plural(blocked, 'blocked')}` : ''}. ` +- `Use your read-tools for live detail before answering specifics.`+ `${blocked ? ` and ${plural(blocked, 'blocked')}` : ''}.` ++ activity ++ ` You share the floor with god (the typing orchestrator) — before you dispatch or create work,` ++ ` glance at recent activity so you don't duplicate what god just did. Use your read-tools for live detail.`);} catch {return '';