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(composer): add "Delegate to agents" toggle for the god agent

Chaitanya Giri8c8b2e7695c2
diff --git a/src/renderer/src/components/MessageQueueComposer.tsx b/src/renderer/src/components/MessageQueueComposer.tsx
index cfb118e1..7f522ab0 100644
--- a/src/renderer/src/components/MessageQueueComposer.tsx
+++ b/src/renderer/src/components/MessageQueueComposer.tsx
@@ -1,10 +1,15 @@
-import { KeyboardEvent } from 'react';
+import { KeyboardEvent, useState } from 'react';
import { PixelButton } from './PixelButton';
import { Icon } from './Icon';
import { useStore, type Agent, type QueuedMessage } from '@/store/store';
const EMPTY_QUEUE: QueuedMessage[] = [];
+// Prepended (only to the enqueued value, never the visible draft) when the
+// god/Michael agent has the "Delegate to agents" toggle ON.
+const DELEGATE_PREFIX =
+ "Delegate to other available agents as mentioned if no agents available do it yourself one by one the user's message starts now: ";
+
export interface MessageQueueComposerProps {
agent: Agent;
}
@@ -28,9 +33,13 @@ export function MessageQueueComposer({ agent }: MessageQueueComposerProps) {
const idle = agent.status === 'idle';
+ // Only the god/Michael agent gets the delegation toggle. Default OFF.
+ const [delegate, setDelegate] = useState(false);
+
const queueIt = () => {
if (!text.trim()) return;
- enqueueMessage(agent.id, text);
+ const out = delegate ? DELEGATE_PREFIX + text : text;
+ enqueueMessage(agent.id, out);
setText('');
};
@@ -158,6 +167,18 @@ export function MessageQueueComposer({ agent }: MessageQueueComposerProps) {
outline: 'none'
}}
/>
+ {agent.isGod && (
+ <PixelButton
+ variant={delegate ? 'primary' : 'secondary'}
+ size="md"
+ onClick={() => setDelegate((d) => !d)}
+ title="Prepend a delegation instruction so Michael hands the task to other available agents (or does it himself one-by-one if none are free)."
+ >
+ <span style={{ display: 'inline-flex', gap: 6, alignItems: 'center' }}>
+ {delegate && <Icon name="check" />} Delegate
+ </span>
+ </PixelButton>
+ )}
<PixelButton variant="primary" size="md" onClick={queueIt} disabled={!text.trim()}>
<span style={{ display: 'inline-flex', gap: 6, alignItems: 'center' }}>
send <Icon name="arrow-right" />
diff --git a/src/renderer/src/components/PixelButton.tsx b/src/renderer/src/components/PixelButton.tsx
index 13a0ddea..33dbbe08 100644
--- a/src/renderer/src/components/PixelButton.tsx
+++ b/src/renderer/src/components/PixelButton.tsx
@@ -11,6 +11,7 @@ export interface PixelButtonProps {
disabled?: boolean;
fullWidth?: boolean;
style?: CSSProperties;
+ title?: string;
}
const heightBySize: Record<Size, number> = { sm: 24, md: 32, lg: 40 };
@@ -23,7 +24,8 @@ export function PixelButton({
onClick,
disabled = false,
fullWidth = false,
- style
+ style,
+ title
}: PixelButtonProps) {
const [pressed, setPressed] = useState(false);
const [hover, setHover] = useState(false);
@@ -63,6 +65,7 @@ export function PixelButton({
return (
<button
+ title={title}
onClick={disabled ? undefined : onClick}
onMouseDown={() => setPressed(true)}
onMouseUp={() => setPressed(false)}