Skip to content

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

Fit the Local VM and VPS computer bridges to the session's tool budget

AdityaUmale3fa9bc914998
diff --git a/server/drivers/session-tool-budget.test.ts b/server/drivers/session-tool-budget.test.ts
index c52644b6f7..49e51200d4 100644
--- a/server/drivers/session-tool-budget.test.ts
+++ b/server/drivers/session-tool-budget.test.ts
@@ -151,6 +151,21 @@ describe("the session's tool budget over every server", () => {
expect(logged).toContain(`[mcp] notes: not relayed by OpenMausBot, so not fitted to the session's tool budget (${UNKNOWN_LIST_RESERVE} bytes set aside each)`);
});
+ it("sizes the computer's bridge wherever the computer runs (this computer, Local VM, VPS), from source or the built app", () => {
+ const recordsDir = mkdtempSync(join(tmpdir(), "stb-"));
+ const built = (name: string) => `C:\\Program Files\\OpenMausBot\\resources\\server\\${name}.js`;
+ const bridges = [SPAWNED_PROXIES.localComputer, SPAWNED_PROXIES.containerMcp, SPAWNED_PROXIES.vpsContainerMcp, built("container-mcp"), built("vps-container-mcp")];
+ for (const script of bridges) {
+ const { planned, logged } = plan([agents, { ...relay("computer", script), args: [script, "docker", "omb-local-vm"] }], recordsDir);
+ const env = envOf(planned[1]!);
+ expect(Number(env[TOOL_LIST_SHARE_ENV]), script).toBeGreaterThan(UNKNOWN_LIST_RESERVE - 1);
+ expect(env[TOOL_LIST_RECORD_ENV], script).toContain(recordsDir);
+ expect(logged.join("\n"), script).not.toContain("not relayed");
+ }
+ const lookalike = relay("computer", built("my-container-mcp"));
+ expect(plan([agents, lookalike], recordsDir).planned[1]).toBe(lookalike);
+ });
+
it("names the recorded tools the CLI refuses for their name, whatever their size", () => {
const recordsDir = mkdtempSync(join(tmpdir(), "stb-"));
const long = { name: `GOOGLEDRIVE_${"X".repeat(50)}`, description: "d", inputSchema: { type: "object" } };
diff --git a/server/drivers/session-tool-budget.ts b/server/drivers/session-tool-budget.ts
index 012a4c78ad..5216e731d1 100644
--- a/server/drivers/session-tool-budget.ts
+++ b/server/drivers/session-tool-budget.ts
@@ -21,7 +21,7 @@ export const SESSION_TOOL_BUDGET_ENV = "OMB_SESSION_TOOL_BUDGET";
/** The least set aside for a server whose list is not known yet. */
export const UNKNOWN_LIST_RESERVE = 8_000;
-const RELAY = /(?:^|[\\/])(?:connector-proxy|mcp-gate|mcp-remote-proxy|local-computer-proxy)\.[jt]s$/;
+const RELAY = /(?:^|[\\/])(?:connector-proxy|mcp-gate|mcp-remote-proxy|local-computer-proxy|container-mcp|vps-container-mcp)\.[jt]s$/;
/** The tool names the native CLI accepts, as `mcp_<server>_<tool>`. */
const CLI_TOOL_NAME = /^[a-zA-Z0-9_-]{1,64}$/;