Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(claude): make the endpoint folder before the MCP temp folder; pin the endpoint bind in the test
AdityaUmale09a777f444b2
diff --git a/server/drivers/claude-box.test.ts b/server/drivers/claude-box.test.tsindex c989a50377..e641f96fb2 100644--- a/server/drivers/claude-box.test.ts+++ b/server/drivers/claude-box.test.ts@@ -159,7 +159,8 @@ describe("a Claude turn in the bot box", () => {}}, 60_000);// A custom endpoint (Settings > Custom endpoint) gets its own folder under providers/ but no sign-in that would make it.- it.skipIf(process.platform === "win32")("makes a custom endpoint's own Claude folder before the box binds it", async () => {+ // The fixture lives under the checkout, outside /tmp (never bound): skip where the checkout itself is under /tmp.+ it.skipIf(process.platform === "win32" || process.cwd().startsWith(tmpdir()))("makes a custom endpoint's own Claude folder before the box binds it", async () => {ensureDirs();chmodSync(FAKE_CLI, 0o755);const scratch = mkdtempSync(join(tmpdir(), "omb-claude-box-endpoint-"));@@ -195,6 +196,7 @@ describe("a Claude turn in the bot box", () => {expect(existsSync(configDir), "the endpoint's folder was made").toBe(true);const boxed = wrap.mock.results.map((result) => result.value as WrappedSpawn | null).find((spawned) => spawned?.plan.botId === "bot-a");expect(boxed, "the engine ran in the box").toBeTruthy();+ expect(boxed!.plan.mounts, "the endpoint folder is bound on its own line").toContainEqual(expect.objectContaining({ source: configDir, target: configDir }));expect(visibleInBox(boxed!.plan, configDir)).toBe("rw");}, 60_000);});diff --git a/server/drivers/claude.ts b/server/drivers/claude.tsindex 2e2c96f7b3..57edac1535 100644--- a/server/drivers/claude.ts+++ b/server/drivers/claude.ts@@ -1135,6 +1135,7 @@ export const ClaudeDriver: ProviderDriver<ClaudeConfig> = {allowed.push("mcp__ogb", ...gateQueryTools(mcpServers));// A guest pre-allows only harness tools; anything else (the browser can open file:) asks.if (turn.guestConfined) allowed.splice(0, allowed.length, ...allowed.filter((name) => name === "mcp__ogb" || name === "mcp__agents"));+ const env = withEndpointFolder(environment(config.endpointModels ? undefined : turnModel), config);// The MCP config carries credentials and argv is readable via `ps`: a 0600 file, removed at settle.let mcpConfigPath: string | null = null;if (Object.keys(mcpServers).length) {@@ -1143,7 +1144,6 @@ export const ClaudeDriver: ProviderDriver<ClaudeConfig> = {args.push("--allowedTools", allowed.join(","));}- const env = withEndpointFolder(environment(config.endpointModels ? undefined : turnModel), config);const authSettings = isolated && !injected.injected? readClaudeAuthSettings(env, input.environment) : {};// The hook helper reads its bearer from a per-thread file refreshed every turn, so a