Let workers ask each other through the coordinator in chatrooms
A worker asks for another bot's help with ask_crew. The coordinator reads the request, asks the right bot (in a workspace, only its members), and sends the answer back into the asking bot's conversation, waking it. Each exchange is kept as a read-only chatroom: listed in the main rail after the workspaces, or in the workspace's rail for requests made there, with live status rows for each bot while it's open and a Stop button. Room sessions are hidden from every conversation list, other bots' words reach the model fenced as data, and turns, nesting and open rooms are capped. Closed rooms are pruned after a retention period and past a cap per place (Settings > General). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -25,6 +25,11 @@ type Params = {
|
||||
* (`grabAttachableMedia`).
|
||||
*/
|
||||
media?: BUN_SQLITE_COBBLE_MEDIA[];
|
||||
/**
|
||||
* Brings a chatroom's outcome back to the bot that asked: stored on the
|
||||
* user's side (the bot answers it), shown as from the coordinator.
|
||||
*/
|
||||
from_chatroom_id?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -40,6 +45,7 @@ export default async function insertUserMessage({
|
||||
text,
|
||||
reply_to,
|
||||
media = [],
|
||||
from_chatroom_id,
|
||||
}: Params): Promise<BotMessageWithAttachments> {
|
||||
const now = Date.now();
|
||||
|
||||
@@ -57,6 +63,7 @@ export default async function insertUserMessage({
|
||||
text,
|
||||
needs_you: 0,
|
||||
reply_to_message_id: reply_to?.id || undefined,
|
||||
from_chatroom_id,
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -88,6 +95,7 @@ export default async function insertUserMessage({
|
||||
text,
|
||||
needs_you: 0,
|
||||
reply_to_message_id: reply_to?.id || undefined,
|
||||
from_chatroom_id,
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
attachments: media.map((file) => mediaToAttachment({ media: file })),
|
||||
|
||||
Reference in New Issue
Block a user