Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Agents tools: every turn of a conversation is listed the same tools (#3871)
Milind Soni18d549510c3d
diff --git a/docs/runtime-contract.md b/docs/runtime-contract.mdindex 1339ed9ec3..1e966dec06 100644--- a/docs/runtime-contract.md+++ b/docs/runtime-contract.md@@ -122,7 +122,7 @@ Every turn that may hand work on, whatever started it, gets the same tools:- `raise_escalation(reason)` (only with `features.chiefEscalations` on): a bot parks itself on a gate only a person can lift and says so in one line; the Chief of Staff (or the person directly, `server/escalations.ts`) is told, the turn keeps running and the tool's answer says to end it and wait.- `list_bots`, `start_thread` (on yourself), `list_threads`, `close_thread`, `post_to_room`, `list_rooms`, the Chief tools and `retry_thread` are unchanged.-Outside the teamwork tools, a turn is not listed what its server would refuse it: `select_computer` only on a person's own request that may pick its computer (`OMB_COMPUTER_SELECTION`), and no `show_widget`, `show_html`, `wait_until` or `cancel_wait` in a room's turn (`OMB_ROOM`). Nor is it listed `list_waits` and `cancel_wait` while the bot has no wait in this chat that has not ended (`OMB_ACTIVE_WAITS`): both act only on the chat's own waits. They still answer a call then (a wait made this turn, a list read earlier), and the waits route scopes them to the chat.+Every turn of one conversation is listed the same tools, byte for byte, so the provider's cached prompt carries over from turn to turn; what a turn may not do it is told when it calls the tool. Only what is fixed for the conversation shapes the list: `select_computer` in a direct chat whose bot may pick where it works (`OMB_COMPUTER_SELECTION`: Works on is not Off and no team computer is its own), refused with the reason on any turn but a person's own message; no `show_widget`, `show_html` or wait tools in a room (`OMB_ROOM`), since a room refuses the first two and holds no wait; `wait_until`, `list_waits` and `cancel_wait` in every direct chat, with or without a wait (with none, the last two say there is nothing to list or cancel); the skill tools wherever skill authoring is on, refused in a room to every turn but the first answer to a person's message.The old names (`delegate_bot`, `ask_bot`, `send_to_bot`, `check_delegation`, `wait_delegation`) stayed for one release as aliases with a deprecation line in their result and were removed in PR 5; `start_thread` opens a job on the bot itself.diff --git a/server/agents-bridge-names.ts b/server/agents-bridge-names.tsindex f6972815c1..b671a2d993 100644--- a/server/agents-bridge-names.ts+++ b/server/agents-bridge-names.ts@@ -8,7 +8,7 @@ import { availableTools } from "./drivers/agents-catalog.ts";/** Every catalog tool's name, whoever may call it, and every alias a call may still use. */export const CATALOG_TOOL_NAMES: ReadonlySet<string> = new Set([...availableTools({skillAuthoring: true, sharedComputers: true, voiceNotes: true, xResearch: true, escalations: true, team: true,- computerSelection: true, activeWaits: true, cloudHome: false, chief: true, mausbot: true, botId: WATCHER_OPTIONS_CARD_BOT_ID,+ computerSelection: true, cloudHome: false, chief: true, mausbot: true, botId: WATCHER_OPTIONS_CARD_BOT_ID,}).map((tool) => tool.name), ...Object.keys(AGENTS_TOOL_ALIASES)]);/** A call's name with a bridged call read as the tool it ran. With `serverNamed`, only a title that namesdiff --git a/server/agents-turn.test.ts b/server/agents-turn.test.tsnew file mode 100644index 0000000000..0c62d0804f--- /dev/null+++ b/server/agents-turn.test.ts@@ -0,0 +1,102 @@+// One conversation's agents tools on every kind of turn it gets. The tools/list a turn's server answers is the same bytes+// whatever started the turn and whatever the turn may do, so the provider's cached prompt carries over from turn to turn.+import { createHash } from "node:crypto";+import { describe, expect, it } from "vitest";+import { TOOL_BRIDGE_ENV } from "./drivers/agents-bridge.ts";+import { agentsMcp } from "./drivers/agents-mcp.ts";+import { agentsServerEnv, COMPUTER_OFF_REFUSAL, computerPickRefusal, directTurnKind, roomSkillsRefusal, type AgentsConversation, type AgentsTurn } from "./agents-turn.ts";++const HOST: AgentsConversation["host"] = { skillAuthoring: true, sharedComputers: true, cloudHome: false, team: false, escalations: true, voiceNotes: true, research: true };+const CHAT: AgentsConversation = { threadId: "thread-1", bot: { id: "bot-1", chiefOfStaff: true }, room: false, teamComputer: false, host: HOST };+const ROOM: AgentsConversation = { ...CHAT, threadId: "room-1", room: true };++/** Every kind of turn a direct chat gets and what that turn may do, as the harness hands it over. */+const CHAT_TURNS: Record<string, AgentsTurn> = {+ "the person's own message, which may pick its computer": { generation: "person", depth: 0, skillAuthoring: true },+ "a routine run": { generation: "routine", depth: 0, skillAuthoring: true },+ "a webhook run": { generation: "webhook", depth: 0, skillAuthoring: true },+ "a teammate's hand-off": { generation: "handoff", depth: 1, skillAuthoring: true },+ "a card continuation": { generation: "card", depth: 0, skillAuthoring: true },+ "the continuation on a newly picked computer": { generation: "picked", depth: 0, skillAuthoring: true },+ "a turn that delivers files saved outside its folders": { generation: "files", depth: 0, skillAuthoring: true, deliversSavedFiles: true },+};+/** And a room: only the first answer to a person's message may list or write skills. */+const ROOM_TURNS: Record<string, AgentsTurn> = {+ "the first answer to a person, holding the skill claim": { generation: "first", depth: 0, skillAuthoring: true },+ "a follow-up once the claim is spent": { generation: "follow-up", depth: 1, skillAuthoring: false },+ "a hand-off into the room": { generation: "room-handoff", depth: 1, skillAuthoring: false, roomHandoffId: "node-2" },+ "a goal step": { generation: "goal", depth: 0, skillAuthoring: false },+};++/** A bearer per turn, as the harness mints them: a turn's grants ride it, never the list. */+const bearer = (turn: AgentsTurn) => createHash("sha256").update(JSON.stringify(turn)).digest("hex").slice(0, 48);++async function toolsList(env: Record<string, string>): Promise<string> {+ const answer = await agentsMcp(env)({ jsonrpc: "2.0", id: 1, method: "tools/list" });+ return JSON.stringify((answer as { result: unknown }).result);+}++async function everyTurn(conversation: AgentsConversation, extra: Record<string, string> = {}) {+ return Promise.all(Object.entries(conversation.room ? ROOM_TURNS : CHAT_TURNS).map(async ([kind, turn]) => {+ const env = { ...agentsServerEnv(conversation, turn, bearer, "http://127.0.0.1:9"), ...extra };+ return { kind, env, wire: await toolsList(env) };+ }));+}++describe("one conversation's agents tools", () => {+ for (const [name, conversation] of [["a direct chat", CHAT], ["a room", ROOM]] as const) {+ for (const bridged of [false, true]) {+ it(`lists ${name} the same tools on every kind of turn, byte for byte${bridged ? ", with the tool bridge on" : ""}`, async () => {+ const turns = await everyTurn(conversation, bridged ? { [TOOL_BRIDGE_ENV]: "1" } : {});+ expect(new Set(turns.map(({ env }) => env.OMB_COMMS_TOKEN)).size).toBe(turns.length);+ for (const { kind, wire } of turns) expect(wire, kind).toBe(turns[0]!.wire);+ });+ }+ }++ it("lists a direct chat select_computer and the wait tools and a room none, and both the skill tools while authoring is on", async () => {+ const names = async (conversation: AgentsConversation) =>+ (JSON.parse((await everyTurn(conversation))[0]!.wire) as { tools: Array<{ name: string }> }).tools.map((tool) => tool.name);+ const chat = await names(CHAT), room = await names(ROOM);+ expect(chat).toEqual(expect.arrayContaining(["select_computer", "wait_until", "list_waits", "cancel_wait"]));+ for (const tool of ["select_computer", "wait_until", "list_waits", "cancel_wait"]) expect(room).not.toContain(tool);+ for (const tools of [chat, room]) expect(tools).toEqual(expect.arrayContaining(["skills_list", "skill_manage"]));+ expect(await names({ ...CHAT, host: { ...HOST, skillAuthoring: false } })).not.toContain("skill_manage");+ });++ it("leaves select_computer out only where the conversation can never pick a computer", async () => {+ const selects = async (conversation: AgentsConversation) => (await everyTurn(conversation))[0]!.wire.includes('"name":"select_computer"');+ expect(await selects({ ...CHAT, bot: { ...CHAT.bot, computer: "off" } })).toBe(false);+ expect(await selects({ ...CHAT, teamComputer: true })).toBe(false);+ expect(await selects({ ...CHAT, bot: { ...CHAT.bot, computer: "browser" } })).toBe(true);+ });+});++describe("what a turn that may not use a listed tool is told", () => {+ it("names what started a direct turn", () => {+ expect(directTurnKind({})).toBe("person");+ expect(directTurnKind({ automationSource: "schedule" })).toBe("routine");+ expect(directTurnKind({ automationSource: "manual" })).toBe("routine");+ expect(directTurnKind({ automationSource: "webhook" })).toBe("webhook");+ expect(directTurnKind({ commsDepth: 1 })).toBe("handoff");+ expect(directTurnKind({ coordination: { id: "node" } })).toBe("handoff");+ expect(directTurnKind({ peerAsk: { botId: "teammate" } })).toBe("handoff");+ expect(directTurnKind({ cardContinuation: true })).toBe("continuation");+ expect(directTurnKind({ computerSelectionContinuation: true })).toBe("continuation");+ expect(directTurnKind({ unattended: true })).toBe("continuation");+ });++ it("says why a computer cannot be picked on this turn, and what to do instead", () => {+ expect(computerPickRefusal("routine")).toBe("Picking a computer works only on a person's own message. This turn is a routine run, so carry on with the computer already in use.");+ expect(computerPickRefusal("webhook")).toBe("Picking a computer works only on a person's own message. This turn was started by a webhook, so carry on with the computer already in use.");+ expect(computerPickRefusal("handoff")).toBe("Picking a computer works only on a person's own message. This turn is a teammate's hand-off, so carry on with the computer already in use.");+ expect(computerPickRefusal("continuation")).toBe("Picking a computer works only on a person's own message. This turn continues earlier work, so carry on with the computer already in use.");+ expect(computerPickRefusal(undefined)).toMatch(/^Picking a computer works only once per request, on a person's own message\. Carry on with/);+ expect(COMPUTER_OFF_REFUSAL).toMatch(/Works on setting is Off/);+ });++ it("says which room turn may change skills", () => {+ expect(roomSkillsRefusal(false)).toBe("In a room, only the first bot answering a person's message can list or write skills. This turn is a follow-up, so carry on without changing skills.");+ expect(roomSkillsRefusal(true)).toMatch(/This turn is a teammate's hand-off, so carry on without changing skills\.$/);+ });+});diff --git a/server/agents-turn.ts b/server/agents-turn.tsnew file mode 100644index 0000000000..a9b63d2337--- /dev/null+++ b/server/agents-turn.ts@@ -0,0 +1,84 @@+// The agents server on one turn of a conversation. Providers cache a prompt from its start, tool definitions first, so a+// tool that came or went between two turns of one conversation would re-bill the whole conversation at the uncached+// price: what the server lists comes from the conversation alone, and a turn that may not use a listed tool is told why+// when it calls it.+import { AGENTS_PROXY_ENV } from "./agents-bridge-switch.ts";+import { roleToolEnv } from "./chief-level.ts";++/** The facts of a conversation that decide its agents tools. A settings change may change them; a turn never does. */+export interface AgentsConversation {+ threadId: string;+ bot: NonNullable<Parameters<typeof roleToolEnv>[0]> & { id: string; computer?: string; memoryEnabled?: boolean; xResearch?: boolean };+ /** A room's thread: rooms refuse widgets, pages and a computer pick. */+ room: boolean;+ /** The bot works on its team's cloud computer, so it has no computer of its own to pick. */+ teamComputer: boolean;+ host: { skillAuthoring: boolean; sharedComputers: boolean; cloudHome: boolean; team: boolean; escalations: boolean; voiceNotes: boolean; research: boolean };+}++/** What one turn may do. Its bearer carries this to the harness, which checks it on every call. */+export interface AgentsTurn {+ generation: string;+ depth: number;+ /** In a room only the first answer to a person's message may list or write skills. */+ skillAuthoring: boolean;+ roomHandoffId?: string;+ deliversSavedFiles?: boolean;+}++const flag = (on: boolean) => (on ? "1" : "0");++export function agentsServerEnv(conversation: AgentsConversation, turn: AgentsTurn, bearer: (turn: AgentsTurn) => string, harnessUrl: string): Record<string, string> {+ const { bot, host } = conversation;+ return {+ ...AGENTS_PROXY_ENV,+ OMB_HARNESS_URL: harnessUrl,+ OMB_BOT_ID: bot.id,+ OMB_THREAD_ID: conversation.threadId,+ OMB_COMMS_TOKEN: bearer(turn),+ OMB_TURN_DEPTH: String(turn.depth),+ OMB_SKILL_AUTHORING_ENABLED: flag(host.skillAuthoring),+ OMB_MEMORY_ENABLED: flag(bot.memoryEnabled !== false),+ OMB_SHARED_COMPUTERS_ENABLED: flag(host.sharedComputers),+ OMB_CLOUD_HOME: flag(host.cloudHome), OMB_TEAM_PEOPLE: flag(host.team), OMB_ROOM: flag(conversation.room),+ OMB_VOICE_NOTES: flag(host.voiceNotes),+ OMB_X_RESEARCH: flag(host.research && bot.xResearch !== false),+ ...roleToolEnv(bot),+ OMB_ESCALATIONS: flag(host.escalations),+ OMB_COMPUTER_SELECTION: flag(!conversation.room && bot.computer !== "off" && !conversation.teamComputer),+ };+}++/** What started a direct turn, in the words a refusal uses. */+export type TurnKind = "person" | "routine" | "webhook" | "handoff" | "continuation";++export function directTurnKind(turn: {+ automationSource?: string; commsDepth?: number; coordination?: unknown; peerAsk?: unknown;+ cardContinuation?: boolean; computerSelectionContinuation?: boolean; unattended?: boolean; compactOnly?: boolean;+}): TurnKind {+ if (turn.automationSource === "webhook") return "webhook";+ if (turn.automationSource !== undefined) return "routine";+ if (turn.commsDepth || turn.coordination || turn.peerAsk) return "handoff";+ if (turn.cardContinuation || turn.computerSelectionContinuation || turn.unattended || turn.compactOnly) return "continuation";+ return "person";+}++const THIS_TURN: Record<Exclude<TurnKind, "person">, string> = {+ routine: "This turn is a routine run",+ webhook: "This turn was started by a webhook",+ handoff: "This turn is a teammate's hand-off",+ continuation: "This turn continues earlier work",+};++export const COMPUTER_OFF_REFUSAL = "This bot's Works on setting is Off, so it has no computer to pick. Work without one, or ask the person to choose a place in this bot's settings.";++/** select_computer on a turn that may not pick, `kind` being what started it. */+export function computerPickRefusal(kind: TurnKind | undefined): string {+ if (kind === undefined || kind === "person") return "Picking a computer works only once per request, on a person's own message. Carry on with the computer already in use.";+ return `Picking a computer works only on a person's own message. ${THIS_TURN[kind]}, so carry on with the computer already in use.`;+}++/** skills_list or skill_manage on a room turn that is not the first answer to a person's message. */+export function roomSkillsRefusal(handoff: boolean): string {+ return `In a room, only the first bot answering a person's message can list or write skills. ${handoff ? THIS_TURN.handoff : "This turn is a follow-up"}, so carry on without changing skills.`;+}diff --git a/server/cloud-team-browser.e2e.test.ts b/server/cloud-team-browser.e2e.test.tsindex e48dd9fea2..52afd8717c 100644--- a/server/cloud-team-browser.e2e.test.ts+++ b/server/cloud-team-browser.e2e.test.ts@@ -20,8 +20,10 @@ const OWNER = { email: "[email protected]", role: "owner" as const };const ADMIN = { email: "[email protected]", role: "admin" as const };const MEMBER_A = { email: "[email protected]", role: "member" as const };const MEMBER_C = { email: "[email protected]", role: "member" as const };-const ENGINE = `import { readFileSync as readToolCalls } from "node:fs";-try { process.env.FAKE_CLAUDE_TOOL_CALLS = readToolCalls(process.env.FAKE_CLAUDE_FIXTURE_DIR + "/tool-calls.json", "utf8"); } catch {}`;+// A conversation's engine stays warm across turns, as in production: it reads its launch files on the first turn, while+// they are on disk (the dump does), and its scripted calls again on every turn.+const ENGINE = `process.env.FAKE_CLAUDE_DUMP = process.env.FAKE_CLAUDE_FIXTURE_DIR + "/dump.json";+process.env.FAKE_CLAUDE_TOOL_CALLS_FILE = process.env.FAKE_CLAUDE_FIXTURE_DIR + "/tool-calls.json";`;const REAL_BROWSER = process.env.OMB_TEAM_BROWSER_E2E === "1" || (process.platform === "linux" && Boolean(resolveAgentBrowserBinary({ env: process.env })));if (!REAL_BROWSER) console.log("skipping the Team Cloud sign-in check: it needs agent-browser and its Chrome on Linux (or OMB_TEAM_BROWSER_E2E=1)");diff --git a/server/composio.test.ts b/server/composio.test.tsindex c4faf94aa3..05b6698500 100644--- a/server/composio.test.ts+++ b/server/composio.test.ts@@ -74,6 +74,7 @@ let brokerToolsListFail = false;// What /broker/v1/connectors/connected serves; null falls back to github// only, the state the existing validation tests were written against.let brokerConnectedServicesBody: { services: Record<string, { connected: boolean; status: string }> } | null = null;+let brokerConnectedServicesFail = false;// What /broker/v1/catalog serves; null falls back to github only.let brokerCatalogBody: { items: Array<{ slug: string; name: string }> } | null = null;// The project's own auth configs, and those the stub Session was created with: a Session knows only the configs named at creation.@@ -113,6 +114,10 @@ beforeAll(async () => {return res.end(JSON.stringify({ services }));}if (req.method === "GET" && url.pathname === "/broker/v1/connectors/connected") {+ if (brokerConnectedServicesFail) {+ res.writeHead(503, { "content-type": "application/json" });+ return res.end(JSON.stringify({ error: "unavailable" }));+ }res.writeHead(200, { "content-type": "application/json" });return res.end(JSON.stringify(brokerConnectedServicesBody ?? { services: { github: { connected: true, status: "ACTIVE" } } },@@ -974,6 +979,24 @@ describe.sequential("Composio Sessions", () => {await expect(connectedServiceSlugs({})).resolves.toEqual([]);});+ it("keeps the last service slugs when a later read fails, so the bridge's tools stay as they were", async () => {+ const access = { url: origin + "/broker", token: "e".repeat(64) };+ brokerConnectedServicesBody = { services: { bland_ai: { connected: true, status: "ACTIVE" } } };+ const start = Date.now();+ const now = vi.spyOn(Date, "now");+ try {+ await expect(connectedServiceSlugs({}, access)).resolves.toEqual(["bland_ai"]);+ brokerConnectedServicesFail = true;+ now.mockReturnValue(start + 61_000);+ await expect(connectedServiceSlugs({}, access)).resolves.toEqual(["bland_ai"]);+ await expect(connectedServiceSlugs({}, { ...access, token: "d".repeat(64) })).resolves.toEqual([]);+ } finally {+ now.mockRestore();+ brokerConnectedServicesFail = false;+ brokerConnectedServicesBody = null;+ }+ });+it("validates grant patches against connected services and the catalog", async () => {const cfg: AppConfig = {composio: { apiKey: "ak_test", userId: "openmausbot_existing", sessionId: "trs_test" },diff --git a/server/composio.ts b/server/composio.tsindex f15a814322..5210655ecb 100644--- a/server/composio.ts+++ b/server/composio.ts@@ -580,7 +580,7 @@ function connectorToolsIdentity(cfg: AppConfig, as?: BrokerAccess): string {let connectorToolsRequest: { identity: string; services: Promise<Record<string, ConnectorToolListing[]>> } | null = null;-/** Real backend slugs, so an underscored service (bland_ai) is never captured by a plain-prefix grant (bland). */+/** Real backend slugs, so an underscored service (bland_ai) is never captured by a plain-prefix grant (bland); a failed read answers the last good one. */export async function connectedServiceSlugs(cfg: AppConfig, as?: BrokerAccess): Promise<readonly string[]> {const identity = connectorToolsIdentity(cfg, as);if (connectorServiceSlugsCache?.identity === identity@@ -594,7 +594,7 @@ export async function connectedServiceSlugs(cfg: AppConfig, as?: BrokerAccess):connectorServiceSlugsCache = { at: Date.now(), identity, slugs };return slugs;},- () => [] as readonly string[],+ () => connectorServiceSlugsCache?.identity === identity ? connectorServiceSlugsCache.slugs : [] as readonly string[],);connectorServiceSlugsRequest = { identity, slugs: walk };try {diff --git a/server/direct-screen-settlement-api.test.ts b/server/direct-screen-settlement-api.test.tsindex 7bfc85174e..ed5c597377 100644--- a/server/direct-screen-settlement-api.test.ts+++ b/server/direct-screen-settlement-api.test.ts@@ -143,7 +143,9 @@ describe.skipIf(process.platform === "win32")("direct final-screen settlement",gate("capture.gate");await expect.poll(async () => (await bot()).busy, { timeout: 15_000 }).toBe(false);const messages = (await bot()).messages;- expect(messages.some((message: any) => typeof message.text === "string" && withoutTurnClock(message.text).includes("reply to: FOLLOWUP_AFTER_SCREEN"))).toBe(true);+ // The follow-up runs in the conversation's warm engine, so its prompt may lead with the instructions that changed.+ expect(messages.some((message: any) => message.role === "bot" && typeof message.text === "string" &&+ withoutTurnClock(message.text).startsWith("reply to: ") && message.text.endsWith("FOLLOWUP_AFTER_SCREEN"))).toBe(true);expect(messages.some((message: any) => message.tool?.name?.includes("another thread is working"))).toBe(false);const screenIndex = messages.findIndex((message: any) => message.kind === "screen");expect(screenIndex).toBeGreaterThanOrEqual(0);diff --git a/server/drivers/agents-bridge-wire.test.ts b/server/drivers/agents-bridge-wire.test.tsindex bb63de7fc2..bad2128676 100644--- a/server/drivers/agents-bridge-wire.test.ts+++ b/server/drivers/agents-bridge-wire.test.ts@@ -63,9 +63,9 @@ function profiles(): Record<string, Record<string, string>> {all["skills+shared+voice+escalations"] = { ...all["skills+shared+voice"]!, OMB_ESCALATIONS: "1" };all["skills+shared+voice+escalations+x"] = { ...all["skills+shared+voice+escalations"]!, OMB_X_RESEARCH: "1" };all["skills+shared+voice+escalations+x+team"] = { ...all["skills+shared+voice+escalations+x"]!, OMB_TEAM_PEOPLE: "1" };- all["default+legacy-switches"] = { ...all.default!, OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1" };+ all["default+legacy-switches"] = { ...all.default!, OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1", OMB_ACTIVE_WAITS: "0" };for (const name of ["default", "skills+shared+voice"]) all[`${name}+mausbot`] = { ...all[name]!, OMB_MAUSBOT: "1" };- all["default+handoff"] = { ...all.default!, OMB_COMPUTER_SELECTION: "0" };+ all["default+no-computer-pick"] = { ...all.default!, OMB_COMPUTER_SELECTION: "0" };for (const name of ["default", "non-chief"]) all[`${name}+room`] = { ...all[name]!, OMB_COMPUTER_SELECTION: "0", OMB_ROOM: "1" };return all;}@@ -105,7 +105,7 @@ const BUDGET_BASELINE: Record<string, number> = {"default+legacy-switches": 16064,"default+mausbot": 16116,"skills+shared+voice+mausbot": 16964,- "default+handoff": 14852,+ "default+no-computer-pick": 14852,"default+room": 14828,"non-chief+room": 14711,};diff --git a/server/drivers/agents-catalog-goldens/bridged.profiles.json b/server/drivers/agents-catalog-goldens/bridged.profiles.jsonindex 18fb8d7fa4..483248ff2b 100644--- a/server/drivers/agents-catalog-goldens/bridged.profiles.json+++ b/server/drivers/agents-catalog-goldens/bridged.profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 16194,- "sha256": "a5686d95df45b86914b49e4783ae5b26f8986af4bf73276ee21cf7b67713645d",+ "bytes": 16219,+ "sha256": "b6342860edad76ac868441117dd5cbecd14370045e8b777409ce6897e04de4cc","tools": ["tool_result_read","list_room_targets",@@ -21,8 +21,8 @@]},"voice": {- "bytes": 16975,- "sha256": "0c70a42d2cfbb6e9fe9a4023a457d21cf00da10426423462a814c392011ae7df",+ "bytes": 17000,+ "sha256": "fbe4c06e1ef42790616b46c63b76dc6a3b0869ab400101ff6ee1da3a8b048e5a","tools": ["tool_result_read","list_room_targets",@@ -43,8 +43,8 @@]},"shared": {- "bytes": 16234,- "sha256": "18aa56063d9e27afe7fa8116839b61259518ffa12f6875db10ebcd1a083230ab",+ "bytes": 16259,+ "sha256": "23eb6b7a4861a49c16a92dbe39d4fe9d32eb11c676448e9f3e9534fdd7942966","tools": ["tool_result_read","list_room_targets",@@ -64,8 +64,8 @@]},"shared+voice": {- "bytes": 17015,- "sha256": "a6041694ea70ba49d03d4ff453992de5d9dd14c6a4ed0e1b9d9830ff29f840c4",+ "bytes": 17040,+ "sha256": "bd2ce7841d94305a55383855d93b6255d161d4f2ca8c5f3d9ee71bfad9309e39","tools": ["tool_result_read","list_room_targets",@@ -86,8 +86,8 @@]},"skills": {- "bytes": 16221,- "sha256": "a3701d06e1eb0aa0096ffb806d7780f03d015771d7d51b3323dedb184df4a534",+ "bytes": 16246,+ "sha256": "b881f8a641af369193feaea714633ccc137598baddc4f0e30d304fba4d78b81b","tools": ["tool_result_read","list_room_targets",@@ -107,8 +107,8 @@]},"skills+voice": {- "bytes": 17002,- "sha256": "31981dba5bbc7b4b6a381efab249b3df072c7019ff0264ed70d0ac69588dbdcf",+ "bytes": 17027,+ "sha256": "9ad86bef3561f6b66d38f51b9e5c1179a2bad04e630572a88389474fe1e978c7","tools": ["tool_result_read","list_room_targets",@@ -129,8 +129,8 @@]},"skills+shared": {- "bytes": 16261,- "sha256": "a73c9c906eb3c58c52f8b4b2b41fba68754634ff1abc13309d49d8eb3a765b01",+ "bytes": 16286,+ "sha256": "066c5248963ebfdbcd7753c49e24dc5cd9e66a3098b06f3a9b7888e74f9ceda9","tools": ["tool_result_read","list_room_targets",@@ -150,8 +150,8 @@]},"skills+shared+voice": {- "bytes": 17042,- "sha256": "66c3d261f0b65b77629ba03fbfabf6987205809909e66211bd3be2ed776b9b3c",+ "bytes": 17067,+ "sha256": "2a665b45d8aedee1b0dbd2673a3f0352922e669f5c196c6debb0cd180c774733","tools": ["tool_result_read","list_room_targets",@@ -172,8 +172,8 @@]},"non-chief": {- "bytes": 16077,- "sha256": "0c53c56a8581f978d47300f4a3dffcd27e41c5105bcc2a9471ca9fa317765c00",+ "bytes": 16102,+ "sha256": "ceb6ca239ae9f831c9901e4dc709d7e4c051ba2771c2c103cf2a548c0451baf3","tools": ["tool_result_read","list_room_targets",@@ -193,8 +193,8 @@]},"voice+non-chief": {- "bytes": 16858,- "sha256": "ec0f09bee675f4e68ebd2bb6ee0c96a9942116122102eed882d33754145b550e",+ "bytes": 16883,+ "sha256": "e6571e8c6cb1bdfe17d8f1c937d7ac248a8d0a9c510c5ec88ab051f757a31c34","tools": ["tool_result_read","list_room_targets",@@ -215,8 +215,8 @@]},"shared+non-chief": {- "bytes": 16117,- "sha256": "5c26dc9f463fb47747ce79ce2d1e51464e737b3fa9189985eda15941383baabd",+ "bytes": 16142,+ "sha256": "943ccdf46519ff34a52b24d77487e84da63a1f911bf5c5d285cf3a5aafd9e815","tools": ["tool_result_read","list_room_targets",@@ -236,8 +236,8 @@]},"shared+voice+non-chief": {- "bytes": 16898,- "sha256": "23b268356e721f49bd8edfa69a1d5f25105eb4f5f6b45d3b334e250102dc02f1",+ "bytes": 16923,+ "sha256": "a7f60943aa586b0b78bbf2877f4ad0b94466c33c6a832d02699f9d9523aa2dfd","tools": ["tool_result_read","list_room_targets",@@ -258,8 +258,8 @@]},"skills+non-chief": {- "bytes": 16104,- "sha256": "648ddae4b113569ece691ecc4f08eb9b7f5ad0a5e70cb542c421e8b0b50edf0e",+ "bytes": 16129,+ "sha256": "1d2901f32309994a3ab7567a379beb26790516b2c4e4662bd12cf3923a4ad4f4","tools": ["tool_result_read","list_room_targets",@@ -279,8 +279,8 @@]},"skills+voice+non-chief": {- "bytes": 16885,- "sha256": "b2d8519f3beb2c21a2b0087721915787e4408cf20a9d986e2adcfa107b0cbe43",+ "bytes": 16910,+ "sha256": "40e21dac652b1ebf157cb7094fe3af465bfb4546e1c25f1657ed62b470643feb","tools": ["tool_result_read","list_room_targets",@@ -301,8 +301,8 @@]},"skills+shared+non-chief": {- "bytes": 16144,- "sha256": "f760025d87b8595e6a2218ee8e24314a5c4ef8c0e9adf925d12e3d8bca1c5cea",+ "bytes": 16169,+ "sha256": "da4038bc15e87ec75655fdf7c239f4096aa28be61e755a532bb4c67970c61abf","tools": ["tool_result_read","list_room_targets",@@ -322,8 +322,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 16925,- "sha256": "7a1239d6ddadd1c5564784018de306c2f2beafdb5d5c79811a304ccd2d7b2e5f",+ "bytes": 16950,+ "sha256": "0d467cc48c8c604fa6c4c38b0c3d331bad49322962a9d319c5f2f5622146a792","tools": ["tool_result_read","list_room_targets",@@ -344,8 +344,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 17040,- "sha256": "d118cdb958f6358cf1204dbdbb576a9561ce1a8e6b500eb64ba086ea8490e8e7",+ "bytes": 17065,+ "sha256": "7f7e1bda99c3837a18451fecf1e5ccdf678eccba3f6961e98f7c564fae7a2c8f","tools": ["tool_result_read","list_room_targets",@@ -366,8 +366,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 16923,- "sha256": "f3b089f063234f60518beaec477ccce4d0a30bff4855a30f673879641117ea03",+ "bytes": 16948,+ "sha256": "d08915421855a50830f6ffbc12f1f3db7622c8ad3d52fcaf1a02d15c33163a84","tools": ["tool_result_read","list_room_targets",@@ -388,8 +388,8 @@]},"skills+shared+voice+escalations": {- "bytes": 17060,- "sha256": "88499d977512c6472be1719cfd2d9e0c6f8786b1f125c58810dbd6c2465c946f",+ "bytes": 17085,+ "sha256": "368975e1a6cc444962b7300e2acf5eac4e6b072332edc3b4360c756656b63bf6","tools": ["tool_result_read","list_room_targets",@@ -410,8 +410,8 @@]},"skills+shared+voice+escalations+x": {- "bytes": 17121,- "sha256": "eaff0c51f59ef56649178f7005cca5a5013b2cda156a92a701fb656e96878e97",+ "bytes": 17146,+ "sha256": "64867571c8c4b1e09560f8d710f64782ea930575a62693b31b4bf4bedcd4143c","tools": ["tool_result_read","list_room_targets",@@ -432,8 +432,8 @@]},"skills+shared+voice+escalations+x+team": {- "bytes": 17137,- "sha256": "736ff88df3c197844ed36d47c267e34fde791d1ec5328e2800d39a14e29457dd",+ "bytes": 17162,+ "sha256": "46d2483c175db1558322ecf4d7b2846700a4289b048bac30d45c6a70789eca11","tools": ["tool_result_read","list_room_targets",@@ -454,8 +454,8 @@]},"default+legacy-switches": {- "bytes": 16194,- "sha256": "a5686d95df45b86914b49e4783ae5b26f8986af4bf73276ee21cf7b67713645d",+ "bytes": 16219,+ "sha256": "b6342860edad76ac868441117dd5cbecd14370045e8b777409ce6897e04de4cc","tools": ["tool_result_read","list_room_targets",@@ -475,8 +475,8 @@]},"default+mausbot": {- "bytes": 16246,- "sha256": "196b9a8cdc89f27cef7aca09b212643dde6b5e4845e722b8c7e2c3896600ab7d",+ "bytes": 16271,+ "sha256": "6bd5b3f77b73ce52f3bd107d8b0503cb55b24d214884a20c1b048e74c9c38833","tools": ["tool_result_read","list_room_targets",@@ -496,8 +496,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 17094,- "sha256": "b418afc6c98f43f49c6109c6b129a35b47fea7981d4a11d78af9982dfe2ec5b0",+ "bytes": 17119,+ "sha256": "a99702124a5d8e0335ea37a0b6341f7f4497580ca7a11383acf5a19cc3bf986e","tools": ["tool_result_read","list_room_targets",@@ -517,9 +517,9 @@"use_tool"]},- "default+handoff": {- "bytes": 14982,- "sha256": "aed068b7fe762d93ee726468d6bfeead92be485d93dc9c08dc3c0571d7004137",+ "default+no-computer-pick": {+ "bytes": 15007,+ "sha256": "26bc46b953d6f4a080713f55902c732252a0e9f508fa8e8d8fe70d9b68d1f83c","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-catalog-goldens/bridged.tools-list.json b/server/drivers/agents-catalog-goldens/bridged.tools-list.jsonindex 37bc91834b..45ef5e456d 100644--- a/server/drivers/agents-catalog-goldens/bridged.tools-list.json+++ b/server/drivers/agents-catalog-goldens/bridged.tools-list.json@@ -373,7 +373,7 @@},{"name": "find_tool",- "description": "Find an OpenMausBot tool that is not in your tool list. Say what you want to do in a few words, or give the tool's name. Each match comes back with its description and exact input schema; run one with use_tool. Tools reached this way: list_shared_computers, shared_computer, assignment_status, raise_escalation, list_threads, close_thread, start_thread, vm_exec, show_widget, show_html, unpublish_page, create_bot, list_team_setup, list_team_library, propose_team_setup, propose_bot_deletion, manage_room, x_search, research_search, research_endpoint, research_call, decide, extract, message_person, report_bug, retry_thread, memory_log, session_search, trigger_info, trigger, delete_trigger, wait_until, propose_profile, propose_model, propose_team_memory, skills_list, skill_manage, add_mcp_server.",+ "description": "Find an OpenMausBot tool that is not in your tool list. Say what you want to do in a few words, or give the tool's name. Each match comes back with its description and exact input schema; run one with use_tool. Tools reached this way: list_shared_computers, shared_computer, assignment_status, raise_escalation, list_threads, close_thread, start_thread, vm_exec, show_widget, show_html, unpublish_page, create_bot, list_team_setup, list_team_library, propose_team_setup, propose_bot_deletion, manage_room, x_search, research_search, research_endpoint, research_call, decide, extract, message_person, report_bug, retry_thread, memory_log, session_search, trigger_info, trigger, delete_trigger, wait_until, list_waits, cancel_wait, propose_profile, propose_model, propose_team_memory, skills_list, skill_manage, add_mcp_server.","inputSchema": {"type": "object","additionalProperties": false,diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.jsonindex 8fb2174a28..a11e182292 100644--- a/server/drivers/agents-catalog-goldens/full.tools-list.json+++ b/server/drivers/agents-catalog-goldens/full.tools-list.json@@ -1564,6 +1564,37 @@]}},+ {+ "name": "list_waits",+ "description": "Your waits in this chat that have not ended (wait_until): id, label, what it checks, when it was made and when it stops.",+ "inputSchema": {+ "type": "object",+ "additionalProperties": false,+ "properties": {}+ },+ "annotations": {+ "readOnlyHint": true,+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": false+ }+ },+ {+ "name": "cancel_wait",+ "description": "Stop one of your waits; its id comes from list_waits or wait_until's answer.",+ "inputSchema": {+ "type": "object",+ "additionalProperties": false,+ "properties": {+ "id": {+ "type": "string"+ }+ },+ "required": [+ "id"+ ]+ }+ },{"name": "propose_profile","description": "Submit user-requested changes to your own name, title, description, standing instructions (SOUL.md), working folder (cwd), or your alert and voice toggles (notifications, speakReplies). Keep SOUL.md short — who you are and the rules you never break; put step-by-step procedure into a skill instead. A Chief of Staff may pass for_bot_id (from list_bots) for a requested change to another bot in its section. Read the result: it applies immediately at every access level, and the person sees it with an Undo where possible. If applied, continue the work without another confirmation. Only a pending result (a Cloud conversation its owner did not drive) means ending the turn to wait for the owner. Never claim success without an applied result; report failures honestly. This does not elevate another bot's execution permissions.",diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex 33f2aa5bcd..1caddc2dfd 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 56030,- "sha256": "277330b3463508a9839dedd0dd99533fee12dd87441d0c344f0dd4d839b7e005",+ "bytes": 56603,+ "sha256": "d8e72fdc62a507238eaf4c38c51de80bb63530c5520a9899f8c4f6328231a420","tools": ["tool_result_read","list_room_targets",@@ -40,6 +40,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -47,8 +49,8 @@]},"voice": {- "bytes": 56811,- "sha256": "d09ec1ba3563c2870f1ab963c12d8e39b304ac62f3409dac85380c73ce9d3f19",+ "bytes": 57384,+ "sha256": "fb9a77e6236c217fa417c3cb097baccb8dcbcaac372442c6b008f22e8c984d2f","tools": ["tool_result_read","list_room_targets",@@ -88,6 +90,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -95,8 +99,8 @@]},"shared": {- "bytes": 58130,- "sha256": "13711eda72a72fd8088bf8175a318dffe4fdbf6b097c2e132b7a7e7f16f5b858",+ "bytes": 58703,+ "sha256": "1458e0c8667d2247528ea640050c1ad80f40d0f8ccc878f8d4e042c835459a51","tools": ["tool_result_read","list_shared_computers",@@ -137,6 +141,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -144,8 +150,8 @@]},"shared+voice": {- "bytes": 58911,- "sha256": "dd12ef0aa9fee6d8000afcd19eaab3442547e0317c6b0e66f10a0633df7d6801",+ "bytes": 59484,+ "sha256": "63984825e91b116266475ad863857fdce60502cb6638bc88d7e7981bab5aab8b","tools": ["tool_result_read","list_shared_computers",@@ -187,6 +193,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -194,8 +202,8 @@]},"skills": {- "bytes": 58849,- "sha256": "615ce770723a8d54f2239c307399edc88e1f120da635c0434dd5807c6a081a36",+ "bytes": 59422,+ "sha256": "ba5bf5fc4019a9bf9f510dc00042dee9a0cdd3dfad411fa0b1f0c494a192fa10","tools": ["tool_result_read","list_room_targets",@@ -234,6 +242,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -243,8 +253,8 @@]},"skills+voice": {- "bytes": 59630,- "sha256": "f57b83c6f2e67c8cfcb91ee96fe7e8573995e5a36d595cbbd0289c55a8806fbf",+ "bytes": 60203,+ "sha256": "3b9eea793b5a10d4d434ab5959008ed968b6a8eb8c2489ecc5a58323d2e2134e","tools": ["tool_result_read","list_room_targets",@@ -284,6 +294,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -293,8 +305,8 @@]},"skills+shared": {- "bytes": 60949,- "sha256": "528b685195e1a5c4e5756f37b0d4fc9efa30584fa0a192d4f78a0a117b51c6a4",+ "bytes": 61522,+ "sha256": "c48d673b811967a6651529602fc5da1fd4a6b89a63bfdccd50bae3bd1f878123","tools": ["tool_result_read","list_shared_computers",@@ -335,6 +347,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -344,8 +358,8 @@]},"skills+shared+voice": {- "bytes": 61730,- "sha256": "53f8f3d36d5baae695a581c106fe1d7e083de7c6da05f058754b999474f5c476",+ "bytes": 62303,+ "sha256": "039bd0061815f56c556d77b4ef3c7df20833cf777cc7f8ec495e7093606083ad","tools": ["tool_result_read","list_shared_computers",@@ -387,6 +401,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -396,8 +412,8 @@]},"non-chief": {- "bytes": 46973,- "sha256": "73b31997bda74dce6110eca0cc661711f471ec0303aaddd794f0942182f56c5d",+ "bytes": 47546,+ "sha256": "ebad1a241f1df2ddd49937e759fd5882247df9d1b11c6a0afe871572f7ef6bb4","tools": ["tool_result_read","list_room_targets",@@ -429,6 +445,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -436,8 +454,8 @@]},"voice+non-chief": {- "bytes": 47754,- "sha256": "b057caa85cd409fc246a90da38ac28d65b4115b11065c9b27dd53276e2c6f161",+ "bytes": 48327,+ "sha256": "c97631a27a0387836a56be1b1203683cc3bacd6a0fadad13bfb4d211460cc623","tools": ["tool_result_read","list_room_targets",@@ -470,6 +488,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -477,8 +497,8 @@]},"shared+non-chief": {- "bytes": 49073,- "sha256": "3447a9645994d6b098f9d674dccee5a7c6c920c703afc7ac8a9fd221a8c3d791",+ "bytes": 49646,+ "sha256": "20eb599342803363bde16506a72d37ebc533dcaba02f773745a75c82e561d0dc","tools": ["tool_result_read","list_shared_computers",@@ -512,6 +532,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -519,8 +541,8 @@]},"shared+voice+non-chief": {- "bytes": 49854,- "sha256": "f32c3b3b80e6440f8827b451022566a12e431f57b810d4f48f551fbb672e3e58",+ "bytes": 50427,+ "sha256": "41907a843c9a8f99b64ece95ad84e53bf50cc7dba0508234f2766ec10539e627","tools": ["tool_result_read","list_shared_computers",@@ -555,6 +577,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -562,8 +586,8 @@]},"skills+non-chief": {- "bytes": 49792,- "sha256": "f0c3446e8bae858de81a94f54a0cc7a10f008ab1f8e02255818daad25b5447fd",+ "bytes": 50365,+ "sha256": "58f1ef7281e90fd029aeebea004b3c378a80dcafa91417b43d984012168f9be6","tools": ["tool_result_read","list_room_targets",@@ -595,6 +619,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -604,8 +630,8 @@]},"skills+voice+non-chief": {- "bytes": 50573,- "sha256": "634141dec1f2bf3babe3be74285d53fadd38d9267012a201ef35709bcaed46ea",+ "bytes": 51146,+ "sha256": "e50818291aaf240cb20b05eebf49762fb6d61deb1f52d189364cb9203f427f46","tools": ["tool_result_read","list_room_targets",@@ -638,6 +664,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -647,8 +675,8 @@]},"skills+shared+non-chief": {- "bytes": 51892,- "sha256": "bc114b25482e4f2dba7d78a674c6a3db8d89e35288b2fd48657eb968652d1e86",+ "bytes": 52465,+ "sha256": "49be38bb7da99b6a4110dde54d19fa7343aff49269ee537070c982c7b576a148","tools": ["tool_result_read","list_shared_computers",@@ -682,6 +710,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -691,8 +721,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 52673,- "sha256": "7971f0d71c3015ede83f7afed5783b451c367f552fa22b94b477b227708a99c6",+ "bytes": 53246,+ "sha256": "896503ab1a07f07fb7fee117ebb08b3bb81c7170e5aeab80b41e963e2eba7062","tools": ["tool_result_read","list_shared_computers",@@ -727,6 +757,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -736,8 +768,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 60811,- "sha256": "3cf72cdd6b27ea665cf9f3b4e61ad176800d9676eda9887d9ffb5512a2b1bda7",+ "bytes": 61384,+ "sha256": "b6f9ea1346460072566568656de10ee351adc3b27b9926dc8467dcbcf476dd67","tools": ["tool_result_read","list_shared_computers",@@ -778,6 +810,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -787,8 +821,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 51754,- "sha256": "ccc7d02a98e2fe73f779ad942d24086087422dc8cd4cbfcbb069df71ec4bfca0",+ "bytes": 52327,+ "sha256": "1054f876aabf88677e458ddc92157bfe9c5d270588b9bff65dfec85630b9267c","tools": ["tool_result_read","list_shared_computers",@@ -822,6 +856,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -831,8 +867,8 @@]},"skills+shared+voice+escalations": {- "bytes": 62560,- "sha256": "ca57b486a33ad1b0000b4376d53a0064fdc457d39db0db232bafe9c7429b37f8",+ "bytes": 63133,+ "sha256": "d663631b7791e02952edef51d9cdc23f8d14c79b4baff1606c9a03e0e3c3e649","tools": ["tool_result_read","list_shared_computers",@@ -875,6 +911,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -884,8 +922,8 @@]},"skills+shared+voice+escalations+x": {- "bytes": 66399,- "sha256": "2e74581168c148752b6868a1a6a867d6bc6565eb19cfbf0e0ab4750247a9e830",+ "bytes": 66972,+ "sha256": "14259dc6c1bf67c5caef5ec8d66f55fd61d56f4116bda1cee2bce197c794bb95","tools": ["tool_result_read","list_shared_computers",@@ -932,6 +970,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -941,8 +981,8 @@]},"skills+shared+voice+escalations+x+team": {- "bytes": 67031,- "sha256": "11a74db0c69f231adf07e342c12f71baf70f53a7735c1a510a887f125927def1",+ "bytes": 67604,+ "sha256": "8bb76cfda731016268c7635996c04466c80a4417e8204a50f3d6a0205a971584","tools": ["tool_result_read","list_shared_computers",@@ -990,6 +1030,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -999,8 +1041,8 @@]},"default+legacy-switches": {- "bytes": 56030,- "sha256": "277330b3463508a9839dedd0dd99533fee12dd87441d0c344f0dd4d839b7e005",+ "bytes": 56603,+ "sha256": "d8e72fdc62a507238eaf4c38c51de80bb63530c5520a9899f8c4f6328231a420","tools": ["tool_result_read","list_room_targets",@@ -1039,6 +1081,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -1046,8 +1090,8 @@]},"default+mausbot": {- "bytes": 56681,- "sha256": "1612054aaa6e02ee99e882b4e73a0261d6f6e6a97525a95af1a5c0969147e324",+ "bytes": 57254,+ "sha256": "a7949eacefbfe334c363fc2f74b44f1debc363a94c35b1dcbd2b7411dcd855f1","tools": ["tool_result_read","list_room_targets",@@ -1086,6 +1130,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -1095,8 +1141,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 62381,- "sha256": "f649b8271cda9d3ca42e9a4ec77204cc17b76015b2df338a9df4e1c9d0a7b354",+ "bytes": 62954,+ "sha256": "bc65d377fbc14301dcbd593e53888e0504836ffb6075a67a042178b2ad32a182","tools": ["tool_result_read","list_shared_computers",@@ -1138,6 +1184,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -1148,9 +1196,9 @@"mark_notifications_read"]},- "default+handoff": {- "bytes": 54818,- "sha256": "b0110b0824bf7ebbd2332e690e4a20406068dfcb9869e865e313a0520b22f925",+ "default+no-computer-pick": {+ "bytes": 55391,+ "sha256": "6087e2f1cd72e71f79fa37d778c0ed1145edbfd34c128e9ebaf7686c5cf28727","tools": ["tool_result_read","list_room_targets",@@ -1188,6 +1236,8 @@"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",diff --git a/server/drivers/agents-catalog-profile.ts b/server/drivers/agents-catalog-profile.tsindex d61dfeff83..74ce1261db 100644--- a/server/drivers/agents-catalog-profile.ts+++ b/server/drivers/agents-catalog-profile.ts@@ -1,6 +1,7 @@// The OMB_* switches the harness gives the agents proxy, read into the profile agents-catalog.ts lists tools for.-/** Which tools a turn is shown. Presentation only: the server still authenticates and scopes every call. */+/** Which tools a conversation is shown, the same on every one of its turns. Presentation only: the server still+ * authenticates and scopes every call. */export interface CatalogProfile {skillAuthoring: boolean;sharedComputers: boolean;@@ -19,14 +20,12 @@ export interface CatalogProfile {team?: boolean;/** The person's MausBot with a Chief's powers: its notification tools are mounted. */mausbot?: boolean;- /** A person's own request that may pick its computer: select_computer is mounted. Every other turn (a hand-off, a- * routine, a room, a continuation) is refused a selection, so it is not shown the tool. */+ /** A direct chat whose bot may pick where it works (Works on is not Off and no team computer is its own): select_computer+ * is mounted, and the harness refuses a pick on any turn but a person's own message. */computerSelection?: boolean;- /** A room's turn: the widget and page tools and wait_until and cancel_wait, which rooms refuse, are not mounted. */+ /** A room's thread: the widget and page tools, which rooms refuse, and the wait tools, since a room holds no wait,+ * are not mounted. */room?: boolean;- /** The bot has a wait in this chat that has not ended: list_waits and cancel_wait, which act only on this chat's- * waits, are mounted. Without one they still answer a call (agents-catalog.ts callableTools), but are not listed. */- activeWaits?: boolean;}/** Everything is off unless the harness says "1". */@@ -45,6 +44,5 @@ export function catalogProfileFromEnv(env: NodeJS.ProcessEnv): CatalogProfile {mausbot: env.OMB_MAUSBOT === "1",computerSelection: env.OMB_COMPUTER_SELECTION === "1",room: env.OMB_ROOM === "1",- activeWaits: env.OMB_ACTIVE_WAITS === "1",};}diff --git a/server/drivers/agents-catalog-wire.test.ts b/server/drivers/agents-catalog-wire.test.tsindex 55d1f24e97..4a9e8b23a6 100644--- a/server/drivers/agents-catalog-wire.test.ts+++ b/server/drivers/agents-catalog-wire.test.ts@@ -23,8 +23,8 @@ interface Profile {const flag = (on: boolean) => (on ? "1" : "0");-/** Every combination agentsIntegration() can produce; a name without "+non-chief" is a Chief of Staff's turn, and- * every one is a person's own request, which may pick its computer, unless it says otherwise. */+/** Every combination agentsIntegration() can produce; a name without "+non-chief" is a Chief of Staff's conversation, and+ * every one is a direct chat whose bot may pick its computer, unless it says otherwise. */function profiles(): Record<string, Profile> {const all: Record<string, Profile> = {};for (const chief of [true, false]) {@@ -55,12 +55,12 @@ function profiles(): Record<string, Profile> {// A Team Cloud mounts message_person; the fullest profile carries it.all["skills+shared+voice+escalations+x+team"] = { env: { ...all["skills+shared+voice+escalations+x"]!.env, OMB_TEAM_PEOPLE: "1" } };all["default+legacy-switches"] = {- env: { ...all.default!.env, OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1" },+ env: { ...all.default!.env, OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1", OMB_ACTIVE_WAITS: "0" },};// The person's MausBot holds a Chief's powers and adds its notification pair; MAUSBOT_ADDS bounds what that costs.for (const name of ["default", "skills+shared+voice"]) all[`${name}+mausbot`] = { env: { ...all[name]!.env, OMB_MAUSBOT: "1" } };- // A turn that cannot pick its computer: a hand-off, a routine or webhook run, a continuation. A room's turn is one too.- all["default+handoff"] = { env: { ...all.default!.env, OMB_COMPUTER_SELECTION: "0" } };+ // A chat that can never pick its computer: its Works on is Off, or it works on its team's computer. A room is one too.+ all["default+no-computer-pick"] = { env: { ...all.default!.env, OMB_COMPUTER_SELECTION: "0" } };for (const name of ["default", "non-chief"]) all[`${name}+room`] = { env: { ...all[name]!.env, OMB_COMPUTER_SELECTION: "0", OMB_ROOM: "1" } };return all;}@@ -79,31 +79,31 @@ const FULL = "skills+shared+voice+escalations+x+team";/** Bytes when the budget was last set; a profile may move at most 2% either way (lower it to lock in a win). */const BUDGET_BASELINE: Record<string, number> = {- "default": 54959,- "voice": 55740,- "shared": 57059,- "shared+voice": 57840,- "skills": 57778,- "skills+voice": 58559,- "skills+shared": 59878,- "skills+shared+voice": 60659,- "non-chief": 46055,- "voice+non-chief": 46821,- "shared+non-chief": 48113,- "shared+voice+non-chief": 48879,- "skills+non-chief": 48818,- "skills+voice+non-chief": 49583,- "skills+shared+non-chief": 50876,- "skills+shared+voice+non-chief": 51641,- "skills+shared+voice+cloud-home": 59740,- "skills+shared+voice+non-chief+cloud-home": 50741,- "default+legacy-switches": 54959,- "default+mausbot": 55610,- "skills+shared+voice+mausbot": 61310,- "skills+shared+voice+escalations": 61489,- "skills+shared+voice+escalations+x": 65328,- "skills+shared+voice+escalations+x+team": 65960,- "default+handoff": 53747,+ "default": 55532,+ "voice": 56313,+ "shared": 57632,+ "shared+voice": 58413,+ "skills": 58351,+ "skills+voice": 59132,+ "skills+shared": 60451,+ "skills+shared+voice": 61232,+ "non-chief": 46628,+ "voice+non-chief": 47394,+ "shared+non-chief": 48686,+ "shared+voice+non-chief": 49452,+ "skills+non-chief": 49391,+ "skills+voice+non-chief": 50156,+ "skills+shared+non-chief": 51449,+ "skills+shared+voice+non-chief": 52214,+ "skills+shared+voice+cloud-home": 60313,+ "skills+shared+voice+non-chief+cloud-home": 51314,+ "default+legacy-switches": 55532,+ "default+mausbot": 56183,+ "skills+shared+voice+mausbot": 61883,+ "skills+shared+voice+escalations": 62062,+ "skills+shared+voice+escalations+x": 65901,+ "skills+shared+voice+escalations+x+team": 66533,+ "default+no-computer-pick": 54320,"default+room": 48473,"non-chief+room": 39416,};@@ -187,22 +187,15 @@ describe("agents proxy tools/list golden", () => {expect(wire).toBe(JSON.stringify(golden));});- it("offers wait_until right after the trigger tools, outside a room, and list_waits and cancel_wait only to a bot with a wait", () => {+ it("offers the three wait tools right after the trigger tools in every chat, with or without a wait, and none in a room", () => {for (const [name, wire] of Object.entries(wires)) {const names = toolsOf(wire).map((tool) => tool.name);const at = names.indexOf("delete_trigger");expect(at, name).toBeGreaterThan(-1);- const waits = PROFILES[name]!.env.OMB_ROOM === "1" ? [] : ["wait_until"];+ const waits = PROFILES[name]!.env.OMB_ROOM === "1" ? [] : ["wait_until", "list_waits", "cancel_wait"];expect(names.slice(at + 1, at + 1 + waits.length), name).toEqual(waits);expect(names.filter((tool) => /wait/.test(tool) && tool !== "assignment_status"), name).toEqual(waits);}- const waiting = (name: string) => availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "bot-golden", ...PROFILES[name]!.env, OMB_ACTIVE_WAITS: "1" }));- for (const name of Object.keys(PROFILES)) {- const names = waiting(name).map((tool) => tool.name);- const room = PROFILES[name]!.env.OMB_ROOM === "1";- expect(names.filter((tool) => /wait/.test(tool) && tool !== "assignment_status"), name).toEqual(room ? ["list_waits"] : ["wait_until", "list_waits", "cancel_wait"]);- expect(names.filter((tool) => tool !== "list_waits" && tool !== "cancel_wait"), name).toEqual(toolsOf(wires[name]!).map((tool) => tool.name));- }});it("every profile matches its pinned tool names, byte count and sha256", () => {@@ -256,8 +249,9 @@ describe("agents proxy tools/list golden", () => {it("ignores the switches that once picked a catalog profile", () => {expect(wires["default+legacy-switches"]).toBe(wires.default);- const profile = catalogProfileFromEnv({ OMB_BOT_ID: "bot-golden", OMB_CHIEF_OF_STAFF: "1", OMB_COMPUTER_SELECTION: "1", OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1" });+ const profile = catalogProfileFromEnv({ OMB_BOT_ID: "bot-golden", OMB_CHIEF_OF_STAFF: "1", OMB_COMPUTER_SELECTION: "1", OMB_ROOM_TURN: "1", OMB_OWN_THREAD_CREATION: "1", OMB_EXTERNAL_RUNTIME: "1", OMB_ACTIVE_WAITS: "0" });expect(JSON.stringify({ tools: availableTools(profile) })).toBe(wires.default);+ expect(profile).not.toHaveProperty("activeWaits");expect(profile).not.toHaveProperty("coordinating");expect(profile).not.toHaveProperty("externalRuntime");expect(profile).not.toHaveProperty("ownThreadCreation");@@ -306,11 +300,11 @@ describe("agents proxy tools/list golden", () => {}});- it("leaves out only what a room's turn, and a turn that cannot pick its computer, would be refused", () => {+ it("leaves out only what a room, and a chat that can never pick its computer, would be refused", () => {const names = (name: string) => toolsOf(wires[name]!).map((tool) => tool.name);- expect(names("default+handoff")).toEqual(names("default").filter((tool) => tool !== "select_computer"));+ expect(names("default+no-computer-pick")).toEqual(names("default").filter((tool) => tool !== "select_computer"));for (const name of ["default", "non-chief"]) {- expect(names(`${name}+room`), name).toEqual(names(name).filter((tool) => !["select_computer", "show_widget", "show_html", "wait_until", "cancel_wait"].includes(tool)));+ expect(names(`${name}+room`), name).toEqual(names(name).filter((tool) => !["select_computer", "show_widget", "show_html", "wait_until", "list_waits", "cancel_wait"].includes(tool)));}for (const [name, profile] of Object.entries(PROFILES)) {expect(names(name).includes("select_computer"), name).toBe(profile.env.OMB_COMPUTER_SELECTION === "1");diff --git a/server/drivers/agents-catalog.ts b/server/drivers/agents-catalog.tsindex 86a9acdd9d..a0aa72d57e 100644--- a/server/drivers/agents-catalog.ts+++ b/server/drivers/agents-catalog.ts@@ -5,7 +5,7 @@ import { agentToolAnnotations } from "../agent-tool-policy.ts";import { CHAT_CARD_TOOL_DEFINITIONS } from "./agents-chat-card-tools.ts";import { DEVS_TOOL_DEFINITIONS } from "./agents-devs-tools.ts";import { HELPER_TOOL_DEFINITIONS } from "./agents-helper-tools.ts";-import { ROOM_REFUSED_WAIT_TOOL_NAMES, WAIT_TOOL_DEFINITIONS, WAITING_ONLY_TOOL_NAMES } from "./agents-wait-tools.ts";+import { WAIT_TOOL_DEFINITIONS, WAIT_TOOL_NAMES } from "./agents-wait-tools.ts";import { MAUSBOT_TOOL_DEFINITIONS } from "./agents-mausbot-tools.ts";import { PERSON_TOOL_DEFINITIONS, PERSON_TOOL_NAMES } from "./agents-person-tools.ts";import { RESEARCH_TOOL_DEFINITIONS, RESEARCH_TOOL_NAMES } from "./agents-research-tools.ts";@@ -866,8 +866,8 @@ const CHIEF_TARGET_TOOL_NAMES = new Set(["propose_profile", "propose_model"]);const WATCHER_TOOL_NAMES = new Set(["create_options_card"]);const LOCAL_VM_TOOL_NAMES = new Set(["vm_exec"]);-/** Refused in a room's thread (chat-widgets.ts, chat-apps.ts, routes/waits.ts). */-const ROOM_REFUSED_TOOL_NAMES = new Set(["show_widget", "show_html", ...ROOM_REFUSED_WAIT_TOOL_NAMES]);+/** Refused in a room's thread (chat-widgets.ts, chat-apps.ts, routes/waits.ts), and list_waits, since a room holds no wait. */+const ROOM_REFUSED_TOOL_NAMES = new Set(["show_widget", "show_html", ...WAIT_TOOL_NAMES]);const CLOUD_HOME_SURFACE = {type: "string", enum: ["auto", "cloud", "browser"],description: "auto = suitable configured computer, cloud = the bot's cloud computer, browser = built-in browser. Omit to list. This server runs in the cloud: the user's own computer and a Local VM are not places here.",@@ -883,12 +883,6 @@ export function availableTools(profile: CatalogProfile) {return placed.map((tool) => ({ ...tool, inputSchema: advertisedSchema(tool.inputSchema, tool.description) }));}-/** What a turn may call: what it is listed, and list_waits and cancel_wait, left off the list only while the bot has no- * wait in this chat. A wait made this turn, or a list read before it ended, still reaches them; the route scopes each call. */-export function callableTools(profile: CatalogProfile) {- return availableTools({ ...profile, activeWaits: true });-}-const FULL_INPUT_SCHEMAS = new Map<string, unknown>([...TOOL_DEFINITIONS, ...MAUSBOT_TOOL_DEFINITIONS].map((tool) => [tool.name, tool.inputSchema]));/** A tool's input schema as the catalog writes it, before tools/list leaves anything out: what every call is held to. */@@ -903,8 +897,7 @@ function catalogTools(profile: CatalogProfile) {(profile.escalations === true || tool.name !== "raise_escalation") &&(profile.team === true || !PERSON_TOOL_NAMES.has(tool.name)) &&(profile.computerSelection === true || tool.name !== "select_computer") &&- (profile.room !== true || !ROOM_REFUSED_TOOL_NAMES.has(tool.name)) &&- (profile.activeWaits === true || !WAITING_ONLY_TOOL_NAMES.has(tool.name)));+ (profile.room !== true || !ROOM_REFUSED_TOOL_NAMES.has(tool.name)));const AUTHORING_TOOLS = profile.skillAuthoring? BOT_SCOPED_TOOLS: BOT_SCOPED_TOOLS.filter((tool) => !SKILL_TOOL_NAMES.has(tool.name));diff --git a/server/drivers/agents-mcp-env.ts b/server/drivers/agents-mcp-env.tsindex a23759241d..e439bfcb0e 100644--- a/server/drivers/agents-mcp-env.ts+++ b/server/drivers/agents-mcp-env.ts@@ -4,4 +4,4 @@ import { TOOL_LIMIT_ENV } from "../tool-count-limit.ts";/** The settings the harness gives the agents MCP server, and the only ones a request may carry over HTTP. */export const AGENTS_MCP_ENV = ["OMB_BOT_ID", "OMB_THREAD_ID", "OMB_TURN_DEPTH", "OMB_EXTERNAL_RUNTIME", "OMB_CHIEF_OF_STAFF","OMB_SKILL_AUTHORING_ENABLED", "OMB_MEMORY_ENABLED", "OMB_SHARED_COMPUTERS_ENABLED", "OMB_CLOUD_HOME", "OMB_VOICE_NOTES",- "OMB_X_RESEARCH", "OMB_ESCALATIONS", "OMB_TEAM_PEOPLE", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", "OMB_ACTIVE_WAITS", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV] as const;+ "OMB_X_RESEARCH", "OMB_ESCALATIONS", "OMB_TEAM_PEOPLE", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV] as const;diff --git a/server/drivers/agents-mcp.ts b/server/drivers/agents-mcp.tsindex bf65af5f9f..fabf19c7d8 100644--- a/server/drivers/agents-mcp.ts+++ b/server/drivers/agents-mcp.ts@@ -3,23 +3,21 @@// both answer through it.import { resolveAgentsCall } from "../../shared/agents-tool-names.ts";import { TOOL_BRIDGE_ENV, createToolBridge } from "./agents-bridge.ts";-import { availableTools, callableTools, catalogProfileFromEnv } from "./agents-catalog.ts";+import { availableTools, catalogProfileFromEnv } from "./agents-catalog.ts";import { callTool, capResult, toolCallContextFromEnv } from "./agents-call.ts";import { sendToolReceipt } from "./agents-timing.ts";import type { Json } from "./agents-client.ts";import { capToolListResult, toolLimitFromEnv } from "../tool-count-limit.ts";-/** What the agents server lists for `env`, before any tool limit, and what a call may reach: the listed tools, and the- * wait tools left off the list only for want of a wait (callableTools), which a bridge's find_tool does not search. */+/** What the agents server lists for `env`, before any tool limit. */export function agentsToolList(env: NodeJS.ProcessEnv) {- const profile = catalogProfileFromEnv(env);- const available = availableTools(profile);+ const available = availableTools(catalogProfileFromEnv(env));const bridge = env[TOOL_BRIDGE_ENV] === "1" ? createToolBridge(available) : undefined;- return { callable: callableTools(profile), bridge, listed: bridge ? bridge.listed : available };+ return { available, bridge, listed: bridge ? bridge.listed : available };}export function agentsMcp(env: NodeJS.ProcessEnv): (msg: Json) => Promise<Json | undefined> {- const { callable, bridge, listed } = agentsToolList(env);+ const { available, bridge, listed } = agentsToolList(env);const limit = toolLimitFromEnv(env);const context = toolCallContextFromEnv(env);const ok = (id: unknown, result: unknown): Json => ({ jsonrpc: "2.0", id, result } as Json);@@ -52,7 +50,7 @@ export function agentsMcp(env: NodeJS.ProcessEnv): (msg: Json) => Promise<Json |const { name, arguments: args } = bridged ?? called;// An alias runs only where the tool it names is listed: never a way to a tool this turn was not given.const runs = resolveAgentsCall(name, args).name;- if (!callable.some((t) => t.name === runs)) {+ if (!available.some((t) => t.name === runs)) {// A name written into use_tool fails the call, not the protocol: the chat runtime ends a turn on a protocol error.const unknown = `Unknown tool: ${name}`;return bridged ? textResult(id, unknown, true) : rpcErr(id, -32602, unknown);diff --git a/server/drivers/agents-proxy.test.ts b/server/drivers/agents-proxy.test.tsindex 39ab2743a8..1068b75388 100644--- a/server/drivers/agents-proxy.test.ts+++ b/server/drivers/agents-proxy.test.ts@@ -660,6 +660,8 @@ describe("agents-proxy MCP surface", () => {"trigger","delete_trigger","wait_until",+ "list_waits",+ "cancel_wait","propose_profile","propose_model","propose_team_memory",@@ -748,7 +750,7 @@ describe("agents-proxy MCP surface", () => {"list_shared_computers","assignment_status", "list_bots", "list_rooms", "list_threads","list_team_setup",- "session_search", "trigger_info", "skills_list",+ "session_search", "trigger_info", "list_waits", "skills_list",];expect(list.result.tools.filter((tool: any) => tool.annotations?.readOnlyHint).map((tool: any) => tool.name)).toEqual(readNames);diff --git a/server/drivers/agents-wait-tools.test.ts b/server/drivers/agents-wait-tools.test.tsindex 71341241c7..ccd0f18d5e 100644--- a/server/drivers/agents-wait-tools.test.ts+++ b/server/drivers/agents-wait-tools.test.ts@@ -4,7 +4,7 @@ import type { AddressInfo } from "node:net";import { afterAll, beforeAll, describe, expect, it } from "vitest";import type { ToolCallContext } from "./agents-call.ts";-import { availableTools, callableTools, catalogProfileFromEnv } from "./agents-catalog.ts";+import { availableTools, catalogProfileFromEnv } from "./agents-catalog.ts";import type { Json } from "./agents-client.ts";import { agentsMcp } from "./agents-mcp.ts";import { callWaitTool, WAIT_TOOL_DEFINITIONS, WAIT_TOOL_NAMES } from "./agents-wait-tools.ts";@@ -65,37 +65,24 @@ describe("wait tools", () => {const waitNames = (env: Record<string, string>) =>availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout", OMB_CHIEF_OF_STAFF: "1", ...env })).map((tool) => tool.name).filter((name) => WAIT_TOOL_NAMES.has(name));-describe("which wait tools a turn is listed", () => {- it("lists wait_until alone while the bot has no wait, and list_waits and cancel_wait too once it has one", () => {- expect(waitNames({})).toEqual(["wait_until"]);- expect(waitNames({ OMB_ACTIVE_WAITS: "1" })).toEqual(["wait_until", "list_waits", "cancel_wait"]);- const all = availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout", OMB_ACTIVE_WAITS: "1" })).map((tool) => tool.name);- expect(availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout" })).map((tool) => tool.name))- .toEqual(all.filter((name) => name !== "list_waits" && name !== "cancel_wait"));+describe("which wait tools a conversation is listed", () => {+ // The list is the same on every turn of a chat, so the provider's cached prompt carries over whether a wait is open or not.+ it("lists a direct chat all three, with or without a wait in it", () => {+ expect(waitNames({})).toEqual(["wait_until", "list_waits", "cancel_wait"]);});- it("marks list_waits read-only when it is listed, and nothing else of the three", () => {- const tools = availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout", OMB_ACTIVE_WAITS: "1" })).filter((tool) => WAIT_TOOL_NAMES.has(tool.name));+ it("marks list_waits read-only, and nothing else of the three", () => {+ const tools = availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout" })).filter((tool) => WAIT_TOOL_NAMES.has(tool.name));expect(tools.map((tool) => [tool.name, Boolean((tool as { annotations?: { readOnlyHint?: boolean } }).annotations?.readOnlyHint)])).toEqual([["wait_until", false], ["list_waits", true], ["cancel_wait", false]]);});- // OMB_ACTIVE_WAITS counts the chat's own waits (WaitManager.count), and no wait is made in a room, so a room's turn- // is never listed list_waits in practice; the catalog would list it alone.- it("lists a room's turn list_waits alone, and only with OMB_ACTIVE_WAITS", () => {+ it("lists a room none of them: a room holds no wait", () => {expect(waitNames({ OMB_ROOM: "1" })).toEqual([]);- expect(waitNames({ OMB_ROOM: "1", OMB_ACTIVE_WAITS: "1" })).toEqual(["list_waits"]);- });-- it("lets a turn call list_waits and cancel_wait without a wait, but never what a room refuses", () => {- const callable = (env: Record<string, string>) => callableTools(catalogProfileFromEnv({ OMB_BOT_ID: "scout", ...env }))- .map((tool) => tool.name).filter((name) => WAIT_TOOL_NAMES.has(name));- expect(callable({})).toEqual(["wait_until", "list_waits", "cancel_wait"]);- expect(callable({ OMB_ROOM: "1" })).toEqual(["list_waits"]);});});-describe("a wait tool the turn is not listed", () => {+describe("the wait tools in a chat with no wait", () => {let server: Server;let url = "";const reached: string[] = [];@@ -104,7 +91,7 @@ describe("a wait tool the turn is not listed", () => {server = createServer((req, res) => {if (req.url?.startsWith("/api/internal/waits")) reached.push(`${req.method} ${req.url}`);const [status, body] = req.url === "/api/internal/waits/cancel"- ? [404, { error: "None of your waits in this chat has that id. Use list_waits." }]+ ? [404, { error: "You are not waiting for anything in this chat, so there is nothing to cancel." }]: [200, { text: "You are not waiting for anything in this chat." }];req.resume();req.on("end", () => { res.writeHead(status, { "content-type": "application/json" }); res.end(JSON.stringify(body)); });@@ -123,33 +110,29 @@ describe("a wait tool the turn is not listed", () => {return reply.error ? { error: reply.error.message } : { text: reply.result!.content![0]!.text, isError: reply.result!.isError };};- it("still answers in the route's words when called directly, from a list read before or a wait made this turn", async () => {+ it("lists them, and they answer plainly that there is nothing to list or cancel", async () => {const listed = (await send({}, "tools/list")).result!.tools!.map((tool) => tool.name);- expect(listed).toContain("wait_until");- expect(listed).not.toContain("list_waits");- expect(listed).not.toContain("cancel_wait");+ expect(listed).toEqual(expect.arrayContaining(["wait_until", "list_waits", "cancel_wait"]));reached.length = 0;expect(await answer({}, "list_waits")).toEqual({ text: "You are not waiting for anything in this chat.", isError: false });- expect(await answer({}, "cancel_wait", { id: "w1" })).toEqual({ text: "None of your waits in this chat has that id. Use list_waits.", isError: true });+ expect(await answer({}, "cancel_wait", { id: "w1" })).toEqual({ text: "You are not waiting for anything in this chat, so there is nothing to cancel.", isError: true });expect(reached).toEqual(["GET /api/internal/waits", "POST /api/internal/waits/cancel"]);});- it("runs through use_tool on a bridged turn, which find_tool offers only once the bot has a wait", async () => {+ it("runs through use_tool on a bridged turn, whose find_tool offers them with or without a wait", async () => {const bridged = { OMB_AGENTS_TOOL_BRIDGE: "1" };- const found = async (env: Record<string, string>) =>- (JSON.parse((await answer({ ...bridged, ...env }, "find_tool", { query: "cancel_wait" })).text!) as { matches: Array<{ name: string }> })- .matches.map((match) => match.name);- expect(await found({})).not.toContain("cancel_wait");- expect(await found({ OMB_ACTIVE_WAITS: "1" })).toContain("cancel_wait");+ const found = (JSON.parse((await answer(bridged, "find_tool", { query: "cancel_wait" })).text!) as { matches: Array<{ name: string }> })+ .matches.map((match) => match.name);+ expect(found).toContain("cancel_wait");expect(await answer(bridged, "use_tool", { name: "cancel_wait", arguments: { id: "w1" } }))- .toEqual({ text: "None of your waits in this chat has that id. Use list_waits.", isError: true });+ .toEqual({ text: "You are not waiting for anything in this chat, so there is nothing to cancel.", isError: true });expect(await answer(bridged, "use_tool", { name: "list_waits" })).toEqual({ text: "You are not waiting for anything in this chat.", isError: false });});- it("refuses cancel_wait in a room as a tool the room is not given, and still answers list_waits there", async () => {+ it("refuses the wait tools in a room as tools the room is not given", async () => {reached.length = 0;expect(await answer({ OMB_ROOM: "1" }, "cancel_wait", { id: "w1" })).toEqual({ error: "Unknown tool: cancel_wait" });- expect(await answer({ OMB_ROOM: "1" }, "list_waits")).toEqual({ text: "You are not waiting for anything in this chat.", isError: false });- expect(reached).toEqual(["GET /api/internal/waits"]);+ expect(await answer({ OMB_ROOM: "1" }, "list_waits")).toEqual({ error: "Unknown tool: list_waits" });+ expect(reached).toEqual([]);});});diff --git a/server/drivers/agents-wait-tools.ts b/server/drivers/agents-wait-tools.tsindex 7729a9fb8b..52e3964a29 100644--- a/server/drivers/agents-wait-tools.ts+++ b/server/drivers/agents-wait-tools.ts@@ -4,10 +4,6 @@ import type { Json } from "./agents-client.ts";const WAITS = "/api/internal/waits";export const WAIT_TOOL_NAMES: ReadonlySet<string> = new Set(["wait_until", "list_waits", "cancel_wait"]);-/** Refused in a room's thread (routes/waits.ts): a room's turn is not listed them. list_waits answers there. */-export const ROOM_REFUSED_WAIT_TOOL_NAMES: ReadonlySet<string> = new Set(["wait_until", "cancel_wait"]);-/** Listed only while the bot has a wait in this chat that has not ended (`CatalogProfile.activeWaits`); callable either way. */-export const WAITING_ONLY_TOOL_NAMES: ReadonlySet<string> = new Set(["list_waits", "cancel_wait"]);export async function callWaitTool(name: string, args: Json, context: ToolCallContext): Promise<ToolCallResult> {const { ok, body } =diff --git a/server/group-local-vm.e2e.test.ts b/server/group-local-vm.e2e.test.tsindex a80cc915ab..e20695bad5 100644--- a/server/group-local-vm.e2e.test.ts+++ b/server/group-local-vm.e2e.test.ts@@ -8,6 +8,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";import { writeFileAtomic } from "./atomic.ts";import { cloudHomePrompt } from "./system-prompt.ts";+import { availableTools, catalogProfileFromEnv } from "./drivers/agents-catalog.ts";import { CONTROL_BUSY, CONTROL_REFUSAL_PLAIN, controlRefusal, createControlClient } from "./control-client.ts";import { freePortBlock } from "./testing/ports.ts";import { readHandoffs } from "./testing/handoff-rows.ts";@@ -586,6 +587,10 @@ describe("Group Local VM ownership on the real isolated server", () => {expect(computer(after)).toBeTruthy();expect(after.systemPrompt).toContain("Local VM");expect(after.systemPrompt).not.toContain("call select_computer");+ // The continuation, which may not pick again, is listed the agents tools its request was, select_computer too.+ const agentsTools = (dumped: any) => availableTools(catalogProfileFromEnv(dumped.mcpConfig.mcpServers.agents.env));+ expect(agentsTools(after)).toEqual(agentsTools(before));+ expect(agentsTools(after).map((tool) => tool.name)).toContain("select_computer");await idle(bot.id);const state = await api("GET", "/api/bots?messages=30");const saved = state.bots.find((b: any) => b.id === bot.id);diff --git a/server/harness-capabilities.ts b/server/harness-capabilities.tsindex 59b377b815..5e8784e585 100644--- a/server/harness-capabilities.ts+++ b/server/harness-capabilities.ts@@ -12,7 +12,6 @@ const ENVELOPE: CatalogProfile = {sharedComputers: true,voiceNotes: true,computerSelection: true,- activeWaits: true,cloudHome: false,chief: true,botId: "",diff --git a/server/index.test.ts b/server/index.test.tsindex 800344b0a4..9a3a72960a 100644--- a/server/index.test.ts+++ b/server/index.test.ts@@ -9183,6 +9183,26 @@ describe("harness HTTP API", () => {}});+ it("mounts the USB phone server on every turn, whatever its words: they pick only the phone skill's instructions", async () => {+ const bot = (await api("POST", "/api/bots", { name: "Phone words" })).body.bot;+ try {+ expect((await api("PATCH", `/api/bots/${bot.id}`, { modelSelection: { instanceId: "claude", model: "claude-sonnet-5" } })).status).toBe(200);+ for (const [text, instructed] of [["hello", false], ["open the Uber app on my Android", true], ["thanks", false]] as const) {+ rmSync(fakeClaudeDump, { force: true });+ expect((await api("POST", `/api/bots/${bot.id}/messages`, { text })).status).toBe(202);+ const seen = await readJsonFileWhenReady<{ systemPrompt: string; mcpConfig: { mcpServers: Record<string, unknown> } }>(fakeClaudeDump, 15_000);+ expect(seen.mcpConfig.mcpServers.phone, text).toBeDefined();+ expect(seen.systemPrompt.includes('<openmaus-skill id="phone-harness"'), text).toBe(instructed);+ expect((await api("POST", `/api/bots/${bot.id}/interrupt`)).status).toBe(200);+ await expect.poll(async () => (await api("GET", "/api/bots?messages=0")).body.bots+ .find((candidate: { id: string }) => candidate.id === bot.id)?.busy, { timeout: 5_000 }).toBe(false);+ }+ } finally {+ await api("POST", `/api/bots/${bot.id}/interrupt`);+ await api("DELETE", `/api/bots/${bot.id}`);+ }+ });+it("re-enters setup mode for a configured bot when the user sends /setup, and rewrites the turn text", async () => {const bot = (await api("POST", "/api/bots", { name: "Kiwi", description: "Files bugs." })).body.bot;try {@@ -9989,6 +10009,13 @@ describe("harness HTTP API", () => {it.each(["direct", "room"] as const)("loads the browser tools up front only when the browser is the conversation's place in %s turns", async (target) => {const bots: string[] = [];const rooms: string[] = [];+ const send = async (path: string) => {+ rmSync(fakeClaudeDump, { force: true });+ expect((await api("POST", path, { text: "Check the website." })).status).toBe(202);+ const dump = await readJsonFileWhenReady(fakeClaudeDump) as { mcpConfig: { mcpServers: { browser?: { alwaysLoad?: boolean } } } };+ expect(dump.mcpConfig.mcpServers.browser).toBeDefined();+ return dump.mcpConfig.mcpServers.browser!;+ };const mounted = async (computer: "browser" | undefined) => {const bot = (await api("POST", "/api/bots")).body.bot;bots.push(bot.id);@@ -9997,23 +10024,30 @@ describe("harness HTTP API", () => {modelSelection: { instanceId: "claude", model: "claude-sonnet-5" },...(computer ? { computer } : {}),})).status).toBe(200);- let path = `/api/bots/${bot.id}/messages`;+ let path = `/api/bots/${bot.id}/messages`, stop = `/api/bots/${bot.id}/interrupt`;if (target === "room") {const room = (await api("POST", "/api/groups", { name: `Browser preload ${bots.length}`, memberIds: [bot.id] })).body.group;rooms.push(room.id);expect((await api("PATCH", `/api/groups/${room.id}/setup`, { action: "skip" })).status).toBe(200);path = `/api/groups/${room.id}/messages`;+ stop = `/api/groups/${room.id}/interrupt`;}- rmSync(fakeClaudeDump, { force: true });- expect((await api("POST", path, { text: "Check the website." })).status).toBe(202);- const dump = await readJsonFileWhenReady(fakeClaudeDump) as { mcpConfig: { mcpServers: { browser?: { alwaysLoad?: boolean } } } };- expect(dump.mcpConfig.mcpServers.browser).toBeDefined();- return dump.mcpConfig.mcpServers.browser!;+ return { bot, path, stop, browser: await send(path) };};try {expect((await api("PATCH", "/api/config", { features: { browser: true } })).status).toBe(200);- expect((await mounted(undefined)).alwaysLoad).toBeUndefined();- expect((await mounted("browser")).alwaysLoad).toBe(true);+ const auto = await mounted(undefined);+ expect(auto.browser.alwaysLoad).toBeUndefined();+ expect((await mounted("browser")).browser.alwaysLoad).toBe(true);+ // The first turn pinned the browser on its own; the next is handed it the same way, so its cached prompt carries over.+ expect((await api("POST", auto.stop, {})).status).toBe(200);+ await expect.poll(async () => (await api("GET", "/api/bots?messages=0")).body.bots+ .find((candidate: { id: string }) => candidate.id === auto.bot.id)?.busy, { timeout: 5_000 }).toBe(false);+ if (target === "direct") {+ const task = (await api("GET", "/api/bots?messages=0")).body.bots.find((candidate: { id: string }) => candidate.id === auto.bot.id).tasks[0];+ expect(task).toMatchObject({ surface: "browser", surfaceAuto: true });+ }+ expect((await send(auto.path)).alwaysLoad).toBeUndefined();} finally {for (const id of rooms) await api("POST", `/api/groups/${id}/interrupt`, {}).catch(() => undefined);for (const id of bots) await api("POST", `/api/bots/${id}/interrupt`, {}).catch(() => undefined);diff --git a/server/index.ts b/server/index.tsindex dd25ef71b8..cc688257b9 100644--- a/server/index.ts+++ b/server/index.ts@@ -115,7 +115,7 @@ import { vpsLeftBehindNotice } from "./cloud-backend.ts";import * as composio from "./composio.ts";import { connectorCallFromFrame, connectorRefusalText, connectorScopeRefusalText, connectorUnrecognizedText, evaluateConnectorTools } from "./connector-verdict.ts";import { connectorCardText } from "./connector-card-text.ts";-import { chiefOfStaffSystemPrompt } from "./chief-of-staff.ts"; import { chiefLevel, readTeamRolesWith, roleToolEnv } from "./chief-level.ts"; import { defaultBotRefusal, ensureDefaultBot } from "./default-bot.ts";+import { chiefOfStaffSystemPrompt } from "./chief-of-staff.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";@@ -478,7 +478,7 @@ import { WebhookManager } from "./webhooks.ts";import { tieAutomationsToBots } from "./bot-automations.ts"; import { WaitManager } from "./waits.ts"; import { cancelWaitFromCard, createWaitHost, waitRunChat } from "./wait-host.ts"; import { createWaitRoutes, findWaitPeer, hostWaitRefusal, waitSourceRefusal, type WaitRouteContext } from "./routes/waits.ts";import type { WebhookTrigger } from "../shared/webhooks.ts";import { AGENTS_NODE_FLAG, SPAWNED_PROXIES } from "./proxy-paths.ts";-import { AGENTS_PROXY_ENV, agentsProxyLaunch, agentsToolBridgeEnv, applyAgentsBridge, bridgedToolTitle, turnEngine } from "./agents-bridge-switch.ts";+import { agentsProxyLaunch, agentsToolBridgeEnv, applyAgentsBridge, bridgedToolTitle, turnEngine } from "./agents-bridge-switch.ts"; import { agentsServerEnv, COMPUTER_OFF_REFUSAL, computerPickRefusal, directTurnKind, roomSkillsRefusal, type TurnKind } from "./agents-turn.ts";import { harnessMcpTokenEnv } from "./harness-mcp-token.ts";import {loadBundledSkills,@@ -486,7 +486,7 @@ import {mergeSkills,renderSkillInstructions,selectBundledSkills,- skillsLibraryEnabled, readSkillLibraryIndex,+ skillsLibraryEnabled, readSkillLibraryIndex, type BundledSkill,} from "./skill-library.ts";import { runSkillsLibraryBootSweep } from "./skills-library-migration.ts";import { installedPlaybookInstructions } from "./installed-playbooks.ts";@@ -503,7 +503,7 @@ import { keepTransient, lazyClaimRetryText, settledWithin, startAutoVmClaim, witimport { CONTROL_ACT_WITHIN_MS, CONTROL_BUSY, CONTROL_HANDED_BACK, CONTROL_WAIT_MS, CONTROL_WAITED, controlRefusal, type ControlState } from "./control-client.ts";import { computerFreeAfterText, computerParkedText, computerPersonAwayText, computerStoppedWaitingText, computerWaitingText, type ComputerHolder } from "./computer-wait.ts";import { modelContextWindow } from "./model-context-window.ts";-import { browserIsThePlace, cloudPlaceRefusal, computerSkippedNote, computerToolsRefusal, parseSurface, PlaceUnavailableError, placeUnavailable, resolveSurface, surfaceLabel, surfaceOfComputerKind, surfacePrompt, type ComputerWant, type PlaceSource, type Surface } from "./surface.ts";+import { browserIsThePlace, chosenPin, cloudPlaceRefusal, computerSkippedNote, computerToolsRefusal, parseSurface, PlaceUnavailableError, placeUnavailable, resolveSurface, surfaceLabel, surfaceOfComputerKind, surfacePrompt, type ComputerWant, type PlaceSource, type Surface } from "./surface.ts";import { cloudRefusal, type PlaceRow } from "../shared/place-view.ts";import {PendingTurnCancellations,@@ -1442,6 +1442,9 @@ const firstEngineRead = holdUntilFirstEngineRead();await registry.load(providerConfigs(), decorateHostedProvider);const bundledSkills = loadBundledSkills();const availableSkills = () => mergeSkills(bundledSkills, loadUserSkills(join(DATA_DIR, "skills")));+/** Every turn the engine can mount it, whatever its words: they pick only the skill's instructions. A Cloud home or a hosted workspace has no USB port. */+const usbPhoneOffered = (instance: { adapter: { capabilities: { phoneMcp?: boolean } } }, skills: readonly BundledSkill[]) => instance.adapter.capabilities.phoneMcp === true &&+ !CLOUD_HOME && !HOSTED_WORKSPACE && skills.some(({ manifest }) => manifest.defaultEnabled && manifest.requiredCapabilities.includes("phoneMcp"));type UtilityParentPort = {on(event: "message", listener: (event: { data?: object }) => void): void;@@ -1850,41 +1853,13 @@ function agentsIntegration(roomHandoffId?: string,hostFiles = false,) {- const token = mintInternalCapability({- botId,- threadId,- generation,- depth,- kind: "agents",- skillAuthoring,- createdBots: 0,- openedThreads: 0,- roomHandoffId,- ...(hostFiles && !CLOUD_HOME && !HOSTED_WORKSPACE ? { deliversSavedFiles: true } : {}),- });- return {- ...agentsProxyLaunch(),- env: {- ...AGENTS_PROXY_ENV,- OMB_HARNESS_URL: `http://127.0.0.1:${PORT}`,- OMB_BOT_ID: botId,- OMB_THREAD_ID: threadId,- OMB_COMMS_TOKEN: token,- OMB_TURN_DEPTH: String(depth),- OMB_SKILL_AUTHORING_ENABLED: skillAuthoring ? "1" : "0",- OMB_MEMORY_ENABLED: store.bot(botId)?.memoryEnabled === false ? "0" : "1",- // Only advertises the tools; the routes behind them refuse regardless.- OMB_SHARED_COMPUTERS_ENABLED: lendingEnabled() ? "1" : "0",- OMB_CLOUD_HOME: CLOUD_HOME ? "1" : "0", OMB_TEAM_PEOPLE: CLOUD_TEAM ? "1" : "0", OMB_ROOM: store.groupByThread(threadId) ? "1" : "0", OMB_ACTIVE_WAITS: botWaits.count(botId, threadId) ? "1" : "0",- OMB_VOICE_NOTES: (() => {- const speaking = botForThread(botId, threadId) ?? store.bot(botId);- return tts.voiceReady(cfg, speaking?.voice) && speaking?.voiceNotes !== false ? "1" : "0";- })(),- OMB_X_RESEARCH: researchCredential(cfg.treg?.key) && store.bot(botId)?.xResearch !== false ? "1" : "0",- ...roleToolEnv(store.bot(botId)),- OMB_ESCALATIONS: chiefEscalationsEnabled(cfg) ? "1" : "0", OMB_COMPUTER_SELECTION: computerSelectionTurns.get(threadId)?.generation === generation ? "1" : "0",- },- };+ const bot = store.bot(botId), speaking = botForThread(botId, threadId) ?? bot;+ // Only advertises the tools; the routes behind them refuse regardless.+ const host = { skillAuthoring: skillAuthoringEnabled(cfg), sharedComputers: lendingEnabled(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM), escalations: chiefEscalationsEnabled(cfg),+ voiceNotes: tts.voiceReady(cfg, speaking?.voice) && speaking?.voiceNotes !== false, research: Boolean(researchCredential(cfg.treg?.key)) };+ return { ...agentsProxyLaunch(), env: agentsServerEnv({ threadId, bot: bot ?? { id: botId }, room: Boolean(store.groupByThread(threadId)), teamComputer: Boolean(bot && inheritedTeamComputer(bot)), host },+ { generation, depth, skillAuthoring, roomHandoffId, ...(hostFiles && !CLOUD_HOME && !HOSTED_WORKSPACE ? { deliversSavedFiles: true } : {}) },+ (turn) => mintInternalCapability({ botId, threadId, kind: "agents", createdBots: 0, openedThreads: 0, ...turn }), `http://127.0.0.1:${PORT}`) };}@@ -1967,7 +1942,7 @@ const directTurnGenerationByThread = new Map<string, string>();const directRequestOwners = new Map<string, {generation: string; messageId?: string; generations: Set<string>; turnId: string | null; stopped?: boolean;automation?: RoutineRunTrigger;- origin?: WorkOrigin; personLine?: true;+ origin?: WorkOrigin; personLine?: true; kind?: TurnKind;}>();type DirectTurnOutcome = HostTurnResult;const directFollowupTurns = new ProviderTurnGenerationRegistry<DirectTurnOutcome>();@@ -6071,12 +6046,13 @@ function providerOperationConflict(provider: RemoteComputerProvider): string | nreturn null;}-function turnSurfacePlan(bot: BotRecord, runOn?: RoutineRunOn, threadId?: string) {+/** `chosen`: the place the person set, so the browser's tools are handed the same way on every turn. */+function turnSurfacePlan(bot: BotRecord, runOn?: RoutineRunOn, threadId?: string, chosen = false) {const instance = registry.get(bot.modelSelection.instanceId), forcedBoat = runOn === "cloud" || Boolean(inheritedTeamComputer(bot));const task = forcedBoat || !threadId ? undefined : store.taskByThread(bot.id, threadId);return resolveSurface({destination: threadId && proactive.fence.confines(threadId) ? "off" : forcedBoat ? "cloud" : bot.computer,- pinnedSurface: task?.surface, botOpened: Boolean(task?.openedBy),+ pinnedSurface: chosen ? chosenPin(task) : task?.surface, botOpened: Boolean(task?.openedBy),browserOn: builtInBrowserEnabled(cfg) && bot.browser !== false && instance?.adapter.capabilities.browserMcp === true,});}@@ -7880,7 +7856,8 @@ async function startTurn(const requestOrigin = requestWorkOrigin({ trigger: opts?.automationSource, guest: guestConfined, handed: opts?.origin, continued,line: !continuation && requestMessageId === userMessage.id ? userMessage : undefined });directRequestOwners.set(threadId, { generation: dispatchClaimId, messageId: requestMessageId,- generations: requestGenerations, turnId: null, ...(opts?.automationSource ? { automation: opts.automationSource } : {}), origin: requestOrigin, ...(personLine || (continued && previousRequest?.personLine) ? { personLine: true as const } : {}) });+ generations: requestGenerations, turnId: null, ...(opts?.automationSource ? { automation: opts.automationSource } : {}), origin: requestOrigin, ...(personLine || (continued && previousRequest?.personLine) ? { personLine: true as const } : {}),+ kind: directTurnKind({ ...opts, peerAsk: opts?.peerAsk ?? userMessage.peerAsk }) });const notesRefused = CLOUD_PERSONAL && cloudHomeLendingRefusal(cloudLendingTurn({ botId, threadId, generation: dispatchClaimId })) !== null;if (notesRefused) noteForeignTurn(botId, threadId, dispatchClaimId);// An unknown control-plane wake must never acquire authority by guessing the latest user as its origin.@@ -8039,17 +8016,16 @@ async function startTurn(const integrations: NonNullable<Parameters<typeof instance.adapter.sendTurn>[0]["integrations"]> = {};let browser: Awaited<ReturnType<typeof browserIntegration>> = null;+ const skills = availableSkills(), phoneOffered = usbPhoneOffered(instance, skills) && !proactive.fence.confines(threadId);const selectedSkills = selectBundledSkills(providerText,[- ...(instance.adapter.capabilities.phoneMcp === true && !proactive.fence.confines(threadId) ? ["phoneMcp"] : []),+ ...(phoneOffered ? ["phoneMcp"] : []),...(skillAuthoring ? ["skillAuthoring"] : []),],- availableSkills(),+ skills,);- if (selectedSkills.some((skill) => skill.manifest.requiredCapabilities.includes("phoneMcp"))) {- integrations.phone = phoneIntegration(bot.id, threadId, dispatchClaimId);- }+ if (phoneOffered) integrations.phone = phoneIntegration(bot.id, threadId, dispatchClaimId);if (bot.composio !== false && composio.configured(cfg) && instance.adapter.capabilities.composioMcp === true) {Object.assign(integrations, await teamConnections.appsIntegrations(bot, threadId, dispatchClaimId, instance.adapter.capabilities.mcpToolsFoundByName ? "dotted" : "plain"));}@@ -8585,7 +8561,7 @@ async function startTurn(systemVolatile: prompt.volatile,mentionTurn: tagged.length > 0,integrations,- ...(integrations.browser && browserIsThePlace(plan) ? { preloadBrowserTools: true } : {}),+ ...(integrations.browser && browserIsThePlace(turnSurfacePlan(bot, undefined, threadId, true)) ? { preloadBrowserTools: true } : {}),...settingsTurnFields(cfg, DATA_DIR, managedPolicy.restrictsMcp()),cwd,}, (input) => quickFallback.sendTurn(instance, input, route.quickModel ? { model, own: bot.modelSelection, onFallback: () => store.patchMessage(threadId, userMessage.id, { quickModel: undefined }) } : undefined))), () => companyShutdown || !directTurnClaimExists(bot.id, dispatchClaimId, threadId), async () => {@@ -9961,11 +9937,11 @@ async function runClaimedGroupMemberTurn();const roomContext = roomWindow.text;const turnImages = usesNativeImageInput ? [...burstImages, ...resolvedLatestImages.images] : [];- const skills = availableSkills();+ const skills = availableSkills(), phoneOffered = usbPhoneOffered(instance, skills);const selectedSkills = mergeSkills(selectBundledSkills(roomContext,- instance.adapter.capabilities.phoneMcp === true ? ["phoneMcp"] : [],+ phoneOffered ? ["phoneMcp"] : [],skills,),selectBundledSkills(@@ -9974,9 +9950,7 @@ async function runClaimedGroupMemberTurn(skills,),);- if (selectedSkills.some((skill) => skill.manifest.requiredCapabilities.includes("phoneMcp"))) {- integrations.phone = phoneIntegration(bot.id, threadId, internalGeneration);- }+ if (phoneOffered) integrations.phone = phoneIntegration(bot.id, threadId, internalGeneration);try {if (bot.composio !== false && composio.configured(cfg) && instance.adapter.capabilities.composioMcp === true) {Object.assign(integrations, await teamConnections.appsIntegrations(bot, threadId, internalGeneration, instance.adapter.capabilities.mcpToolsFoundByName ? "dotted" : "plain"));@@ -10285,7 +10259,7 @@ async function runClaimedGroupMemberTurn(integrations.agents && (!orchestration || orchestration.roomHandoffId) && "For actual OpenMausBot teamwork, discover IDs with list_room_targets and use coordinate_bots for advice or work in this or another room. Do not substitute native coding helpers for these named bots. Consult only when needed to make a decision; no discussion step is mandatory. Give concrete responsibilities, exact accessible paths and acceptance checks. End your turn after assigning; busy teammates queue and results automatically resume you. When they return, finish the requested verification and give the user one final answer. Native helper names are not evidence that an OpenMausBot teammate participated. Plain @mentions are only for conversational replies in this room." + requesterRule,integrations.agents && TRIGGER_PROMPT.trim(),integrations.agents && PROFILE_PROMPT.trim(),- skillAuthoring && LEARN_PROMPT.trim(),+ integrations.agents && skillAuthoringEnabled(cfg) && LEARN_PROMPT.trim(),orchestration?.systemInstructions,].filter(Boolean)@@ -10342,6 +10316,8 @@ async function runClaimedGroupMemberTurn(});}}+ // The start-up probe of this engine is part of setup, and the bridge decision needs the engine's version.+ const engineRead = registry.engineRead(instance.instanceId); if (engineRead) await engineRead;applyAgentsBridge(threadId, integrations, cfg, bot, turnEngine(instance, providerConfigs(), registry.lastSnapshot(instance.instanceId), cwd));const roomSystem = buildSystemPrompt(system, store.bot(bot.id)?.soul ?? bot.soul ?? "", [{ id: "user-profile", label: "About the user", text: userProfileSystemPrompt(teamHost.profileFor(threadId, cfg.profile)) }, { id: "people", label: "People", text: teamMessages.prompt(bot.id, threadId, Boolean(integrations.agents)) },@@ -10370,8 +10346,6 @@ async function runClaimedGroupMemberTurn({ id: "playbooks", label: "Playbooks", text: installedPlaybookInstructions(text, bot.playbooks) },], integrations.agents);- // The start-up probe of this engine is part of setup: wait for it before the claim below.- const engineRead = registry.engineRead(instance.instanceId); if (engineRead) await engineRead;// Claim /learn only after setup succeeded, so a failed first responder does not consume it.if (skillAuthoring) skillAuthoringClaim.claimed = true;// Never launch a replacement into a stopped handshake's pre-id window.@@ -13203,7 +13177,9 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {const canSelect = Boolean(source && source.generation === internalCapability.generation && bot && bot.computer !== "off");if (!bot) return json(res, 403, { error: "Computer selection belongs to a direct bot conversation." });const requested = method === "POST" ? (await readInternalBody()).surface : undefined;- if (method === "POST" && !canSelect) return json(res, 403, { error: "Computer selection is only available once per direct user request, with computer access enabled." });+ const request = directRequestOwners.get(internalCapability.threadId);+ const refusal = canSelect ? undefined : bot.computer === "off" ? COMPUTER_OFF_REFUSAL : computerPickRefusal(request?.generation === internalCapability.generation ? request.kind : undefined);+ if (method === "POST" && refusal) return json(res, 403, { error: refusal });if (method === "POST" && requested !== "auto" && !parseSurface(requested)) {return json(res, 400, { error: "surface must be auto, cloud, vm, local, or browser" });}@@ -13211,7 +13187,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {const options = await selectableComputers(bot);const current = source ? source.mounted ?? "off" : await computerPreviewSurface(bot, bot.threadId);requireActiveInternalCapability();- if (method === "GET") return json(res, 200, { current, canSelect, options });+ if (method === "GET") return json(res, 200, { current, canSelect, ...(refusal ? { why: refusal } : {}), options });if (computerSelectionTurns.get(internalCapability.threadId) !== source) return json(res, 409, { error: "The user request ended before its computer was selected." });if (unoffered) return json(res, 409, { error: unoffered, options });const claim = autoVmClaims.get(internalCapability.threadId);@@ -13813,9 +13789,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {}if (method === "GET" && path === "/api/internal/skills") {if (!skillAuthoringEnabled(cfg)) return json(res, 403, { error: "skill authoring is not enabled in Settings" });- if (!internalCapability.skillAuthoring) {- return json(res, 403, { error: "skill authoring is not enabled for this turn" });- }+ if (!internalCapability.skillAuthoring) return json(res, 403, { error: store.groupByThread(internalCapability.threadId) ? roomSkillsRefusal(Boolean(internalCapability.roomHandoffId)) : "skill authoring is not enabled for this turn" });const from = internalSender;const fromThreadId = internalCapability.threadId;if (!connectorThread(from.id, fromThreadId)) {@@ -13828,9 +13802,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {}if (method === "POST" && path === "/api/internal/skills/stage") {if (!skillAuthoringEnabled(cfg)) return json(res, 403, { error: "skill authoring is not enabled in Settings" });- if (!internalCapability.skillAuthoring) {- return json(res, 403, { error: "skill authoring is not enabled for this turn" });- }+ if (!internalCapability.skillAuthoring) return json(res, 403, { error: store.groupByThread(internalCapability.threadId) ? roomSkillsRefusal(Boolean(internalCapability.roomHandoffId)) : "skill authoring is not enabled for this turn" });const body = await readInternalBody();const from = internalSender;const fromThreadId = internalCapability.threadId;diff --git a/server/openai-compat-vm.e2e.test.ts b/server/openai-compat-vm.e2e.test.tsindex ae4dc9dad5..5cfbf9bc63 100644--- a/server/openai-compat-vm.e2e.test.ts+++ b/server/openai-compat-vm.e2e.test.ts@@ -214,9 +214,10 @@ describe("openai-compat Local VM tools", () => {const continuation = requests[2];expect(toolNames(continuation), JSON.stringify({ tools: toolNames(continuation), requests: requests.length })).toContain("computer_screenshot");expect(toolNames(requests[0])).toContain("agents_select_computer");- // The continuation still has the agents tools, but not a second pick: the selection route refuses one there.- expect(toolNames(continuation)).toContain("agents_coordinate_bots");- expect(toolNames(continuation)).not.toContain("agents_select_computer");+ // The continuation is listed the agents tools its request was, select_computer too: the route refuses a second pick.+ const agentsTools = (request: ChatRequest | undefined) => toolNames(request).filter((name) => name.startsWith("agents_"));+ expect(agentsTools(continuation)).toEqual(agentsTools(requests[0]));+ expect(toolNames(continuation)).toContain("agents_select_computer");const shown = (await api("GET", "/api/bots")).bots.find((item: any) => item.id === bot.id).messages;expect(shown.filter((message: any) => message.card)).toEqual([]);}, 60_000);diff --git a/server/routes/waits.test.ts b/server/routes/waits.test.tsindex 01b36e6bc3..88d1e4d996 100644--- a/server/routes/waits.test.ts+++ b/server/routes/waits.test.ts@@ -154,7 +154,8 @@ describe("the waits route", () => {expect(listed).not.toContain("w9");expect(waits.list).toHaveBeenCalledWith("bot-1");expect(await call("GET", "/api/internal/waits", undefined, { threadId: "thread-B" })).toMatchObject({ status: 200, payload: { text: "You are not waiting for anything in this chat." } });- expect(await call("POST", "/api/internal/waits/cancel", { id: "w1" }, { threadId: "thread-B" })).toMatchObject({ status: 404 });+ expect(await call("POST", "/api/internal/waits/cancel", { id: "w1" }, { threadId: "thread-B" }))+ .toMatchObject({ status: 404, payload: { error: "You are not waiting for anything in this chat, so there is nothing to cancel." } });waits.list.mockReturnValue([]);});it("keeps a turn that is not the person's conversation from listing", async () => {diff --git a/server/routes/waits.ts b/server/routes/waits.tsindex 61a082c4c9..41b5b8fa92 100644--- a/server/routes/waits.ts+++ b/server/routes/waits.ts@@ -24,6 +24,7 @@ export const WAIT_MESSAGES = {self: "You cannot wait for yourself to finish. Tell the person yourself when you are done.",noWait: "None of your waits in this chat has that id. Use list_waits.",none: "You are not waiting for anything in this chat.",+ noneToCancel: "You are not waiting for anything in this chat, so there is nothing to cancel.",} as const;export interface WaitRequest {@@ -180,6 +181,7 @@ export function createWaitRoutes(deps: { waits: Pick<WaitManager, "create" | "liconst body = await ctx.readBody();if (ctx.path === CANCEL) {+ if (!here().length) return void json(res, 404, { error: WAIT_MESSAGES.noneToCancel });const id = isRecord(body) ? body.id : undefined;if (typeof id !== "string" || !id) return void json(res, 400, { error: "id: the wait id from list_waits." });const stopped = here().some((wait) => wait.id === id) ? deps.waits.cancel(id, ctx.botId) : null;diff --git a/server/surface.test.ts b/server/surface.test.tsindex 616e62a870..d292f81aa6 100644--- a/server/surface.test.ts+++ b/server/surface.test.ts@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";import {browserIsThePlace,+ chosenPin,cloudPlaceRefusal,computerSkippedNote,computerToolsRefusal,@@ -23,6 +24,28 @@ describe("browserIsThePlace", () => {});});+describe("chosenPin", () => {+ // The browser's tools are loaded up front where the browser is the chosen place: decided on that alone, the turn that+ // pinned the browser on its own hands the next turn the browser exactly as it was handed itself.+ const preloads = (destination: "browser" | undefined, task?: { surface?: "browser" | "local"; surfaceSource?: "user" | "auto" }) =>+ browserIsThePlace(resolveSurface({ destination, pinnedSurface: chosenPin(task), browserOn: true }));++ it("leaves out a pin a turn made on its own, and keeps the person's", () => {+ expect(chosenPin(undefined)).toBeUndefined();+ expect(chosenPin({ surface: "browser", surfaceSource: "auto" })).toBeNull();+ expect(chosenPin({ surface: "browser", surfaceSource: "user" })).toBe("browser");+ expect(chosenPin({ surface: "local" })).toBe("local");+ });++ it("hands an Auto conversation's browser the same way before and after a turn pinned it", () => {+ expect(preloads(undefined)).toBe(false);+ expect(preloads(undefined, { surface: "browser", surfaceSource: "auto" })).toBe(false);+ expect(preloads("browser")).toBe(true);+ expect(preloads("browser", { surface: "browser", surfaceSource: "auto" })).toBe(true);+ expect(preloads(undefined, { surface: "browser", surfaceSource: "user" })).toBe(true);+ });+});+describe("resolveSurface", () => {it("browser destination mounts only the built-in browser", () => {expect(resolveSurface({ destination: "browser", browserOn: true })).toEqual({diff --git a/server/surface.ts b/server/surface.tsindex 61e52a5571..63984c9ddd 100644--- a/server/surface.ts+++ b/server/surface.ts@@ -87,6 +87,11 @@ export function browserIsThePlace(plan: SurfacePlan): boolean {return plan.computer === "off" && plan.browser;}+/** The conversation's pin as a person chose it: a pin a turn made on its own (auto) is none. */+export function chosenPin(task: { surface?: Surface; surfaceSource?: "user" | "auto" } | undefined): Surface | null | undefined {+ return task?.surfaceSource === "auto" ? null : task?.surface;+}+export function cloudPlaceRefusal(engine: CloudEngine & { name: string }, source: PlaceSource, bot: string): PlaceUnavailableError | null {if (canWorkOnCloud(engine)) return null;return placeUnavailable("cloud", { state: "cc-cannot", params: { bot, model: engine.name }, source });diff --git a/server/waits.test.ts b/server/waits.test.tsindex 2415725284..80865dbc44 100644--- a/server/waits.test.ts+++ b/server/waits.test.ts@@ -5,7 +5,6 @@ import { afterEach, describe, expect, it, vi } from "vitest";import type { FileStamp, PageResult, ProcessEntry } from "./wait-probes.ts";import { CLOUD_IDLE_AWAKE_MS, createCloudPower } from "./cloud-power.ts";-import { availableTools, catalogProfileFromEnv } from "./drivers/agents-catalog.ts";import { describeCondition, WAIT_WAKE_MS, WaitManager, waitList, type NewWaitCondition, type WaitManagerOptions, type WaitNotice, type WaitRecord } from "./waits.ts";const T0 = 1_800_000_000_000;@@ -184,10 +183,9 @@ describe("WaitManager", () => {it("holds the line while a turn runs in the chat, then posts it once, even across a restart", async () => {const h = harness();await h.create({ kind: "file_exists", path: "/r.txt" }, { followUp: "Go." });- expect(h.manager.count("bot-1", "t-1")).toBe(1);+ expect(h.manager.list("bot-1")).toHaveLength(1);h.stamp = { size: 1, mtimeMs: 1 }; h.postOk = false; h.advance(5_000); await h.manager.tick();expect(h.manager.list("bot-1")).toEqual([]);- expect(h.manager.count("bot-1", "t-1")).toBe(0);expect(h.manager.owners()).toEqual(["bot-1"]);const storedAtFollowUp: number[] = [];h.followUp.mockImplementation(() => { storedAtFollowUp.push(JSON.parse(readFileSync(h.file, "utf8")).waits.length); });@@ -391,25 +389,13 @@ describe("WaitManager", () => {const { wait } = await h.create({ kind: "file_exists", path: "/r" }, { followUp: "Go." }) as { wait: WaitRecord };expect(h.manager.cancel(wait.id, "bot-2")).toBeNull();expect(h.manager.list("bot-1")).toHaveLength(1);- expect([h.manager.count("bot-1", "t-1"), h.manager.count("bot-2", "t-1")]).toEqual([1, 0]);+ expect(h.manager.list("bot-2")).toEqual([]);expect(h.manager.cancel(wait.id, "bot-1")?.id).toBe(wait.id);- expect(h.manager.count("bot-1", "t-1")).toBe(0);expect(h.settleCard.mock.calls.map(([, how]) => how)).toEqual(["cancelled"]);expect(h.manager.list("bot-1")).toEqual([]);expect(h.reload().owners()).toEqual([]);});- it("counts only this chat's waits, so list_waits and cancel_wait are listed in that chat and not in the bot's others", async () => {- const h = harness();- await h.create({ kind: "file_exists", path: "/r" }, { threadId: "t-1" });- // As server/index.ts sets OMB_ACTIVE_WAITS for a turn of bot-1 in a chat.- const listed = (threadId: string) => availableTools(catalogProfileFromEnv({ OMB_BOT_ID: "bot-1", OMB_ACTIVE_WAITS: h.manager.count("bot-1", threadId) ? "1" : "0" }))- .map((tool) => tool.name).filter((name) => ["wait_until", "list_waits", "cancel_wait"].includes(name));- expect([h.manager.count("bot-1", "t-1"), h.manager.count("bot-1", "t-2")]).toEqual([1, 0]);- expect(listed("t-2")).toEqual(["wait_until"]);- expect(listed("t-1")).toEqual(["wait_until", "list_waits", "cancel_wait"]);- });-it("removes a deleted bot's waits and nobody else's", async () => {const h = harness();await h.create({ kind: "file_exists", path: "/a" }); await h.create({ kind: "file_exists", path: "/b" });diff --git a/server/waits.ts b/server/waits.tsindex 189f7e2e12..f3134803ed 100644--- a/server/waits.ts+++ b/server/waits.ts@@ -243,11 +243,6 @@ export class WaitManager {return this.waits.filter((w) => w.botId === botId && !w.ending).map(cloneWait);}- /** How many of the bot's waits in this chat have not ended, without copying them: what list_waits would name there. */- count(botId: string, threadId: string): number {- return this.waits.reduce((count, w) => count + (w.botId === botId && w.threadId === threadId && !w.ending ? 1 : 0), 0);- }-/** Every wait, those ended but not yet posted too. */all(): WaitRecord[] {return this.waits.map(cloneWait);