Files
cobble/src/pages/admin/chatrooms/[chatroom_id]/(partials)/chatroom-stop-button.tsx
T
tbenandClaude Opus 5.5 7b762fd384 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]>
2026-10-27 18:57:34 +01:00

29 lines
980 B
TypeScript

import { useState } from "react";
import { Square } from "lucide-react";
import HeaderIconButton from "@/src/components/general/header-icon-button";
import stopChatroomRequest from "../(functions)/stop-chatroom-request";
type Props = {
chatroom_id: number;
};
/**
* Stops an open room after a confirm: everything in it that could still
* run is cancelled and the bot that asked is told.
*/
export default function ChatroomStopButton({ chatroom_id }: Props) {
const [loading, setLoading] = useState(false);
const stop = async () => {
if (!window.confirm(`Stop this request? The bot that asked is told it was stopped.`)) return;
setLoading(true);
const res = await stopChatroomRequest({ chatroom_id }).catch(() => null);
setLoading(false);
if (!res?.success) window.alert(res?.msg || `Couldn't stop it.`);
};
return <HeaderIconButton icon={Square} title="Stop this request" loading={loading} onClick={stop} />;
}