Bots: multiple instances with groups and hand-offs (§14, B1–B5) #8

Merged
kubus merged 12 commits from t3/multi-hatbot-instances into main 2026-10-14 22:20:13 +00:00
Owner

Summary

  • Bots model (migration 20): each bot has a name, instructions (role), chat model and effort, and plugin allowlist. Hatbot is bot #1 and cannot be deleted.
  • Direct chats: one conversation per bot, created on-demand. Hatbot's direct chat remains at /thread/* for app compatibility.
  • Memory: each bot has its own folder (bots/<id>/) with INDEX.md for notes. Root INDEX.md and skills/ are shared across bots.
  • Hand-offs: ask_bot(bot, request) runs a task owned by the other bot and reports the result back. Depth capped at 3 levels. Taint carries both ways.
  • Desktop: per-bot Chromium profile (--user-data-dir), switched with POST /browser/profile. Service replaces autostart Chromium; requires infra/deploy.sh.
  • Group chats (low priority, minimal UI): 2–6 bots and you; @name picks who answers; up to 4 bot replies per message from you. No incognito in groups.
  • Spend: global limits only ($10/day, $200/month, $3/task). Ledger records which bot incurred each cost. Notifications name the bot when it isn't Hatbot.
  • API: /bots (CRUD), /conversations/:id (list, create, edit, delete). Events carry botId and conversationId; messages show sender name in groups.
  • Web: sidebar redesigned as a bot list with unread counts; new bot and group pages; "@" autocompletes in the composer.
  • iOS: bot list in drawer; new bot and group pages; models updated. Syntax-checked only.

Testing

  • 214 brain and desktop-agent tests pass (up from 145); 31 iOS core tests pass (up from 19).
  • Web views manually tested in headless Chromium: chat list, bot and group pages, schedule's "Runs as" dropdown, @ autocomplete, sender names above message runs.
  • iOS views syntax-checked in Xcode only (not run in simulator).
  • One pre-existing desktop-agent shell test fails on this machine (was failing before this work).
  • Not tried live: two bots answering together in a group with the real model; per-bot Chromium profiles on the real desktop.
## Summary - **Bots model** (migration 20): each bot has a name, instructions (role), chat model and effort, and plugin allowlist. Hatbot is bot #1 and cannot be deleted. - **Direct chats**: one conversation per bot, created on-demand. Hatbot's direct chat remains at `/thread/*` for app compatibility. - **Memory**: each bot has its own folder (`bots/<id>/`) with `INDEX.md` for notes. Root `INDEX.md` and `skills/` are shared across bots. - **Hand-offs**: `ask_bot(bot, request)` runs a task owned by the other bot and reports the result back. Depth capped at 3 levels. Taint carries both ways. - **Desktop**: per-bot Chromium profile (`--user-data-dir`), switched with `POST /browser/profile`. Service replaces autostart Chromium; requires `infra/deploy.sh`. - **Group chats** (low priority, minimal UI): 2–6 bots and you; `@name` picks who answers; up to 4 bot replies per message from you. No incognito in groups. - **Spend**: global limits only ($10/day, $200/month, $3/task). Ledger records which bot incurred each cost. Notifications name the bot when it isn't Hatbot. - **API**: `/bots` (CRUD), `/conversations/:id` (list, create, edit, delete). Events carry `botId` and `conversationId`; messages show sender name in groups. - **Web**: sidebar redesigned as a bot list with unread counts; new bot and group pages; "@" autocompletes in the composer. - **iOS**: bot list in drawer; new bot and group pages; models updated. Syntax-checked only. ## Testing - 214 brain and desktop-agent tests pass (up from 145); 31 iOS core tests pass (up from 19). - Web views manually tested in headless Chromium: chat list, bot and group pages, schedule's "Runs as" dropdown, @ autocomplete, sender names above message runs. - iOS views syntax-checked in Xcode only (not run in simulator). - One pre-existing desktop-agent shell test fails on this machine (was failing before this work). - Not tried live: two bots answering together in a group with the real model; per-bot Chromium profiles on the real desktop.
When a task started from the chat finishes or fails, the chat model gets
its result straight away, with the conversation in context, and writes a
reply of its own instead of the result only showing under the old reply.
Cancelled ones stay quiet, and so do routine results. Scheduled and
triggered tasks still wait for your next message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Migration 20 adds bots, conversations and their members, and a bot or
conversation on messages, tasks, approvals, schedules, triggers and spend.
One Thread per conversation, run by Chats; /thread stays Hatbot's chat.
New: /conversations, /bots and /spend/by-bot. Each bot gets its own
prompt, plugins, model and bots/<id>/ memory folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sidebar lists your bots' chats with unread counts and New bot; on a
phone the chat's name switches chats. A bot's page sets its name, role,
model, effort and plugins, and links its notes. Schedules and triggers
pick the bot they run as, and Spend shows each bot's share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the chat it shows under the reply and the asking bot passes on the
result; from a task, the task waits for it without holding a slot. What
the asker had read goes with it, a tainted result taints the asker, and
hand-offs nest at most 3 deep. Hatbot on its own isn't offered the tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chromium becomes hatbot-chromium.service, on the profile desktop-agent last
asked for. A desktop task asks for its bot's profile when it takes the
screen; switching closes Chromium, which comes back on the new one.
Hatbot keeps chrome-profile; other bots get chrome-profiles/<id>. An
older desktop-agent, or one without the service, keeps the one profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kubus merged commit 0e97b50050 into main 2026-10-14 22:20:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kubus/hatbot!8
No description provided.