Skip to content

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

Train Y3: Pi's turn MCP folder joins the session folder in the box's one read-write list

milind-soni3b9c7b9a4eec
diff --git a/server/drivers/pi-lifecycle.test.ts b/server/drivers/pi-lifecycle.test.ts
index 29b0e33173..46d0f8480a 100644
--- a/server/drivers/pi-lifecycle.test.ts
+++ b/server/drivers/pi-lifecycle.test.ts
@@ -167,7 +167,7 @@ it("makes the private turn MCP configuration available inside the bot box", asyn
const request = wrap.mock.calls.map(([request]) => request).find(({ env }) => env.OMB_MCP_CONFIG);
const configPath = request?.env.OMB_MCP_CONFIG;
expect(configPath).toBeDefined();
- expect(request?.rw).toEqual([dirname(configPath!)]);
+ expect(request?.rw).toContain(dirname(configPath!));
expect(JSON.parse(readFileSync(configPath!, "utf8"))).toMatchObject({ askUser: true, mcpServers: {} });
if (process.platform !== "win32") expect(statSync(configPath!).mode & 0o777).toBe(0o600);
await instance.adapter.interruptTurn("boxed-mcp");
diff --git a/server/drivers/pi.ts b/server/drivers/pi.ts
index 678fccf60f..6a4a509c0c 100644
--- a/server/drivers/pi.ts
+++ b/server/drivers/pi.ts
@@ -471,10 +471,10 @@ export const PiDriver: ProviderDriver<PiConfig> = {
// spawnCli can throw synchronously, before settle() could remove the credential file.
const child = (() => {
try {
- return spawnCli(config.cli, childArgs, { box: { rw: [mcpTempDir] },
+ return spawnCli(config.cli, childArgs, {
stdio: ["pipe", "pipe", "pipe"],
cwd: turn.cwd,
- box: { rw: [sessionDir] },
+ box: { rw: [sessionDir, mcpTempDir] },
env: piEnvironment({
...process.env,
...input.environment,