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(antigravity): Gemini workers receive hive mail directly (canReceiveInbox)

Gulum04ade5361628
diff --git a/src/main/hive.ts b/src/main/hive.ts
index 1d00fedf..0c02ace0 100644
--- a/src/main/hive.ts
+++ b/src/main/hive.ts
@@ -27,7 +27,7 @@ import { spawnSync } from 'node:child_process';
import { randomBytes, createHash } from 'node:crypto';
import type { AgentUsageSample } from './usage';
import { COMMAND_GROUPS } from '../shared/claudeCommands';
-import { isHiveAwareProvider, providerPreset, type AgentProvider } from '../shared/agentProvider';
+import { isHiveAwareProvider, canReceiveInbox, providerPreset, type AgentProvider } from '../shared/agentProvider';
// ─── Types ──────────────────────────────────────────────────────────────────
@@ -560,15 +560,15 @@ export class HiveManager {
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, any archived agent (closed tab), and non-hive-aware providers
- // (e.g. Antigravity's agy — they never drain an inbox) so mail never piles
- // into a dead inbox no one will read. A broadcast just skips them; their
- // god relays anything they actually need (direct mail to them bounces).
+ // assistant, any archived agent (closed tab), and providers that can't
+ // drain an inbox (hookless custom commands) so mail never piles into a dead
+ // inbox no one reads. Claude AND Antigravity workers ARE included — agy
+ // drains its inbox via the agy-hook Stop→drain bridge.
? Object.keys(reg.agents).filter((a) =>
a !== msg.from
&& !reg.agents[a]?.isAssistant
&& !reg.agents[a]?.archived
- && isHiveAwareProvider(reg.agents[a]?.provider))
+ && canReceiveInbox(reg.agents[a]?.provider))
// 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) {
@@ -587,16 +587,15 @@ export class HiveManager {
}, godId);
continue;
}
- // Non-Claude workers (e.g. Antigravity's `agy`) don't run the hive's Stop
- // hook, so they never drain their inbox — direct mail would rot unread.
- // Bounce it to the god (the same way assistant mail bounces) so the
- // orchestrator relays it as a live prompt instead. God himself is exempt
- // (he may legitimately run on any provider and is the bounce target).
- if (t !== godId && !isHiveAwareProvider(reg.agents[t]?.provider)) {
+ // A provider with no way to drain its inbox (a hookless custom command)
+ // would let direct mail rot unread — bounce it to the god to relay as a
+ // live prompt. Claude + Antigravity drain their inbox (Stop hook / agy-hook
+ // bridge), so they receive directly. God is exempt (the bounce target).
+ if (t !== godId && !canReceiveInbox(reg.agents[t]?.provider)) {
this.deliver({
...msg,
to: godId,
- subject: `[bounced — "${t}" runs ${reg.agents[t]?.provider ?? 'a non-Claude CLI'} and can't read its hive inbox; relay this to it] ${msg.subject}`
+ subject: `[bounced — "${t}" runs ${reg.agents[t]?.provider ?? 'a hookless CLI'} and can't drain its hive inbox; relay this to it] ${msg.subject}`
}, godId);
continue;
}
diff --git a/src/shared/agentProvider.ts b/src/shared/agentProvider.ts
index 18eb107e..0eea3a37 100644
--- a/src/shared/agentProvider.ts
+++ b/src/shared/agentProvider.ts
@@ -25,8 +25,15 @@ export interface AgentProviderPreset {
autoFlag?: string;
/** Claude Code accepts the hive identity injection (`--append-system-prompt`
* + hook `--settings`). Other CLIs don't — they spawn with the shared AGENT_*
- * env only, and direct hive mail to them bounces to the god. */
+ * env only. Gates the Claude-specific spawn injection in hive.ensureAgent. */
hiveAware: boolean;
+ /** Whether the router may DELIVER inbox mail to this provider (vs bouncing it
+ * to the god). Requires a way for the agent to actually drain its inbox: Claude
+ * via its Stop hook, Antigravity via the agy-hook bridge's Stop→drain. A
+ * provider with no hook surface (custom) can't, so its mail still bounces.
+ * Distinct from hiveAware: agy is NOT hiveAware (no Claude injection) but CAN
+ * receive inbox (it has the bridged Stop-drain hook). */
+ canReceiveInbox: boolean;
/** For non-hive-aware CLIs that still take an INITIAL prompt to orient the
* session (Antigravity's `agy -i "<prompt>"`), the flag to pass it under. The
* hive identity+protocol rides in as the first turn — the closest thing to
@@ -42,7 +49,8 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [
supportsModel: true,
modelFlag: '--model',
autoFlag: '--permission-mode bypassPermissions',
- hiveAware: true
+ hiveAware: true,
+ canReceiveInbox: true
},
{
id: 'antigravity',
@@ -52,6 +60,7 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [
modelFlag: '--model',
autoFlag: '--dangerously-skip-permissions',
hiveAware: false,
+ canReceiveInbox: true, // via the agy-hook bridge (Stop→drain); verified agy honors hook decisions
initialPromptFlag: '-i' // agy --prompt-interactive: orient the session, then continue
},
{
@@ -59,7 +68,8 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [
label: 'Custom',
defaultCommand: '',
supportsModel: false,
- hiveAware: false
+ hiveAware: false,
+ canReceiveInbox: false // no hook surface to drain an inbox → mail bounces to the god
}
];
@@ -84,6 +94,14 @@ export function isHiveAwareProvider(provider: AgentProvider | undefined): boolea
return providerPreset(provider ?? 'claude').hiveAware;
}
+/** Whether the router may deliver inbox mail to this provider (else bounce to
+ * the god). True for any provider that can actually drain its inbox — Claude
+ * and Antigravity (via the agy-hook Stop→drain bridge); false for hookless
+ * custom commands. */
+export function canReceiveInbox(provider: AgentProvider | undefined): boolean {
+ return providerPreset(provider ?? 'claude').canReceiveInbox;
+}
+
/** The bare executable from a command string ('agy --model x' → 'agy'). */
function commandBinary(command: string | undefined): string {
const first = (command ?? '').trim().split(/\s+/)[0] ?? '';