Skip to content

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

test: expect session-scoped MCP behind the schema-profile gate

koeriabd23c1d8235a
diff --git a/server/drivers/agents-mcp-env.ts b/server/drivers/agents-mcp-env.ts
index 664119a785..494c4e7fb6 100644
--- a/server/drivers/agents-mcp-env.ts
+++ b/server/drivers/agents-mcp-env.ts
@@ -6,12 +6,8 @@ import { DEFER_TOOLS_ENV } from "./agents-claude-defer.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_EXTERNAL_RUNTIME", "OMB_CHIEF_OF_STAFF",
"OMB_SKILL_AUTHORING_ENABLED", "OMB_SKILL_BURGER", "OMB_MEMORY_ENABLED", "OMB_SHARED_COMPUTERS_ENABLED", "OMB_CLOUD_HOME", "OMB_VOICE_NOTES",
-<<<<<<< HEAD
"OMB_X_RESEARCH", "OMB_RESEARCH", "OMB_TEAM_PEOPLE", "OMB_TEAM_BOARD", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", "OMB_TOOLS_OFF", "OMB_LOCAL_VM", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV,
-=======
- "OMB_X_RESEARCH", "OMB_RESEARCH", "OMB_TEAM_PEOPLE", "OMB_MAUSBOT", "OMB_COMPUTER_SELECTION", "OMB_ROOM", "OMB_IMAGE_GENERATION", "OMB_MEETINGS", "OMB_APP_HOSTING", "OMB_TOOLS_OFF", "OMB_LOCAL_VM", TOOL_BRIDGE_ENV, TOOL_LIMIT_ENV,
// The engine's schema profile: the URL form carries it as the stdio proxy's environment does.
TOOL_SCHEMA_PROFILE_ENV,
->>>>>>> 56bac665c (Gemini: fit the MCP tool list to the CLI's size budget)
// Claude's deferred catalog: the URL form carries it as the stdio proxy's environment does.
DEFER_TOOLS_ENV] as const;
diff --git a/server/drivers/antigravity.test.ts b/server/drivers/antigravity.test.ts
index 9b91dddf5e..3f041e37af 100644
--- a/server/drivers/antigravity.test.ts
+++ b/server/drivers/antigravity.test.ts
@@ -1021,8 +1021,14 @@ describe("Antigravity driver over shared ACP", () => {
{ method: "session/set_config_option", params: { sessionId: "fake-acp-session", configId: "mode", value: approvalMode === "full" ? "yolo" : approvalMode === "edits" ? "auto_edit" : "default" } },
{ method: "session/set_config_option", params: { sessionId: "fake-acp-session", configId: "thinking_level", value: "high" } },
]);
- const mcp = JSON.parse(readFileSync(`${dump}.mcp.json`, "utf8"));
- expect(mcp).toEqual([{ name: "docs", command: "docs-mcp", args: ["serve"], env: [{ name: "TOKEN", value: "scoped" }] }]);
+ const mcp = JSON.parse(readFileSync(`${dump}.mcp.json`, "utf8")) as Array<{ name: string; command: string; args: string[]; env: Array<{ name: string; value: string }> }>;
+ // Under a schema profile (the Gemini engine) the person's stdio server goes through the MCP gate.
+ const docs = mcp.find((server) => server.name === "docs");
+ expect(docs).toBeDefined();
+ expect(docs!.command).toBe(process.execPath);
+ expect(docs!.args[0]).toContain("mcp-gate");
+ const upstream = JSON.parse(docs!.env.find((entry) => entry.name === "OMB_GATE_UPSTREAM")!.value) as { command: string; args: string[]; env: Record<string, string> };
+ expect(upstream).toEqual({ command: "docs-mcp", args: ["serve"], env: { TOKEN: "scoped" } });
// Checked on every OS, so the macOS and Linux runs prove the dump carries TEMP.
const expectedTemp = process.platform === "win32" ? antigravityTempDir(DATA_DIR, instanceId) : fake.directory;
expect([dumpState.env.TEMP, dumpState.env.TMP]).toEqual([expectedTemp, expectedTemp]);