Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

feat(templates): a writer and a checker that check work before it reaches you (#6868)

Milind Soni1210eeec7738
diff --git a/apps/docs/content/docs/features/chat-and-teams.mdx b/apps/docs/content/docs/features/chat-and-teams.mdx
index 801f9d2eea..f4ec3efc8f 100644
--- a/apps/docs/content/docs/features/chat-and-teams.mdx
+++ b/apps/docs/content/docs/features/chat-and-teams.mdx
@@ -114,6 +114,12 @@ A bot doesn't need a teammate to get work done on another model. It can open a t
A provider that is signed out or unavailable shows in `list_models` with the reason, and a thread on it is refused when it is opened, so a second opinion never quietly comes from the bot's own model. These threads can't be opened from a group chat, and a thread opened this way can't open more of its own.
+### Work that is checked before it reaches you
+
+**Templates** has a pair made for careful edits: **Nib**, a writer and editor, and **Vera**, a checker. Nib changes only what you ask and lists every change. Before it gives you a draft or an edit of a document, it hands its result to the teammate whose role is Checker, with your request and the source as files (a file you attached is passed on as it is), and tells you in one line that the work is being checked. The result itself is visible on the hand-off line as a file you can open, but Nib's answer to you waits for the check. Vera compares the result with both and reports every changed fact, added detail, missed instruction and regression, answering "pass" only when there are none. Nib fixes what the report names and sends the files again, up to three rounds (the app refuses more than four reworks of one request to the same teammate), then gives you the result with one line about the check: who checked it, in how many rounds, and what is still open if it never passed. Without a Checker teammate, Nib asks a thread of its own on another provider's model instead; when a check can't run, the answer starts with "Not checked:" and the reason.
+
+When you add Vera, it starts on another provider's AI than your default when you have one connected, because a model rarely catches its own mistakes; the review says which. When no other AI is ready, it says so in one line and Vera uses yours.
+
### Creating a specialist with a chosen model
A Chief also adds a specialist on its own when a job needs one: an ongoing area of work, a different skill set, or work to run in parallel. The bot is created at once, the Chief tells you in one line, and the change has an **Undo**. When what you want matches a ready-made team in the library, the Chief reads its roles with `list_team_library` and creates them the same way.
diff --git a/server/bot-attachment.test.ts b/server/bot-attachment.test.ts
index bb76db128d..d62d9eef32 100644
--- a/server/bot-attachment.test.ts
+++ b/server/bot-attachment.test.ts
@@ -491,3 +491,28 @@ describe("deliveredCopy", () => {
expect(deliveredCopy([ask, peer, reply], reply, "README.md", "D:\\AI\\openmausbot-skills\\README.md")).toBeNull();
});
});
+
+describe("saveBotAttachment for a file attached to the conversation", () => {
+ it("passes on a stored file by the name it was attached with", async () => {
+ mkdirSync(ATTACHMENTS_DIR, { recursive: true });
+ const stored = join(ATTACHMENTS_DIR, "0b7f6a52-3c1d-4e8f-9a2b-5c6d7e8f9a0b.md");
+ writeFileSync(stored, "# Chapter 3");
+ const saved = await saveBotAttachment({ path: stored, roots: [WORK], attached: () => [{ path: stored, name: "chapter-3.md" }] });
+ expect(saved.attachment).toMatchObject({ kind: "file", name: "chapter-3.md" });
+ expect(readFileSync(saved.attachment.path, "utf8")).toBe("# Chapter 3");
+ const byLink = await saveBotAttachment({ path: pathToFileURL(stored).href, roots: [WORK], attached: () => [{ path: stored, name: "chapter-3.md" }] });
+ expect(byLink.attachment).toMatchObject({ name: "chapter-3.md" });
+ });
+
+ it("opens nothing outside the attachment store, whatever a tag names, and nothing in it that was not attached", async () => {
+ mkdirSync(ATTACHMENTS_DIR, { recursive: true });
+ mkdirSync(process.env.OMB_DATA_DIR!, { recursive: true });
+ const config = join(process.env.OMB_DATA_DIR!, "config.json");
+ writeFileSync(config, "{\"secret\":true}");
+ await expect(saveBotAttachment({ path: config, roots: [WORK], attached: () => [{ path: config, name: "config.json" }] }))
+ .rejects.toMatchObject({ status: 403 });
+ const other = join(ATTACHMENTS_DIR, "1c8e7b63-4d2e-4f9a-8b3c-6d7e8f9a0b1c.md");
+ writeFileSync(other, "Someone else's");
+ await expect(saveBotAttachment({ path: other, roots: [WORK], attached: () => [] })).rejects.toMatchObject({ status: 403 });
+ });
+});
diff --git a/server/bot-attachment.ts b/server/bot-attachment.ts
index e0ed0fe89b..ab30df0e62 100644
--- a/server/bot-attachment.ts
+++ b/server/bot-attachment.ts
@@ -2,7 +2,9 @@
// copied into the private store, so the chat never reaches into a bot's workspace or VM home afterwards.
import { createHash, createHmac, randomBytes } from "node:crypto";
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
-import { basename, join, posix } from "node:path";
+import { realpath } from "node:fs/promises";
+import { basename, dirname, join, posix } from "node:path";
+import { fileURLToPath, pathToFileURL } from "node:url";
import { DATA_DIR } from "./config.ts";
import { openInboxFile, type InboxRead } from "./host/handoff-inbox.ts";
import {
@@ -15,6 +17,7 @@ import {
saveImage,
} from "./attachments.ts";
import { mimeFor, openFileSavedSince, openMessageFile, referencedPathIdentity, type OpenedMessageFile } from "./message-file.ts";
+import type { ConversationAttachment } from "./conversation-attachments.ts";
import type { Message } from "./store.ts";
export type BotAttachment = NonNullable<Message["attachments"]>[number];
@@ -67,6 +70,9 @@ export interface SaveBotAttachmentInput {
/** The conversation's inbox of files other bots passed it: a place the bot may also send from, read without
* following any link (server/host/handoff-inbox.ts). */
inbox?: InboxRead;
+ /** Stored files attached to this conversation (server/conversation-attachments.ts): each may be sent by its exact path.
+ * Read only when a path is outside every other place a bot may send from. */
+ attached?: () => readonly ConversationAttachment[];
}
let nameKey: Buffer | undefined;
@@ -105,7 +111,7 @@ async function sha256Of(file: OpenedMessageFile): Promise<string> {
/** Only the roots' outside_workspace refusal falls through, so a missing or oversized file in the folder says exactly that.
* Opened at the store's limit, not the preview one: the copy streams, and a person may send the same size. A path the
* roots do not hold is tried in the conversation's inbox before anything else. */
-async function openSource(path: string, roots: readonly string[], savedThisTurn: SaveBotAttachmentInput["savedThisTurn"], inbox: InboxRead | undefined): Promise<OpenedMessageFile> {
+async function openSource(path: string, roots: readonly string[], savedThisTurn: SaveBotAttachmentInput["savedThisTurn"], inbox: InboxRead | undefined, attached?: () => readonly ConversationAttachment[]): Promise<OpenedMessageFile> {
const href = sourceFileLink(path);
try {
return await openMessageFile(href, roots, FILE_MAX_BYTES);
@@ -113,11 +119,30 @@ async function openSource(path: string, roots: readonly string[], savedThisTurn:
const status = (error as { status?: unknown } | null)?.status, outside = (error as { code?: unknown } | null)?.code === "outside_workspace";
const received = inbox && (outside || status === 404) ? await openInboxFile(path, inbox, FILE_MAX_BYTES) : null;
if (received) return { ...received, mime: mimeFor(received.name) };
+ const stored = outside || status === 404 ? await openAttached(path, attached) : null;
+ if (stored) return stored;
if (!savedThisTurn || !outside) throw error;
return openFileSavedSince(href, savedThisTurn, FILE_MAX_BYTES);
}
}
+/** Opened under the name it was attached with, since the store names its files by an id. Security: only a file directly
+ * in the attachment store; a tag naming anything else on disk opens nothing. */
+async function openAttached(path: string, list: (() => readonly ConversationAttachment[]) | undefined): Promise<OpenedMessageFile | null> {
+ let local = path;
+ if (/^file:/i.test(path)) {
+ try { local = fileURLToPath(path); } catch { return null; }
+ }
+ const [wanted, store] = await Promise.all([realpath(local).catch(() => null), realpath(ATTACHMENTS_DIR).catch(() => null)]);
+ if (!wanted || !store || dirname(wanted) !== store) return null;
+ const attached = list?.() ?? [];
+ const listed = await Promise.all(attached.map((one) => realpath(one.path).catch(() => null)));
+ const index = listed.indexOf(wanted);
+ if (index < 0) return null;
+ const file = await openMessageFile(pathToFileURL(wanted).href, [dirname(wanted)], FILE_MAX_BYTES);
+ return { ...file, name: attached[index]!.name };
+}
+
const contentSaves = new Map<string, Promise<unknown>>();
/** One save at a time for each stored name, so exactly one of two saves of the same bytes is the one that stored them. */
async function oneAtATime<T>(id: string, save: () => Promise<T>): Promise<T> {
@@ -147,7 +172,7 @@ export async function saveBotAttachment(input: SaveBotAttachmentInput): Promise<
// A bot with a VM works in it: a relative path means its VM workspace first.
const roots = input.guest ? [input.guest.host, ...input.roots] : input.roots;
// A VM turn's tools never wrote to the host, so it gets roots only.
- const file = await openSource(guestHost ?? requested, roots, input.guest ? undefined : input.savedThisTurn, guestHost ? undefined : input.inbox);
+ const file = await openSource(guestHost ?? requested, roots, input.guest ? undefined : input.savedThisTurn, guestHost ? undefined : input.inbox, guestHost ? undefined : input.attached);
try {
const mime = mimeFor(file.name);
const name = displayNameFor(input.name, file.name);
diff --git a/server/checked-handoff.e2e.test.ts b/server/checked-handoff.e2e.test.ts
new file mode 100644
index 0000000000..f60f37a8be
--- /dev/null
+++ b/server/checked-handoff.e2e.test.ts
@@ -0,0 +1,122 @@
+import { existsSync, readFileSync, writeFileSync } from "node:fs";
+import { join } from "node:path";
+import { expect, it } from "vitest";
+import { launchVerificationServer, runControlOmb } from "../scripts/control-omb.ts";
+import { request } from "../scripts/mcp-server.ts";
+import { coordinateMessageMax } from "./too-long.ts";
+
+// A worker hands its result to a checker with the person's request and source: both must arrive whole, or the check
+// compares against something the person never gave.
+
+const told = (turn: any): string => {
+ const content = turn.prompt?.message?.content;
+ return `${turn.system}\n${typeof content === "string" ? content : JSON.stringify(content ?? "")}`;
+};
+
+async function fixture(test: (f: any) => Promise<void>) {
+ const session = await launchVerificationServer({ ...process.env }, undefined, undefined, undefined, undefined, { scripted: true });
+ const cli = (...args: string[]) => runControlOmb(args, { env: { OPENMAUSBOT_URL: session.info.url } }) as Promise<any>;
+ const api = (path: string, options: RequestInit = {}) => request(path, options, session.info.url) as Promise<any>;
+ try {
+ const worker = (await cli("new-bot", "--name", "Nib")).bot;
+ const checker = (await cli("new-bot", "--name", "Vera")).bot;
+ const dataDir = session.info.dataDir as string;
+ const planPath = join(dataDir, "room-plan.json");
+ const turns = (botId: string) => (existsSync(`${planPath}.evidence.jsonl`)
+ ? readFileSync(`${planPath}.evidence.jsonl`, "utf8").trim().split("\n").filter(Boolean).map((line) => JSON.parse(line)) : [])
+ .filter((turn: any) => turn.botId === botId);
+ const send = async (plan: Record<string, unknown>, text: string) => {
+ writeFileSync(planPath, JSON.stringify(plan));
+ await cli("send", "--bot", worker.id, "--task", worker.activeTaskId, "--text", text);
+ expect((await cli("wait", "--bot", worker.id, "--task", worker.activeTaskId, "--timeout", "40")).status).toBe("settled");
+ };
+ await test({ dataDir, worker, checker, turns, send, api });
+ } finally { await session.close(); }
+}
+
+const longText = (length: number, end: string) => `${"The harbour lights came on one by one. ".repeat(Math.ceil(length / 39)).slice(0, length - end.length)}${end}`;
+
+it("carries a request as long as a hand-off takes to the checker whole, and refuses a longer one instead of cutting it", () => fixture(async (f) => {
+ const whole = longText(coordinateMessageMax, "END-OF-REQUEST");
+ const over = longText(coordinateMessageMax + 1, "LOST-TAIL");
+ f.plan = {
+ [f.worker.id]: { steps: [{ arguments: { bot_ids: [f.checker.id], message: over }, expectError: true }, { arguments: { bot_ids: [f.checker.id], message: whole } }], reply: "Sent for a check", resumeReply: "Checked" },
+ [f.checker.id]: { reply: "pass" },
+ };
+ await f.send(f.plan, "Improve the dialogue and have it checked.");
+ const refused = JSON.stringify(f.turns(f.worker.id)[0].evidence.find((entry: any) => entry.step?.arguments?.message === over).response);
+ expect(refused).toMatch(/was not run|nothing was done/);
+ const brief = told(f.turns(f.checker.id)[0]);
+ expect(brief).toContain(whole);
+ expect(brief).not.toContain("LOST-TAIL");
+}), 90_000);
+
+it("passes the file the person attached on to the checker, byte for byte, and no other stored file", () => fixture(async (f) => {
+ const chapter = `# Chapter 3\n\n${longText(40_000, "The door stayed shut.")}\n`;
+ const uploaded = await f.api(`/api/files?name=${encodeURIComponent("chapter-3.md")}`, { method: "POST", headers: { "content-type": "text/markdown" }, body: chapter });
+ const settings = join(f.dataDir, "config.json");
+ expect(existsSync(settings)).toBe(true);
+ const elsewhere = await f.api(`/api/files?name=${encodeURIComponent("other.md")}`, { method: "POST", headers: { "content-type": "text/markdown" }, body: "Not in this conversation" });
+ expect(uploaded.path).toBeTruthy();
+ f.plan = {
+ [f.worker.id]: { steps: [
+ { arguments: { bot_ids: [f.checker.id], message: "Check this too.", files: [elsewhere.path] }, expectError: true },
+ { arguments: { bot_ids: [f.checker.id], message: "And this.", files: [settings] }, expectError: true },
+ { arguments: { bot_ids: [f.checker.id], message: "Check my edit of the attached chapter against it.", files: [uploaded.path] } },
+ ], reply: "Sent for a check", resumeReply: "Checked" },
+ [f.checker.id]: { reply: "pass" },
+ };
+ await f.send(f.plan, `Improve the dialogue in this chapter.\n<attached-file path="${uploaded.path}" name="chapter-3.md" />\n<attached-file path="${settings}" name="config.json" />`);
+ const [refused, outside, sent] = f.turns(f.worker.id)[0].evidence.filter((entry: any) => entry.step?.arguments?.files).map((entry: any) => entry.response.result);
+ for (const answer of [refused, outside]) expect(JSON.stringify(answer)).toContain("Nothing was sent");
+ expect(sent.isError, JSON.stringify(sent)).toBeFalsy();
+ const receipt = JSON.parse(sent.content[0].text);
+ const { requestId, threadId } = receipt.receipts[0];
+ const landed = join(f.dataDir, "task-workspaces", f.checker.id, threadId, "inbox", "nib", requestId, "chapter-3.md");
+ expect(receipt.files).toContain("Passed chapter-3.md to @Vera");
+ expect(readFileSync(landed, "utf8")).toBe(chapter);
+}), 90_000);
+
+it("refuses a report-back thread brief longer than a hand-off carries instead of cutting it", () => fixture(async (f) => {
+ const over = longText(coordinateMessageMax + 1, "LOST-TAIL");
+ f.plan = {
+ [f.worker.id]: { steps: [{ tool: "start_thread", arguments: { title: "Second opinion", message: over, report_back: true }, expectError: true }], reply: "Could not open it" },
+ };
+ await f.send(f.plan, "Get a second opinion on this.");
+ const refused = JSON.stringify(f.turns(f.worker.id)[0].evidence.find((entry: any) => entry.step?.tool === "start_thread").response);
+ expect(refused).toContain("nothing was done");
+ expect(f.turns(f.worker.id)).toHaveLength(1);
+}), 90_000);
+
+it("says which other provider's AI a checker would start on only when asked: null with one provider, the other with two", async () => {
+ for (const extra of [[], ["codex"]] as const) {
+ const session = await launchVerificationServer({ ...process.env }, undefined, undefined, undefined, undefined, { scripted: true }, [...extra]);
+ const api = (path: string) => request(path, {}, session.info.url) as Promise<any>;
+ try {
+ const plain = await api("/api/bot-defaults");
+ expect(plain.modelSelection.instanceId).toBe("claude");
+ expect(Object.hasOwn(plain, "checkerModelSelection")).toBe(false);
+ const checker = await api("/api/bot-defaults?checker=1");
+ expect(checker.modelSelection).toEqual(plain.modelSelection);
+ if (extra.length) expect(checker.checkerModelSelection).toMatchObject({ instanceId: "codex" });
+ else expect(checker.checkerModelSelection).toBeNull();
+ } finally { await session.close(); }
+ }
+}, 120_000);
+
+it("stops a worker and a checker that never agree: rework past four to the same checker under one request is refused", () => fixture(async (f) => {
+ const send = (rework: boolean, expectError = false) => ({ arguments: { bot_ids: [f.checker.id], message: "Check result.md against chapter.md and request.md.", rework }, ...(expectError ? { expectError } : {}) });
+ f.plan = {
+ [f.worker.id]: { turns: [
+ { steps: [send(false)], reply: "Being checked." },
+ ...Array.from({ length: 4 }, () => ({ steps: [send(true)], reply: "Fixed and sent back." })),
+ { steps: [send(true, true)], reply: "Still open after the last round." },
+ ] },
+ [f.checker.id]: { reply: "issues: 1\n1. Line 1: dusk should be dawn." },
+ };
+ await f.send(f.plan, "Improve the dialogue and have it checked.");
+ await expect.poll(() => f.turns(f.worker.id).length, { timeout: 60_000 }).toBe(6);
+ const last = f.turns(f.worker.id)[5].evidence.find((entry: any) => entry.step?.arguments?.rework);
+ expect(JSON.stringify(last.response)).toContain("past the limit of 4, so nothing was sent. Stop here");
+ expect(f.turns(f.checker.id)).toHaveLength(5);
+}), 120_000);
diff --git a/server/checker-model.test.ts b/server/checker-model.test.ts
new file mode 100644
index 0000000000..48a1e1a56a
--- /dev/null
+++ b/server/checker-model.test.ts
@@ -0,0 +1,27 @@
+import { describe, expect, it } from "vitest";
+
+import { otherProviderSelection } from "./checker-model.ts";
+import type { SelectableInstance } from "./default-model-selection.ts";
+
+const ai = (instanceId: string, driverKind: string, model: string, extra: Partial<SelectableInstance> = {}): SelectableInstance => ({
+ instanceId, driverKind, snapshot: { state: "available", authenticated: true }, models: { default: model, options: [{ id: model, label: model }] }, ...extra,
+});
+const claude = ai("claude", "claudeAgent", "claude-default");
+const work = ai("claude-work", "claudeAgent", "claude-work-default");
+const codex = ai("codex", "codex", "codex-default");
+
+describe("otherProviderSelection", () => {
+ it("picks another provider's model, never a second account of the same provider", () => {
+ expect(otherProviderSelection([claude, work, codex], { instanceId: "claude", model: "claude-default" })).toEqual({ instanceId: "codex", model: "codex-default" });
+ expect(otherProviderSelection([codex, claude], { instanceId: "codex", model: "codex-default" })).toEqual({ instanceId: "claude", model: "claude-default" });
+ });
+
+ it("is null with only one provider ready: signed out, turned off, refused or OpenCode's free backup do not count", () => {
+ const signedOut = { ...codex, snapshot: { state: "available" as const, authenticated: false } };
+ const off = { ...codex, enabled: false };
+ const free = ai("opencodeGo", "opencodeGo", "free-model", { snapshot: { state: "available", authenticated: true, freeFallback: true } });
+ expect(otherProviderSelection([claude, work], { instanceId: "claude", model: "claude-default" })).toBeNull();
+ for (const other of [signedOut, off, free]) expect(otherProviderSelection([claude, other], { instanceId: "claude", model: "claude-default" })).toBeNull();
+ expect(otherProviderSelection([claude, codex], { instanceId: "claude", model: "claude-default" }, { refusal: (instance) => instance.instanceId === "codex" ? "blocked" : undefined })).toBeNull();
+ });
+});
diff --git a/server/checker-model.ts b/server/checker-model.ts
new file mode 100644
index 0000000000..4f06c92f78
--- /dev/null
+++ b/server/checker-model.ts
@@ -0,0 +1,16 @@
+import { freeFallback } from "../shared/ai-ranking.ts";
+import type { ModelSelection } from "./contracts.ts";
+import { readyToRun, selectDefaultModelSelection, type DefaultSelectionContext, type SelectableInstance } from "./default-model-selection.ts";
+
+/** The model a bot that checks other bots' work starts on: the best ready AI of another provider than `current`'s, since a
+ * model rarely catches its own mistakes. Null when no other provider is ready; OpenCode's free backup models never count. */
+export function otherProviderSelection(
+ instances: readonly SelectableInstance[],
+ current: ModelSelection,
+ context: DefaultSelectionContext = {},
+): ModelSelection | null {
+ const own = instances.find((instance) => instance.instanceId === current.instanceId)?.driverKind;
+ const others = instances.filter((instance) => instance.driverKind !== own && !freeFallback(instance) && readyToRun(instance, context));
+ const pick = selectDefaultModelSelection(others, undefined, context);
+ return pick.instanceId && pick.model ? pick : null;
+}
diff --git a/server/conversation-attachments.test.ts b/server/conversation-attachments.test.ts
new file mode 100644
index 0000000000..77e7668b57
--- /dev/null
+++ b/server/conversation-attachments.test.ts
@@ -0,0 +1,29 @@
+import { describe, expect, it } from "vitest";
+import { conversationAttachments } from "./conversation-attachments.ts";
+import { reportBackTooLong } from "./too-long.ts";
+
+describe("conversationAttachments", () => {
+ it("lists the person's attached files by the name they gave and the copies shown in the conversation", () => {
+ expect(conversationAttachments([
+ { role: "user", text: 'Edit this\n<attached-file path="/data/attachments/a.md" name="chapter.md" />' },
+ { role: "bot", text: "", attachments: [{ kind: "file", path: "/data/attachments/b.csv", mime: "text/csv", name: "table.csv" }] },
+ { role: "bot", text: "", attachments: [{ kind: "audio", path: "/data/attachments/c.m4a", mime: "audio/mp4" } as never] },
+ ])).toEqual([{ path: "/data/attachments/a.md", name: "chapter.md" }, { path: "/data/attachments/b.csv", name: "table.csv" }]);
+ });
+
+ it("never reads a tag from a bot's words, another bot's post or a hand-off line", () => {
+ const tag = '<attached-file path="/data/attachments/x.md" name="x.md" />';
+ expect(conversationAttachments([
+ { role: "bot", text: tag },
+ { role: "user", text: tag, from: { botId: "b", name: "B", color: "green" } },
+ { role: "user", text: tag, roomRequest: { id: "r", phase: "request" } },
+ ])).toEqual([]);
+ });
+});
+
+describe("reportBackTooLong", () => {
+ it("refuses a report-back brief only past a hand-off's limit", () => {
+ expect(reportBackTooLong("x".repeat(12_000))).toBeUndefined();
+ expect(reportBackTooLong("x".repeat(12_001))).toContain("nothing was done");
+ });
+});
diff --git a/server/conversation-attachments.ts b/server/conversation-attachments.ts
new file mode 100644
index 0000000000..f4b9825661
--- /dev/null
+++ b/server/conversation-attachments.ts
@@ -0,0 +1,23 @@
+import { basename } from "node:path";
+
+import { splitTranscriptAttachments } from "../src/lib/composer-attachments.ts";
+import type { Message } from "./store.ts";
+
+export interface ConversationAttachment { path: string; name: string }
+
+type Line = Pick<Message, "role" | "text" | "attachments" | "from" | "roomRequest" | "threadPost" | "via">;
+
+/** The stored files of one conversation: what the person attached to their own messages, and the copies already shown
+ * in it (a bot's attach_file, files passed with a hand-off). A bot may pass these on by their exact path; the rest of the
+ * attachment store, which holds every conversation's files, stays out of reach. Security: a tag is text anyone typing in
+ * the chat controls, so a path counts only inside the attachment store (server/bot-attachment.ts). */
+export function conversationAttachments(messages: readonly Line[]): ConversationAttachment[] {
+ const found = new Map<string, string>();
+ for (const message of messages) {
+ for (const file of message.attachments ?? []) if (file.kind !== "audio" && !found.has(file.path)) found.set(file.path, file.name ?? basename(file.path));
+ if (message.role !== "user" || message.from || message.roomRequest || message.threadPost || message.via || !message.text) continue;
+ const { images, files } = splitTranscriptAttachments(message.text, false, false);
+ for (const file of [...images, ...files]) if (!found.has(file.path)) found.set(file.path, file.name);
+ }
+ return [...found].map(([path, name]) => ({ path, name }));
+}
diff --git a/server/host/rework-cap.test.ts b/server/host/rework-cap.test.ts
new file mode 100644
index 0000000000..b8de4404c0
--- /dev/null
+++ b/server/host/rework-cap.test.ts
@@ -0,0 +1,23 @@
+import { describe, expect, it } from "vitest";
+
+import { createReworkCap, REWORK_MAX } from "./rework-cap.ts";
+
+describe("rework cap", () => {
+ it("refuses rework past the limit to one teammate under one request, and counts each request and teammate apart", () => {
+ const cap = createReworkCap(() => 0);
+ const name = (id: string) => (id === "vera" ? "Vera" : id);
+ for (let round = 0; round < REWORK_MAX; round++) expect(cap.take("request-1", ["vera"], name)).toBeNull();
+ expect(cap.take("request-1", ["vera"], name)).toContain("past the limit of 4, so nothing was sent. Stop here: give the person the latest result");
+ expect(cap.take("request-1", ["vera", "other"], name)).toContain("sent to Vera");
+ expect(cap.take("request-1", ["other"], name)).toBeNull();
+ expect(cap.take("request-2", ["vera"], name)).toBeNull();
+ });
+
+ it("forgets a request after six hours", () => {
+ let clock = 0;
+ const cap = createReworkCap(() => clock);
+ for (let round = 0; round < REWORK_MAX; round++) cap.take("request-1", ["vera"], String);
+ clock = 6 * 60 * 60_000 + 1;
+ expect(cap.take("request-1", ["vera"], String)).toBeNull();
+ });
+});
diff --git a/server/host/rework-cap.ts b/server/host/rework-cap.ts
new file mode 100644
index 0000000000..f0c6640206
--- /dev/null
+++ b/server/host/rework-cap.ts
@@ -0,0 +1,25 @@
+// A hand-off loop's hard stop. Rework sent back to one teammate is counted per request, so a worker and a checker that
+// never agree end after REWORK_MAX rounds whatever their instructions say; the runtime's own loop guards reset on every
+// result that comes back, so they never see this loop.
+
+export const REWORK_MAX = 4;
+const KEPT_MS = 6 * 60 * 60_000;
+
+export const reworkRefusal = (bot: string): string =>
+ `coordinate_bots was not run: this would be rework number ${REWORK_MAX + 1} sent to ${bot} for the same request, past the limit of ${REWORK_MAX}, so nothing was sent. Stop here: give the person the latest result and say what is still open, with ${bot}'s last report.`;
+
+export function createReworkCap(now: () => number = Date.now) {
+ const counts = new Map<string, { count: number; at: number }>();
+ return {
+ /** Counts one rework to each of `botIds` under `request`; the refusal for the first that is past the limit, which counts none. */
+ take(request: string, botIds: readonly string[], name: (botId: string) => string): string | null {
+ const at = now();
+ for (const [key, entry] of counts) if (at - entry.at > KEPT_MS) counts.delete(key);
+ const keys = botIds.map((botId) => `${request}\u0000${botId}`);
+ const over = botIds.find((_botId, index) => (counts.get(keys[index]!)?.count ?? 0) >= REWORK_MAX);
+ if (over !== undefined) return reworkRefusal(name(over));
+ for (const key of keys) counts.set(key, { count: (counts.get(key)?.count ?? 0) + 1, at });
+ return null;
+ },
+ };
+}
diff --git a/server/index.ts b/server/index.ts
index 7c2da44b17..25a7a2007b 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -117,7 +117,7 @@ import { vpsLeftBehindNotice, vpsNotChosenReason } from "./cloud-backend.ts";
import * as composio from "./composio.ts"; import { createConnectorListingRoutes } from "./routes/connectors-listing.ts";
import { appSandboxRule, connectorCallFromFrame, connectorRefusalText, connectorScopeRefusalText, connectorUnrecognizedText, evaluateConnectorTools } from "./connector-verdict.ts";
import { signInCardText } from "./connector-card-text.ts";
-import { BOT_HELD_CODE, BOT_PAUSED_CODE } from "../shared/bot-limit.ts"; import { createBotHolds } from "./host/bot-holds.ts"; import { createBotHoldRoutes } from "./routes/bot-holds.ts"; import { createCliLogin } from "./routes/cli-login.ts"; import { createStarterAwake } from "./host/starter-awake.ts"; import { createStarterCaps } from "./host/starter-caps.ts"; import { createStarterRoutineWake, workInFlight, type StarterRoutineWake } from "./host/starter-routine-wake.ts"; import { createStarterAwakeRoutes } from "./routes/starter-awake.ts"; import { chiefOfStaffPrompt, chiefOfStaffSystemPrompt } from "./chief-of-staff.ts"; import { coordinateMessageMax, coordinateTooLong } from "./too-long.ts"; import { chiefAbsentFrom, createChiefRooms } from "./host/chief-rooms.ts"; import { chiefLevel, readTeamRolesWith } from "./chief-level.ts"; import { defaultBotRefusal, ensureDefaultBot } from "./default-bot.ts";
+import { BOT_HELD_CODE, BOT_PAUSED_CODE } from "../shared/bot-limit.ts"; import { createBotHolds } from "./host/bot-holds.ts"; import { createBotHoldRoutes } from "./routes/bot-holds.ts"; import { createCliLogin } from "./routes/cli-login.ts"; import { createStarterAwake } from "./host/starter-awake.ts"; import { createStarterCaps } from "./host/starter-caps.ts"; import { createStarterRoutineWake, workInFlight, type StarterRoutineWake } from "./host/starter-routine-wake.ts"; import { createStarterAwakeRoutes } from "./routes/starter-awake.ts"; import { chiefOfStaffPrompt, chiefOfStaffSystemPrompt } from "./chief-of-staff.ts"; import { coordinateMessageMax, coordinateTooLong, reportBackTooLong } from "./too-long.ts"; import { chiefAbsentFrom, createChiefRooms } from "./host/chief-rooms.ts"; import { chiefLevel, readTeamRolesWith } from "./chief-level.ts"; import { defaultBotRefusal, ensureDefaultBot } from "./default-bot.ts";
import { buildRecall, recallRooms, recallThreadIds, withRecalled } from "./recall.ts";
import { hostTimeZone, takesTurnClock, turnClockLine, withTurnClock } from "./turn-clock.ts";
import { createMemoryUpkeep, dreamConversations, upkeepEnabled } from "./memory-upkeep.ts";
@@ -291,7 +291,7 @@ import { threadModelFallback, type ThreadEngine } from "./thread-model.ts";
import { computerEngineMoveText, removedComputerInstanceIds, writeComputerEngineMoveLines } from "./computer-engine-removal.ts";
import { peerDeliveryReceipt, refusalsOnlyInstructions, type PeerDeliveryReceipt } from "./peer-delivery.ts";
import { createRoomAccess, PRIVATE_CHAT_ROOM_WRITE } from "./host/room-access.ts";
-import { outsideRoomNote, sentRow, teammateResultRow, WAIT_CARD_CLOSED_REASON } from "./host/handoff-sent.ts"; import { createHandoffFiles, handoffFilesSchema, inboxRead, turnsRunInOwnFolder } from "./host/handoff-files.ts";
+import { outsideRoomNote, sentRow, teammateResultRow, WAIT_CARD_CLOSED_REASON } from "./host/handoff-sent.ts"; import { createHandoffFiles, handoffFilesSchema, inboxRead, turnsRunInOwnFolder } from "./host/handoff-files.ts"; import { conversationAttachments } from "./conversation-attachments.ts"; import { createReworkCap } from "./host/rework-cap.ts";
import { createWebhookRoomPost } from "./host/webhook-room-deps.ts";
import { createRoomJobs, parallelRoomJobsEnabled, type RoomRoundLine } from "./host/room-jobs.ts";
import { markGroupThreadUnreadAfterTurn } from "./group-task-state.ts";
@@ -299,7 +299,7 @@ import { createDelegatedLevel } from "./host/delegated-level.ts";
import { createLiveApprovalMode } from "./host/live-approval.ts";
import { CONSENT_RULE, continuedOrigin, escapeNotes, labelledLine, OUTSIDE, peerLineText, peerProvenanceNote, quoteInNote, reportNote, requestWorkOrigin, type WorkOrigin } from "./peer-provenance.ts"; import { lineNote, PROVENANCE_PROMPT } from "./provenance-label.ts"; import { openRoomThread } from "./host/room-new-thread.ts"; import { createLineLabels } from "./host/line-labels.ts";
import { decideRoomPost, emptyRoomPostBudget, type RoomPostAttempt, type RoomPostBudget } from "./room-post-budget.ts";
-import { messagePages, pageMessage, pageSize, slimMessage } from "./host/message-pages.ts"; import { suggestedSelection } from "./host/suggested-selection.ts";
+import { messagePages, pageMessage, pageSize, slimMessage } from "./host/message-pages.ts"; import { SUGGESTION_MAX_AGE_MS, suggestedSelection } from "./host/suggested-selection.ts"; import { otherProviderSelection } from "./checker-model.ts";
import { coordinateResultMessage, createAsksActingPerson, createTeammatePrompts } from "./host/teammate-prompts.ts"; import { createPersonalReach } from "./host/personal-reach.ts"; import { createMausBotOwnChat } from "./host/mausbot-own-chat.ts"; import { moveMemoryLayer } from "./memory-move.ts";
import { createQueuedReason } from "./host/queued-reason.ts";
import { ReplayBuffer } from "./host/sse-replay.ts";
@@ -3840,7 +3840,7 @@ const questionRouting = createQuestionRouting({ store, handedInUnproven, active:
answerLive: async (threadId, requestId, text) => await answerRequest(threadId, botForThread(store.botByThread(threadId)?.id ?? "", threadId)?.modelSelection.instanceId ?? "", requestId, "answer", text) === "answered", settleSignIns: (node) => signInSettle.answeredElsewhere(node),
keptPrivate: (node, requester) => keptPrivate({ child: teamHost.privateTo(node.threadId), parent: teamHost.privateTo(requester.threadId) }),
steer: async (threadId, text) => canSteerThread(threadId) && (await steerThread(threadId, text)) !== "refused", mayReach: outsideLineage.mayReach });
-const handoffFiles = createHandoffFiles({ dataDir: DATA_DIR, attachmentsDir: ATTACHMENTS_DIR, botName: (id) => store.bot(id)?.name, node: (id) => coordinator.node(id), children: (id) => coordinator.children(id), discard: deleteAttachment, threadsReferencing, changes: (listener) => store.onChange(listener), log: (line) => console.error(line),
+const reworkCap = createReworkCap(); const handoffFiles = createHandoffFiles({ dataDir: DATA_DIR, attachmentsDir: ATTACHMENTS_DIR, botName: (id) => store.bot(id)?.name, node: (id) => coordinator.node(id), children: (id) => coordinator.children(id), discard: deleteAttachment, threadsReferencing, changes: (listener) => store.onChange(listener), log: (line) => console.error(line),
worksInOwnFolder: (botId, threadId) => turnsRunInOwnFolder(botId, threadId, store.taskByThread(botId, threadId)?.cwd, store.bot(botId)?.cwd, Boolean(store.groupByThread(threadId))), vmHome: (botId) => localVmMode(cfg) === "per-bot" ? perBotLocalVmTarget(botId).workspaceDir : null, withheld: (child, parent) => Boolean(roomHandoffProblem(child, parent)) || keptPrivate({ child: teamHost.privateTo(child.threadId), parent: teamHost.privateTo(parent.threadId) }) });
const botLink = createBotLinkHost({ roomLine: (threadId, key, params) => serverLine(threadLanguage(threadId), key, params), roomWindow: (threadId, reader) => roomTranscript.window(threadId, userNameFor(threadId), undefined, reader), roomOpener: (botId, threadId) => handoffOpener({ botId, threadId }, threadId), roomChanged: (groupId) => { const room = store.group(groupId); if (room) broadcast({ kind: "group", group: publicGroupState(room) }); }, roomFollow: followRoomMentions<GroupTurnOperation>({ members: (groupId) => (store.group(groupId)?.memberIds ?? []).map((id) => store.bot(id)).filter((bot): bot is BotRecord => Boolean(bot)), mentioned: (text, members) => roomResponders(text, members, { kind: "mentions" }), begin: beginGroupTurnOperation, finish: finishGroupTurnOperation, queue: groupQueues, wait: waitForChatRoomMember, run: (groupId, threadId, botId, hop, spoken, operation) => runGroupMemberTurn(groupId, threadId, botId, hop, spoken, undefined, undefined, () => operation.cancelled, undefined, undefined, undefined, undefined, operation) }), dataDir: DATA_DIR, environmentId: ENVIRONMENT_ID, store, coordinator: () => coordinator, kick: () => handoffTicks.kick(), level: (bot) => approvalModeForTurn(bot, true, bot.threadId), refusal: botMoveRefusal, language: (threadId) => threadLanguage(threadId), personName: personNameIn, sessions, power: () => cloudPower, files: handoffFiles, storeFile: (path, name, root) => saveBotAttachment({ path, name, roots: [root], byContent: true }), log: (line) => console.error(line), local: (auth) => auth.kind === "loopback" && auth.trust !== "service" && !CLOUD_HOME && !HOSTED_WORKSPACE, owner: (auth) => !sharedMembership() && !HOSTED_WORKSPACE && (ownHome.owner(auth) || (CLOUD_PERSONAL && cloudOwnerSession(auth))) }); ROUTES.push(botLink.routes); const handoffTicks = createHandoffTicks(), coordinator: Coordinator = createCoordinator({
dataDir: DATA_DIR,
@@ -10987,7 +10987,7 @@ function messageFileRootsForThread(senderId: string, threadId: string): string[]
/** A bot's own file copied into the attachment store, for attach_file and coordinate_bots' files alike. The store is no source: only the
* bot's own files are (its conversation's inbox of received files among them), or one saved outside them this turn, never from the data dir. */
function saveTurnFile(capability: InternalCapability, botId: string, vm: LocalVmTarget | undefined, path: string, name: string | undefined, byContent: boolean) {
- return saveBotAttachment({ path, name, byContent, roots: messageFileRootsForThread(botId, capability.threadId).filter((root) => root !== ATTACHMENTS_DIR), inbox: inboxRead(botId, capability.threadId),
+ return saveBotAttachment({ path, name, byContent, roots: messageFileRootsForThread(botId, capability.threadId).filter((root) => root !== ATTACHMENTS_DIR), inbox: inboxRead(botId, capability.threadId), attached: () => conversationAttachments(store.messagesFor(capability.threadId)),
...(vm ? { guest: { root: VM_WORKSPACE_GUEST, host: vm.workspaceDir } } : {}),
...(capability.deliversSavedFiles && capability.turnStartedAt !== undefined ? { savedThisTurn: { since: capability.turnStartedAt, refuse: [DATA_DIR] } } : {}) });
}
@@ -13731,7 +13731,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
done_when: z.string().trim().max(1000).optional(), answers: z.string().trim().min(1).max(128).optional(), files: handoffFilesSchema,
}).safeParse(await readInternalBody());
if (!parsed.success) return json(res, 400, { error: coordinateTooLong(parsed.error.issues) ?? `Provide 1-4 distinct botIds and a message of 1-${coordinateMessageMax} characters; thread is standing, new or the id of a thread you opened on that teammate, title one line of at most 80 characters, reply is resume or none, consult is a boolean, done_when at most 1000 characters, files at most 5 paths.` });
- const { groupId, botIds, message, reason, rework, thread, title, reply, consult, inMyFolder, done_when: doneWhen, answers, files: paths } = parsed.data;
+ const { groupId, botIds, message, reason, rework, thread, title, reply, consult, inMyFolder, done_when: doneWhen, answers, files: paths } = parsed.data; const reworkRefused = rework ? reworkCap.take(directRequestOwners.get(internalCapability.threadId)?.messageId ?? internalCapability.threadId, botIds, (id) => store.bot(id)?.name ?? "that teammate") : null; if (reworkRefused) return json(res, 400, { error: reworkRefused });
const callRun = activeRoutineRunForThread(internalCapability.threadId) ?? undefined, result = await handoffFiles.coordinate({ paths, answers, senderId: internalSender.id, recipients: botIds.length, saveOne: async (path) => saveTurnFile(internalCapability, internalSender.id, await attachmentVmForTurn(internalCapability), path, undefined, true),
send: (files) => coordinateBots({ groupId, botIds, message, reason: reason || undefined, rework, thread, title: title || undefined, reply, consult, inMyFolder, doneWhen: doneWhen || undefined, ...(answers ? { answers } : {}), ...(files ? { files } : {}) }) }); refusedHandoffs.settled(internalCapability.threadId, internalSender, botIds, result.status, callRun);
return json(res, result.status, result.body);
@@ -13923,7 +13923,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
const picked = body.modelSelection === undefined ? null : checkedModelSelection(body.modelSelection, undefined, true); const refused = !picked ? null : target.id !== from.id ? "model_selection is only for threads on yourself" : !picked.ok ? picked.error : ownThreads.refusal(picked.selection, from); if (refused) return json(res, 400, { error: refused });
if (target.id === from.id) { const selfRefused = selfThreadRefusal({ handoff: Boolean(internalCapability.roomHandoffId), requestLine: store.activePath(fromThreadId).findLast((line) => line.role === "user" && line.kind === "text") }); if (selfRefused) return json(res, 409, { error: selfRefused });
const inherited = ownThreads.inherited(from.id, fromThreadId, picked?.ok ? picked.selection : undefined);
- if (body.reportBack === true) { if (owner.group) return json(res, 400, { error: "report_back works only from your own conversation, not a room. Leave it out; the thread's result then stays in that thread." });
+ if (body.reportBack === true) { if (owner.group) return json(res, 400, { error: "report_back works only from your own conversation, not a room. Leave it out; the thread's result then stays in that thread." }); const tooLong = reportBackTooLong(message); if (tooLong) return json(res, 400, { error: tooLong });
const result = await coordinateBots({ botIds: [from.id], message, rework: false, thread: "new", reply: "resume", consult: false, title, projectId, ownThread: inherited }), receipt = (result.body.receipts as PeerDeliveryReceipt[] | undefined)?.[0];
return json(res, result.status === 200 ? 201 : result.status, { ...result.body, self: true, reportBack: true, title, botId: from.id, botName: from.name, threadId: receipt?.threadId, requestId: receipt?.requestId }); }
const task = store.createTask(from.id, title, false, projectId, { botId: from.id, name: from.name, at: Date.now() }, inherited.approvalMode, inherited.modelSelection, undefined,
@@ -14579,11 +14579,9 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
}
if (method === "GET" && path === "/api/bot-defaults") {
- return json(res, 200, {
- defaults: structuredClone(cfg.newBotDefaults ?? newBotDefaultsSchema.parse({})),
- modelSelection: await suggestedSelection({ reused: (age) => registry.describe({ reuse: { ...age, changed: () => broadcast({ kind: "config", ...configStatus() }) } }), fresh: () => registry.describe(), select: (instances) => defaultSelection(undefined, instances) }),
- suggestedName: pickBotName(store.bots.map(bot => bot.name)),
- });
+ const defaults = structuredClone(cfg.newBotDefaults ?? newBotDefaultsSchema.parse({})), reused = (ms: number) => registry.describe({ reuse: { ms, maxAgeMs: SUGGESTION_MAX_AGE_MS, changed: () => broadcast({ kind: "config", ...configStatus() }) } }), modelSelection = await suggestedSelection({ reused: (age) => reused(age.ms), fresh: () => registry.describe(), select: (instances) => defaultSelection(undefined, instances) });
+ const checker = url.searchParams.get("checker") === "1" && !hostedModels ? otherProviderSelection(selectableInstances<SelectableInstance>(await reused(ENGINE_LIST_REUSE_MS)), defaults.profile.modelSelection?.instanceId ? defaults.profile.modelSelection : modelSelection, selectionContext) : undefined;
+ return json(res, 200, { defaults, modelSelection, suggestedName: pickBotName(store.bots.map(bot => bot.name)), ...(checker === undefined ? {} : { checkerModelSelection: checker }) });
}
if (method === "POST" && path === "/api/bot-defaults/skills/preview") {
const checked = z.object({ source: z.string().min(1).max(2000) }).strict().safeParse(await readBody(req));
diff --git a/server/too-long.ts b/server/too-long.ts
index a252aeaeae..1452c67a30 100644
--- a/server/too-long.ts
+++ b/server/too-long.ts
@@ -29,3 +29,10 @@ export function coordinateTooLong(issues: readonly Issue[]): string | undefined
});
return refusals.length && refusals.every(Boolean) ? refusals.join(" ") : undefined;
}
+
+/** A start_thread brief that reports back travels as a hand-off, so it has a hand-off's limit; undefined when it fits. */
+export function reportBackTooLong(message: string): string | undefined {
+ return message.length > coordinateMessageMax
+ ? tooLongRefusal("message", coordinateMessageMax, "Put only what the thread needs to start in the message, save the long detail to a file and name its full path, then call start_thread again.")
+ : undefined;
+}
diff --git a/src/components/NewBotDialog.test.ts b/src/components/NewBotDialog.test.ts
index 4f89bfe4b2..9d04301c57 100644
--- a/src/components/NewBotDialog.test.ts
+++ b/src/components/NewBotDialog.test.ts
@@ -31,7 +31,7 @@ vi.mock("@/state/store", async importOriginal => {
const store = await importOriginal<typeof import("@/state/store")>();
return { ...store, api: fixture.api, BotEditorStore: () => null, useStore: () => ({ state: { ...store.initialState, appSettingsOpen: fixture.appSettingsOpen, ...(fixture.teamName ? { config: { team: { id: "acme", name: fixture.teamName } } } : {}) }, dispatch: fixture.dispatch }) };
});
-import { NewBotDialog } from "./NewBotDialog";
+import { CheckerModelLine, NewBotDialog } from "./NewBotDialog";
import { setTeamChats } from "@/state/team-chats";
import { setTeamPeople } from "@/state/team-people";
import { Select } from "./Select";
@@ -56,11 +56,11 @@ function chooseStartingRole(dialog: Node[], value: string) {
const select = output(role).find(node => node.type === Select)!;
(select.props as unknown as { onChange: (event: { target: { value: string } }) => void }).onChange({ target: { value } });
}
-function render(defaultsMode = false, onCreated?: () => void | Promise<void>) {
+function render(defaultsMode = false, onCreated?: () => void | Promise<void>, readyBotId?: string) {
let tree: ReactNode = null;
function Capture() {
fixture.hook = 0;
- const editor = (NewBotDialog({ defaultsMode, onCreated, onClose: fixture.close }) as Node).props.children as Node;
+ const editor = (NewBotDialog({ defaultsMode, onCreated, onClose: fixture.close, readyBotId }) as Node).props.children as Node;
tree = (editor.type as (props: unknown) => ReactNode)(editor.props);
return tree;
}
@@ -163,6 +163,41 @@ describe("bot draft dialog", () => {
expect(fixture.setDraft.mock.calls[0]![0].bot.modelSelection).toEqual(selection);
});
+ it("starts the Checker from Templates on another provider's AI the server found, and every other bot on the default", async () => {
+ const other = { instanceId: "codex", model: "codex-default" };
+ const answer = { defaults: { profile: {}, memory: {}, skills: [], routines: [] }, modelSelection: { instanceId: "claude", model: "opus" }, suggestedName: "Fixture" };
+ fixture.api.mockResolvedValue({ ...answer, checkerModelSelection: other });
+ render(false, undefined, "checker");
+ fixture.effects[0]();
+ expect(fixture.api).toHaveBeenCalledExactlyOnceWith("/api/bot-defaults?checker=1");
+ await vi.waitFor(() => expect(fixture.setDraft).toHaveBeenCalledOnce());
+ expect(fixture.setDraft.mock.calls[0]![0].bot).toMatchObject({ name: "Vera", title: "Checker", modelSelection: other });
+
+ fixture.effects = []; fixture.api.mockReset(); fixture.setDraft.mockReset();
+ fixture.api.mockResolvedValue({ ...answer, checkerModelSelection: null });
+ render(false, undefined, "checker");
+ fixture.effects[0]();
+ await vi.waitFor(() => expect(fixture.setDraft).toHaveBeenCalledOnce());
+ expect(fixture.setDraft.mock.calls[0]![0].bot.modelSelection).toEqual(answer.modelSelection);
+
+ fixture.effects = []; fixture.api.mockReset(); fixture.setDraft.mockReset();
+ fixture.api.mockResolvedValue(answer);
+ render(false, undefined, "editor");
+ fixture.effects[0]();
+ expect(fixture.api).toHaveBeenCalledExactlyOnceWith("/api/bot-defaults");
+ await vi.waitFor(() => expect(fixture.setDraft).toHaveBeenCalledOnce());
+ expect(fixture.setDraft.mock.calls[0]![0].bot).toMatchObject({ name: "Nib", modelSelection: answer.modelSelection });
+ });
+
+ it("says which AI the Checker checks on only while the review is on the model it started on", () => {
+ const start = { instanceId: "codex", model: "codex-default" };
+ const line = (other: typeof start | null, modelSelection: typeof start) => renderToStaticMarkup(createElement(CheckerModelLine,
+ { bot: { name: "Vera", modelSelection } as never, other, start, instances: [] }));
+ expect(line(start, start)).toContain("Vera checks on codex-default, a different AI from your other bots");
+ expect(line(null, start)).toContain("No other AI is ready, so Vera checks on the same AI as your other bots.");
+ for (const other of [start, null]) expect(line(other, { instanceId: "claude", model: "opus" })).toBe("");
+ });
+
it("can cancel a loading draft without creating or deleting a bot", () => {
const result = render();
result.nodes.find(node => node.type === "button" && node.props["aria-label"] === "Close")!.props.onClick!();
diff --git a/src/components/NewBotDialog.tsx b/src/components/NewBotDialog.tsx
index 6044392130..8b47d33564 100644
--- a/src/components/NewBotDialog.tsx
+++ b/src/components/NewBotDialog.tsx
@@ -1,10 +1,11 @@
import { useEffect, useRef, useState } from "react";
import { Loader2, Plus, Trash2, X } from "lucide-react";
-import { api, BotEditorStore, useStore, type Bot } from "@/state/store";
+import { api, BotEditorStore, useStore, type Bot, type InstanceInfo, type ModelSelection } from "@/state/store";
import { BotCreationDraft, EMPTY_BOT_DEFAULTS } from "@/lib/bot-creation-draft";
import { createConfiguredBot, preparedBotTemplate } from "@/lib/create-configured-bot";
import { BOT_ROLES, roleProfilePatch } from "@/lib/bot-roles";
-import { readyBot, readyBotTemplate } from "@/lib/ready-bots";
+import { checkerTemplate, readyBot, readyBotTemplate } from "@/lib/ready-bots";
+import { modelName } from "@/lib/simple-model-menu";
import { chosenPreset, presetDraftPatch, presetGroups, presetPictureFile, presetSummaryLines, type BotPreset } from "@/lib/bot-presets";
import { cn } from "@/lib/cn";
import { t } from "@/lib/i18n";
@@ -78,15 +79,19 @@ function NewBotEditor({ defaultsMode = false, onClose, onCreated, readyBotId }:
const dialog = useRef<HTMLDivElement>(null);
const closeRef = useRef(onClose);
closeRef.current = onClose;
+ const [checkerModel, setCheckerModel] = useState<{ other: ModelSelection | null; start: ModelSelection } | undefined>(undefined);
useEffect(() => {
let cancelled = false;
- void api<BotDefaultsAnswer>("/api/bot-defaults")
+ const ready = defaultsMode || !readyBotId ? undefined : readyBot(readyBotId);
+ void api<BotDefaultsAnswer & { checkerModelSelection?: ModelSelection | null }>(`/api/bot-defaults${ready?.checker ? "?checker=1" : ""}`)
.then(result => {
if (cancelled) return;
const defaults = startingTemplate(result, !defaultsMode);
- const ready = defaultsMode || !readyBotId ? undefined : readyBot(readyBotId);
- const next = new BotCreationDraft(ready ? readyBotTemplate(defaults, ready) : defaults, () => render(value => value + 1));
+ const template = ready ? readyBotTemplate(defaults, ready) : defaults;
+ const start = ready?.checker ? checkerTemplate(template, result.checkerModelSelection) : template;
+ const next = new BotCreationDraft(start, () => render(value => value + 1));
if (ready) next.role = ready.id;
+ if (ready?.checker && start.profile.modelSelection) setCheckerModel({ other: result.checkerModelSelection ?? null, start: start.profile.modelSelection });
setDraft(next);
setReady(true);
}).catch(cause => { if (!cancelled) setError(String(cause)); });
@@ -165,6 +170,7 @@ function NewBotEditor({ defaultsMode = false, onClose, onCreated, readyBotId }:
<button type="button" onClick={() => closeRef.current()} aria-label={t("common.close")}
className="flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-40"><X size={18} className="pointer-events-none" /></button>
</div>
+ {ready && checkerModel !== undefined && <CheckerModelLine bot={bot} {...checkerModel} instances={parent.state.instances} />}
{team && !defaultsMode && teamName && <WhoCanUse team={teamName} everyone={everyone} disabled={saving} onChange={setEveryone} />}
{choosesVisibility && (
<div className="flex flex-wrap items-center gap-2 px-5 pt-3 text-[13px] text-ink-secondary" data-new-bot-visibility>
@@ -220,6 +226,17 @@ function NewBotEditor({ defaultsMode = false, onClose, onCreated, readyBotId }:
</div>;
}
+/** Which AI a checker from Templates checks on: another provider's, or, with no other ready, the same one. Only while the
+ * review is still on the model it started on: once the person picks another, the picker says which. */
+export function CheckerModelLine({ bot, other, start, instances }: { bot: Bot; other: ModelSelection | null; start: ModelSelection; instances: readonly InstanceInfo[] }) {
+ const selection = bot.modelSelection;
+ if (selection.instanceId !== start.instanceId || selection.model !== start.model) return null;
+ const model = modelName(instances.find(instance => instance.instanceId === selection.instanceId), selection.model);
+ return <p data-new-bot-checker-model={other ? "other" : "same"} className="px-5 pt-3 text-[13px] text-ink-secondary">
+ {other ? t("readyBots.checker.otherAi", { name: bot.name, model }) : t("readyBots.checker.sameAi", { name: bot.name })}
+ </p>;
+}
+
/** A team bot is its maker's until they share it; this is the one place to share it with everyone from the start. */
function WhoCanUse({ team, everyone, disabled, onChange }: { team: string; everyone: boolean; disabled: boolean; onChange(everyone: boolean): void }) {
return <label data-new-bot-shared={everyone ? "everyone" : "me"} className="flex flex-wrap items-center gap-2 border-b border-hairline/40 bg-raised/30 px-5 py-2.5 text-[13px] text-ink-secondary">
diff --git a/src/components/ReadyBotGallery.test.ts b/src/components/ReadyBotGallery.test.ts
index 44100222a5..819ebb4988 100644
--- a/src/components/ReadyBotGallery.test.ts
+++ b/src/components/ReadyBotGallery.test.ts
@@ -47,6 +47,14 @@ describe("ready-made bots gallery", () => {
expect(host.textContent).toContain("Includes a paused routine");
});
+ it("says on each card of the checked-work pair which bot it works with", () => {
+ render();
+ const card = (id: string) => host.querySelector(`[data-ready-bot="${id}"]`)!.textContent;
+ expect(card("editor")).toContain("Pairs with Vera, Checker");
+ expect(card("checker")).toContain("Pairs with Nib, Writer and editor");
+ expect(card("writer")).not.toContain("Pairs with");
+ });
+
it("narrows to a category and back to all", () => {
render();
flushSync(() => button("Design").click());
diff --git a/src/components/ReadyBotGallery.tsx b/src/components/ReadyBotGallery.tsx
index ffd3db441c..645e7c6940 100644
--- a/src/components/ReadyBotGallery.tsx
+++ b/src/components/ReadyBotGallery.tsx
@@ -4,7 +4,7 @@ import { Plus } from "lucide-react";
import { stoppedAtBotLimit } from "@/lib/bot-limit";
import { MausAvatar } from "./Avatar";
import { NewBotDialog } from "./lazy-screens";
-import { READY_BOT_CATEGORIES, READY_BOTS, matchesReadyBot, readyBotCopy, type ReadyBotCategory } from "@/lib/ready-bots";
+import { READY_BOT_CATEGORIES, READY_BOTS, matchesReadyBot, readyBot, readyBotCopy, type ReadyBotCategory } from "@/lib/ready-bots";
import { cn } from "@/lib/cn";
import { t } from "@/lib/i18n";
import type { LocaleKey } from "@/locales";
@@ -51,7 +51,7 @@ export function ReadyBotGallery({ search, onDialog, onAdded }: {
</button>)}
</div>
<div className="grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3">
- {visible.map((bot) => { const copy = readyBotCopy(bot); return <article key={bot.id} data-ready-bot={bot.id} className="flex flex-col rounded-2xl border border-hairline/40 bg-card p-4">
+ {visible.map((bot) => { const copy = readyBotCopy(bot), partner = bot.partner ? readyBot(bot.partner) : undefined; return <article key={bot.id} data-ready-bot={bot.id} className="flex flex-col rounded-2xl border border-hairline/40 bg-card p-4">
<div className="flex items-center gap-3">
<MausAvatar color={bot.look.color} bodyId={bot.look.mascotBody} size={40} animated={false} label={bot.name} />
<div className="min-w-0 flex-1">
@@ -65,9 +65,10 @@ export function ReadyBotGallery({ search, onDialog, onAdded }: {
</div>
<p className="mt-3 text-[13px] leading-[1.45] text-ink-secondary">{copy.description}</p>
<p className="mt-2 text-[12px] italic text-ink-tertiary">{t("readyBots.try", { prompt: copy.tryAsking })}</p>
- {(bot.apps.length > 0 || bot.routines?.length) && <p className="mt-auto pt-2 text-[12px] text-ink-tertiary">
+ {(bot.apps.length > 0 || bot.routines?.length || partner) && <p className="mt-auto pt-2 text-[12px] text-ink-tertiary">
{[bot.apps.length > 0 && t("readyBots.worksWith", { apps: bot.apps.map((app) => APP_LABELS[app] ?? app).join(", ") }),
- bot.routines?.length && t("readyBots.pausedRoutine")].filter(Boolean).join(" · ")}
+ bot.routines?.length && t("readyBots.pausedRoutine"),
+ partner && t("readyBots.pairsWith", { name: partner.name, title: readyBotCopy(partner).title })].filter(Boolean).join(" · ")}
</p>}
</article>; })}
</div>
diff --git a/src/lib/ready-bots.test.ts b/src/lib/ready-bots.test.ts
index eadf13f2a3..7f69c4b981 100644
--- a/src/lib/ready-bots.test.ts
+++ b/src/lib/ready-bots.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import { MAUS_COLORS } from "./mascot";
-import { CLASSIC_ROLE_IDS, READY_BOT_CATEGORIES, READY_BOTS, matchesReadyBot, readyBot, readyBotCopy, readyBotTemplate } from "./ready-bots";
+import { CLASSIC_ROLE_IDS, READY_BOT_CATEGORIES, READY_BOTS, checkerTemplate, matchesReadyBot, readyBot, readyBotCopy, readyBotTemplate } from "./ready-bots";
import { setLocale } from "./i18n";
import en from "@/locales/en.json";
import { MASCOT_BODY_IDS } from "../../shared/mascot-bodies";
@@ -120,3 +120,55 @@ describe("the social media manager", () => {
expect(template.memory["MEMORY.md"]).toContain("memory/social.md");
});
});
+
+describe("the checked-work pair", () => {
+ const editor = readyBot("editor")!, checker = readyBot("checker")!;
+
+ it("names each other, and only the checker asks for another provider's AI", () => {
+ expect(editor).toMatchObject({ title: "Writer and editor", partner: "checker" });
+ expect(checker).toMatchObject({ title: "Checker", partner: "editor", checker: true });
+ expect(READY_BOTS.filter((bot) => bot.checker).map((bot) => bot.id)).toEqual(["checker"]);
+ for (const bot of READY_BOTS) if (bot.partner) expect(readyBot(bot.partner)?.partner).toBe(bot.id);
+ });
+
+ it("has the worker change only what it was asked, list each change, and hand the request and source to the checker as files", () => {
+ for (const line of [
+ "Change only what the task names. Never alter a fact, event, name, number, date, description or quote you were not asked to change",
+ "list every change you made",
+ "in a new folder named checks/<a short name for the task> in your working folder, never beside the person's own files",
+ "request.md with the person's request word for word, source.md with the original text exactly as given",
+ "When the person attached the source, pass their file instead of source.md and name it as sent.",
+ "pick the teammate whose role is Checker",
+ "coordinate_bots (files, thread \"new\", a short title)",
+ "Never paste the long text into the message.",
+ "on a model from another provider than yours",
+ "a draft or an edit of a document, have it checked; a quick answer needs no check",
+ "When a brief asks you to check work, you are the checker: follow the brief and skip these steps.",
+ "While a check runs, end your turn with one short line saying the work is being checked; don't show the result yet.",
+ "rework true to the thread id from the first receipt, passing result.md, the source and request.md with files again on every round",
+ "Stop after 3 check rounds",
+ "what is still open, with the checker's last report",
+ "\"Not checked:\" and the reason",
+ ]) expect(editor.soul).toContain(line);
+ });
+
+ it("has the checker compare with both the source and the request, report every kind of issue, and pass only with none", () => {
+ for (const line of [
+ "against the original request and the source",
+ "you never hand work on to anyone",
+ "Changed fact:", "Added detail:", "Unmet instruction:", "Regression:", "Unlisted change:",
+ "\"pass\" when there are no issues, or \"issues: N\" otherwise",
+ "Never pass with an issue open",
+ "answer \"cannot check\", never pass",
+ "only your last message reaches whoever asked",
+ ]) expect(checker.soul).toContain(line);
+ });
+
+ it("starts the checker on another provider's AI only when the server found one, and keeps everything else", () => {
+ const template = readyBotTemplate(defaults(), checker);
+ const other = { instanceId: "codex", model: "codex-default" };
+ expect(checkerTemplate(template, other).profile).toMatchObject({ name: "Vera", modelSelection: other, approvalMode: "ask", cwd: "/work/site" });
+ for (const none of [null, undefined]) expect(checkerTemplate(template, none)).toBe(template);
+ expect(template.profile.modelSelection).toEqual({ instanceId: "claude", model: "opus" });
+ });
+});
diff --git a/src/lib/ready-bots.ts b/src/lib/ready-bots.ts
index 37f00a2cfa..f35d72a41f 100644
--- a/src/lib/ready-bots.ts
+++ b/src/lib/ready-bots.ts
@@ -1,6 +1,6 @@
import type { BotRoutineTemplate, NewBotDefaults } from "../../shared/new-bot-defaults";
import type { MascotBodyId } from "../../shared/mascot-bodies";
-import type { MausColor } from "../../shared/wire";
+import type { MausColor, ModelSelection } from "../../shared/wire";
import { t, tFromServer } from "@/lib/i18n";
export type ReadyBotCategory = "everyday" | "work" | "writing" | "design" | "sales" | "personal";
@@ -20,6 +20,10 @@ export interface ReadyBot {
apps: string[];
notes?: Record<string, string>;
routines?: BotRoutineTemplate[];
+ /** The ready bot this one works with, shown on its card. */
+ partner?: string;
+ /** Checks other bots' work, so it starts on another provider's AI than the person's default when one is ready. */
+ checker?: true;
}
const WEEKDAYS = [1, 2, 3, 4, 5];
@@ -172,6 +176,57 @@ export const READY_BOTS: ReadyBot[] = [
tryAsking: ["Turn these notes into a LinkedIn post", "Tighten this email to half its length", "Write three subject lines for this newsletter"],
apps: [],
},
+ {
+ id: "editor",
+ category: "writing",
+ name: "Nib",
+ title: "Writer and editor",
+ description: "Drafts and edits documents, changes only what you ask, and has each result checked before it reaches you.",
+ soul: [
+ "You draft and edit documents: chapters, articles, reports, proposals, emails.",
+ "Change only what the task names. Never alter a fact, event, name, number, date, description or quote you were not asked to change, and add nothing the source does not support. If the task seems to need such a change, list it as a suggestion instead of making it.",
+ "Keep everything you were not asked to change word for word.",
+ "After the result, list every change you made: where it is (line, paragraph or heading), what it was, what it is now, and why.",
+ "Before you give the person a draft or an edit of a document, have it checked; a quick answer needs no check. When a brief asks you to check work, you are the checker: follow the brief and skip these steps.",
+ "1. Save three files in a new folder named checks/<a short name for the task> in your working folder, never beside the person's own files: request.md with the person's request word for word, source.md with the original text exactly as given, and result.md with your full result followed by your list of changes. When the person attached the source, pass their file instead of source.md and name it as sent.",
+ "2. Call list_bots and pick the teammate whose role is Checker, or the one the person named for checks. The first time, send it the files with coordinate_bots (files, thread \"new\", a short title) and a short message naming them as sent, such as \"Check result.md against chapter-3.md and request.md.\" Never paste the long text into the message.",
+ "3. With no Checker teammate, open a thread of your own with start_thread and report_back true, on a model from another provider than yours (see list_models), and give it the full paths of the three files and the Checker's rules: compare the result with the source and the request; report every changed fact, added detail, unmet instruction and regression; answer pass only when there are none. When only one model is available, use it and say so in one line.",
+ "4. While a check runs, end your turn with one short line saying the work is being checked; don't show the result yet.",
+ "5. When the report lists issues, fix exactly those and nothing else, update result.md, and send it back with rework true to the thread id from the first receipt, passing result.md, the source and request.md with files again on every round.",
+ "6. Stop after 3 check rounds, or the number of rounds the person asked for. Then give the person the final result, your list of changes, and one line about the check: who checked it, on which model, in how many rounds, and that it passed; or, when it never passed, what is still open, with the checker's last report.",
+ "7. When a check cannot run (no checker, a refusal, an error, or this work was handed to you and cannot be handed on), give the result with \"Not checked:\" and the reason on its first line.",
+ ].join("\n"),
+ look: { color: "blue", mascotBody: "squircle" },
+ tryAsking: ["Improve the dialogue in this chapter without changing any events", "Tighten this report to two pages and keep every number", "Fix the grammar in this proposal and list each change"],
+ apps: [],
+ partner: "checker",
+ },
+ {
+ id: "checker",
+ category: "writing",
+ name: "Vera",
+ title: "Checker",
+ description: "Checks finished work against your request and the source for changed facts, added details and missed asks.",
+ soul: [
+ "You check finished work against the original request and the source. You never rewrite the work, and you never hand work on to anyone.",
+ "Read the request, the source and the result completely before you judge. When one of them is missing, say which and answer \"cannot check\", never pass.",
+ "Report every issue of these kinds:",
+ "- Changed fact: a name, number, date, event, description or quote that differs from the source when the request did not ask for that change.",
+ "- Added detail: anything the source does not support.",
+ "- Unmet instruction: go through the request one instruction at a time and name each one the result misses or only half does.",
+ "- Regression: something that was right in the source and is worse now: grammar, continuity, tone, formatting, or text that went missing.",
+ "- Unlisted change: a change the worker made but did not list.",
+ "For each issue give where it is (line, paragraph or heading), the source's words, the result's words, and the fix in one line.",
+ "The first line of your reply is \"pass\" when there are no issues, or \"issues: N\" otherwise, followed by the numbered list. Never pass with an issue open, and never invent issues: a style preference the request did not ask for is not an issue.",
+ "On a later round, check the whole result again, not only the fixes, and say which earlier issues are now fixed.",
+ "Give the whole report in one final message: only your last message reaches whoever asked. When it would run past 10,000 characters, save it as report.md, attach it with attach_file, and give the first 20 issues in the message.",
+ ].join("\n"),
+ look: { color: "teal", mascotBody: "shield" },
+ tryAsking: ["Check this edit against the original and my request", "Did this summary change any facts from the report?", "List every instruction this draft misses"],
+ apps: [],
+ partner: "editor",
+ checker: true,
+ },
{
id: "analyst",
category: "work",
@@ -349,6 +404,15 @@ export function readyBotTemplate(defaults: NewBotDefaults, bot: ReadyBot): NewBo
return template;
}
+/** A checker starts on `other`, another provider's AI, when the server found one ready: the one exception to
+ * readyBotTemplate's rule, made in the open, since the review shows the model before the bot is made. */
+export function checkerTemplate(template: NewBotDefaults, other: ModelSelection | null | undefined): NewBotDefaults {
+ if (!other) return template;
+ const next = structuredClone(template);
+ next.profile = { ...next.profile, modelSelection: other };
+ return next;
+}
+
export function readyBotCopy(bot: ReadyBot): { title: string; description: string; tryAsking: string } {
const copy = (field: string, english: string) => tFromServer(`readyBots.bot.${bot.id}.${field}`, english);
return { title: copy("title", bot.title), description: copy("description", bot.description), tryAsking: copy("try", bot.tryAsking[0]!) };
diff --git a/src/locales/en.json b/src/locales/en.json
index f45102432f..d2a45f9d67 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -7833,6 +7833,9 @@
"readyBots.try": "Try: “{prompt}”",
"readyBots.worksWith": "Works with {apps}",
"readyBots.pausedRoutine": "Includes a paused routine",
+ "readyBots.pairsWith": "Pairs with {name}, {title}",
+ "readyBots.checker.otherAi": "{name} checks on {model}, a different AI from your other bots: a model rarely catches its own mistakes.",
+ "readyBots.checker.sameAi": "No other AI is ready, so {name} checks on the same AI as your other bots. Connect or sign in to another in Settings → AI for a more independent check.",
"templates.subtitle": "Start with a complete playbook or bring your own.",
"templates.back": "Back to templates",
"templates.close": "Close templates",
@@ -9386,6 +9389,12 @@
"readyBots.bot.writer.title": "Writer",
"readyBots.bot.writer.description": "Drafts and edits posts, emails, and docs in your voice, from a rough note to a final draft.",
"readyBots.bot.writer.try": "Turn these notes into a LinkedIn post",
+ "readyBots.bot.editor.title": "Writer and editor",
+ "readyBots.bot.editor.description": "Drafts and edits documents, changes only what you ask, and has each result checked before it reaches you.",
+ "readyBots.bot.editor.try": "Improve the dialogue in this chapter without changing any events",
+ "readyBots.bot.checker.title": "Checker",
+ "readyBots.bot.checker.description": "Checks finished work against your request and the source for changed facts, added details and missed asks.",
+ "readyBots.bot.checker.try": "Check this edit against the original and my request",
"readyBots.bot.analyst.title": "Data analyst",
"readyBots.bot.analyst.description": "Answers questions about spreadsheets and CSVs with numbers, tables, and charts you can check.",
"readyBots.bot.analyst.try": "What are the top 10 customers by revenue in this CSV?",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 4adf3550a3..ff2cd1770a 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -7476,6 +7476,9 @@
"readyBots.try": "Experimente: “{prompt}”",
"readyBots.worksWith": "Funciona com {apps}",
"readyBots.pausedRoutine": "Inclui uma rotina pausada",
+ "readyBots.pairsWith": "Trabalha com {name}, {title}",
+ "readyBots.checker.otherAi": "{name} confere usando {model}, uma IA diferente da dos seus outros bots: um modelo raramente percebe os próprios erros.",
+ "readyBots.checker.sameAi": "Nenhuma outra IA está pronta, então {name} confere com a mesma IA dos seus outros bots. Conecte ou entre em outra em Configurações → IA para uma conferência mais independente.",
"templates.subtitle": "Comece com um playbook completo ou traga o seu próprio.",
"templates.back": "Voltar para os modelos",
"templates.close": "Fechar modelos",
@@ -9307,6 +9310,12 @@
"readyBots.bot.writer.title": "Redator",
"readyBots.bot.writer.description": "Escreve e edita posts, e-mails e documentos no seu estilo, de uma anotação solta até a versão final.",
"readyBots.bot.writer.try": "Transforme estas anotações em um post para o LinkedIn",
+ "readyBots.bot.editor.title": "Redator e editor",
+ "readyBots.bot.editor.description": "Escreve e edita documentos, muda só o que você pede e manda conferir cada resultado antes de entregar.",
+ "readyBots.bot.editor.try": "Melhore os diálogos deste capítulo sem mudar nenhum acontecimento",
+ "readyBots.bot.checker.title": "Revisor",
+ "readyBots.bot.checker.description": "Confere o trabalho pronto com o seu pedido e o original: fatos alterados, detalhes inventados e pedidos esquecidos.",
+ "readyBots.bot.checker.try": "Confira esta edição com o original e com o meu pedido",
"readyBots.bot.analyst.title": "Analista de dados",
"readyBots.bot.analyst.description": "Responde a perguntas sobre planilhas e CSVs com números, tabelas e gráficos que você pode conferir.",
"readyBots.bot.analyst.try": "Quais são os 10 maiores clientes por receita neste CSV?",