Skip to content

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

pi: only the agents server gets the longer start time

milind-soni87fdf2c5db1f
diff --git a/server/drivers/pi-mcp-servers.ts b/server/drivers/pi-mcp-servers.ts
index 6e2486f267..4c62ef6207 100644
--- a/server/drivers/pi-mcp-servers.ts
+++ b/server/drivers/pi-mcp-servers.ts
@@ -24,8 +24,7 @@ export function buildMcpServers(turn: SendTurnInput): Record<string, unknown> |
...(local.scope ? { scope: local.scope } : {}),
};
}
- // A turn can't run without the agents server: give it the start time every other engine gives it.
- if (turn.integrations?.agents) servers.agents = { ...turn.integrations.agents, startupMs: agentsStartupMs() };
+ if (turn.integrations?.agents) servers.agents = { ...turn.integrations.agents };
if (turn.integrations?.phone) servers.phone = { ...turn.integrations.phone };
if (turn.integrations?.dweb) {
servers.dweb = {
@@ -44,8 +43,10 @@ export function buildMcpServers(turn: SendTurnInput): Record<string, unknown> |
const gated = gateServer({ name, server, toolScope: parsed.scope, threadId: turn.threadId, nodeEnv: NODE_ENV_FLAG, directory, ...customServerGate(name, name in (turn.integrations?.custom ?? {}), turn.integrations?.customResultBudgets), apps: appMountFor(name, turn) });
const stdio = gated ?? mcpStdioServer(server, { nodeEnv: NODE_ENV_FLAG, ...(directory ? { directory: { name } } : {}) });
if (!stdio) throw new Error("Pi MCP server configuration is invalid");
- const original = server as { scope?: string; startupMs?: number };
- servers[name] = { ...stdio, ...(original.scope ? { scope: original.scope } : {}), ...(original.startupMs ? { startupMs: original.startupMs } : {}), ...(directory ? { directory: true } : {}) };
+ const original = server as { scope?: string };
+ // A turn can't run without the agents server: give it the start time every other engine gives it. No other server
+ // carries a start time of its own, so a custom server's config can't set one.
+ servers[name] = { ...stdio, ...(original.scope ? { scope: original.scope } : {}), ...(name === "agents" ? { startupMs: agentsStartupMs() } : {}), ...(directory ? { directory: true } : {}) };
}
return Object.keys(servers).length ? servers : null;
}