Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Keep an unsent message when you leave the conversation (#11)
Gian Moraes613fc98e16a8
diff --git a/src/renderer/src/components/Conversation.tsx b/src/renderer/src/components/Conversation.tsxindex 982c201..0d636a8 100644--- a/src/renderer/src/components/Conversation.tsx+++ b/src/renderer/src/components/Conversation.tsx@@ -756,9 +756,15 @@ async function prepareImage(file: File): Promise<Attached | string> {}}+// One draft per conversation, kept while the app runs: leaving a channel doesn't+// lose the message you were typing.+const drafts = new Map<string, { text: string; images: Attached[] }>()+export function Composer({ conversationId, members, placeholder }: { conversationId: string; members: Agent[]; placeholder: string }): ReactNode {- const [text, setText] = useState('')- const [images, setImages] = useState<Attached[]>([])+ // The field starts with the conversation's draft, not empty: StrictMode (in dev) unmounts+ // and mounts again at once, and saving an empty first render would wipe the draft.+ const [text, setText] = useState(() => drafts.get(conversationId)?.text ?? '')+ const [images, setImages] = useState<Attached[]>(() => drafts.get(conversationId)?.images ?? [])const [note, setNote] = useState('')const [dragging, setDragging] = useState(false)const picker = useRef<HTMLInputElement>(null)@@ -773,11 +779,21 @@ export function Composer({ conversationId, members, placeholder }: { conversatioreturn q?.author.kind === 'agent' ? agentById(s, q.author.id)?.name : undefined})+ // What's typed but not sent, per conversation, so leaving a channel and coming+ // back keeps it (like a draft). In memory: closing the app drops the drafts.+ const live = useRef({ text, images })+ live.current = { text, images }useEffect(() => {- setText('')- setImages([])+ const draft = drafts.get(conversationId)+ setText(draft?.text ?? '')+ setImages(draft?.images ?? [])setNote('')ref.current?.focus()+ return () => {+ const { text, images } = live.current+ if (text.trim() || images.length) drafts.set(conversationId, { text, images })+ else drafts.delete(conversationId)+ }}, [conversationId])const addFiles = async (files: File[]): Promise<void> => {@@ -869,6 +885,7 @@ export function Composer({ conversationId, members, placeholder }: { conversatiotext,images.map(({ name, mime, data }) => ({ name, mime, data })))+ drafts.delete(conversationId)setText('')setImages([])setNote('')