Skip to content

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

Let the tar install keep in-bounds symlinks, pin the Windows build

JoaoPec407b59bc7efb
diff --git a/docs/verification/engines-ui.md b/docs/verification/engines-ui.md
index 3a84309a52..5f0266ddf3 100644
--- a/docs/verification/engines-ui.md
+++ b/docs/verification/engines-ui.md
@@ -48,7 +48,7 @@ recreating a removed fixture directory.
**Update OpenCode on this server**. Click each and confirm the fixture error
appears with its button usable again. Terminal commands remain under
**Prefer a terminal?**. Check that OMP appears as a custom engine beside Pi, and
- Mistral Vibe under Needs setup while `vibe-acp` is missing. These clicks never
+ Mistral (Vibe) under Needs setup while `vibe-acp` is missing. These clicks never
perform a real installation.
7. Expand Claude and use **Add another Claude account** inside its card. Enter
an account name, collapse/reopen the card, and confirm the draft remains.
diff --git a/scripts/verify-engines-ui.ts b/scripts/verify-engines-ui.ts
index ee56cdf288..575b2b3cbc 100644
--- a/scripts/verify-engines-ui.ts
+++ b/scripts/verify-engines-ui.ts
@@ -32,7 +32,7 @@ const instances: InstanceInfo[] = [
["qwen", "qwenAgent", "Qwen", false, ""],
["pi", "piAgent", "Pi", false, ""],
["omp", "ompAgent", "OMP", false, ""],
- ["mistralVibe", "mistralVibeAgent", "Mistral Vibe", false, ""],
+ ["mistralVibe", "mistralVibeAgent", "Mistral (Vibe)", false, ""],
["deepseek", "deepseekAgent", "DeepSeek Harness", false, ""],
["githubCopilot", "copilotAgent", "GitHub Copilot", true, "1.0.103"],
["commandCode", "commandCodeAgent", "Command Code", true, "1.88.4"],
diff --git a/server/drivers/acp/core.ts b/server/drivers/acp/core.ts
index 09cd35da78..f349569f4f 100644
--- a/server/drivers/acp/core.ts
+++ b/server/drivers/acp/core.ts
@@ -1557,7 +1557,7 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>
if (err) {
const failure = err as NodeJS.ErrnoException & { killed?: boolean };
const reason = failure.code === "ENOENT"
- ? `\`${config.cli}\` isn't installed, or isn't on this app's PATH. Install it for the user running OpenMausBot or use Set CLI, then check again.`
+ ? `${support.displayName} isn't installed where the app runs. Use the install button on this card, point Set CLI at an existing CLI, then check again.`
: failure.code === "EACCES" || failure.code === "EPERM"
? `\`${config.cli}\` isn't executable. Check its file permissions, then check again.`
: failure.killed && failure.code == null
diff --git a/server/drivers/acp/mistral-vibe-release.ts b/server/drivers/acp/mistral-vibe-release.ts
index f2a4df68be..8f92febe56 100644
--- a/server/drivers/acp/mistral-vibe-release.ts
+++ b/server/drivers/acp/mistral-vibe-release.ts
@@ -2,11 +2,14 @@
// github.com/mistralai/mistral-vibe ships for version 3.1.2 (releases/download/v3.1.2).
// Mistral publishes no checksum file. Each archive SHA-256 below was measured on 2026-11-14 by downloading the asset
// once and running `shasum -a 256`; each size is that download's byte count. Each program SHA-256 is `shasum -a 256` of
-// `vibe-acp` unpacked from the same archive (`tar -xzO` / `unzip -p`); the app checks it after unpacking, before
-// reusing an installed copy and at every start. The archive carries `vibe-acp` beside its `_internal/` PyInstaller
-// bundle, so the executable is run in place. The macOS builds' code signature is adhoc (no Team ID), so the pin sets
-// no `macTeamId`; Windows ships x64 only.
-// `mistral-vibe` is current on PyPI at 3.1.2 too; the vendor's `install.sh` installs that package through uv.
+// `vibe-acp` unpacked from the same archive (`tar -xzO`); the app checks it after unpacking, before reusing an
+// installed copy and at every start. The archive is a PyInstaller onedir bundle: `vibe-acp` runs against the
+// `_internal/` folder beside it, which it finds from where it really is (a `bin/` link resolves there), so the pin is a
+// launcher like Cursor's. The bundle's archives keep a few in-bounds symlinks (the macOS `Python.framework` keeps
+// the framework's `Current` links), which the installer accepts and keeps. macOS builds are signed adhoc (no team id).
+// `mistral-vibe` is current on PyPI at 3.1.2 too. All four runtime shapes are pinned here, the Windows one through the
+// launcher path (see engine-standalone's `winLauncher`: the exe runs from its version folder, since Windows cannot link
+// a file the way bin/ needs without developer mode).
import type { StandaloneRelease } from "../../contracts.ts";
const VERSION = "3.1.2";
@@ -18,6 +21,7 @@ export const MISTRAL_VIBE_STANDALONE: StandaloneRelease = {
version: VERSION,
// github.com answers with a redirect to GitHub's release-asset host.
hosts: ["github.com", "release-assets.githubusercontent.com", "objects.githubusercontent.com"],
+ launcher: true,
assets: {
"darwin-arm64": { url: `${RELEASE}/vibe-acp-darwin-aarch64-3.1.2.tar.gz`, archive: "tar.gz", executable: "vibe-acp", approxBytes: 68_858_580, sha256: "cff30ab96c08e77e3628160fb5dd7ebde78dd24cff624e03465c8618b9c05020", executableSha256: "bffbd823f7da50e4c499fe52abf3888a63874995795318c171081bb8878538b1" },
"darwin-x64": { url: `${RELEASE}/vibe-acp-darwin-x86_64-3.1.2.tar.gz`, archive: "tar.gz", executable: "vibe-acp", approxBytes: 70_461_490, sha256: "8fc70f9dec996d2a8713005bd94d97ed53d145fdd503c00b3abf4807f15a66dd", executableSha256: "265ec8f7f5884561737541028a260e3738301ed5e401caa29b8628af1d522ee5" },
diff --git a/server/drivers/acp/mistral-vibe.test.ts b/server/drivers/acp/mistral-vibe.test.ts
index efbf838679..0e432e0191 100644
--- a/server/drivers/acp/mistral-vibe.test.ts
+++ b/server/drivers/acp/mistral-vibe.test.ts
@@ -14,7 +14,7 @@ import { MistralVibeAgentDriver, resolveMistralVibeModels, vibeSignedIn } from "
const FAKE_CLI = join(dirname(fileURLToPath(import.meta.url)), "../../testing/fake-acp-cli.ts");
const MODELS = "mistral-medium-3.5,zai-glm-5-3-flash,Mistral Large,Codestral";
-describe("Mistral Vibe ACP driver", () => {
+describe("Mistral (Vibe) ACP driver", () => {
let scratch: string;
let instance: ProviderInstance | undefined;
let recorder: EventRecorder | undefined;
@@ -35,7 +35,7 @@ describe("Mistral Vibe ACP driver", () => {
async function create(environment: Record<string, string> = {}) {
instance = await MistralVibeAgentDriver.create({
instanceId: `mistral-vibe-contract-${Math.random().toString(36).slice(2)}`,
- displayName: "Mistral Vibe",
+ displayName: "Mistral (Vibe)",
enabled: true,
environment: {
VIBE_HOME: join(scratch, "vibe-home"),
@@ -58,7 +58,7 @@ describe("Mistral Vibe ACP driver", () => {
expect(BUILT_IN_DRIVERS.some((driver) => driver.driverKind === "mistralVibeAgent")).toBe(true);
expect(instanceConfigs({}).mistralVibe?.driver).toBe("mistralVibeAgent");
expect(instanceConfigs({ instances: { claude: { driver: "claudeAgent" } } }).mistralVibe?.driver).toBe("mistralVibeAgent");
- expect(MistralVibeAgentDriver.metadata).toMatchObject({ displayName: "Mistral Vibe", access: "subscription" });
+ expect(MistralVibeAgentDriver.metadata).toMatchObject({ displayName: "Mistral (Vibe)", access: "subscription" });
});
it("treats a populated whoami_cache.json or MISTRAL_API_KEY as signed in", () => {
diff --git a/server/drivers/acp/mistral-vibe.ts b/server/drivers/acp/mistral-vibe.ts
index 6053349c0b..011ca34376 100644
--- a/server/drivers/acp/mistral-vibe.ts
+++ b/server/drivers/acp/mistral-vibe.ts
@@ -83,7 +83,7 @@ export async function resolveMistralVibeModels(
export const mistralVibeSupport: AcpSupport = {
driverKind: "mistralVibeAgent",
- displayName: "Mistral Vibe",
+ displayName: "Mistral (Vibe)",
models: MISTRAL_VIBE_MODELS,
defaultCli: "vibe-acp",
cliVersion: /^vibe-acp /u,
diff --git a/server/engine-standalone.test.ts b/server/engine-standalone.test.ts
index cf6f170ea2..681a77a0b4 100644
--- a/server/engine-standalone.test.ts
+++ b/server/engine-standalone.test.ts
@@ -522,6 +522,24 @@ describe.skipIf(process.platform === "win32")("installing a standalone engine",
expect(leftovers()).toEqual([]);
});
+ it("keeps a tar.gz whose links stay inside the folder, drops none, refuses an escaping one", async () => {
+ // Mistral Vibe's bundle: a Python.framework-style link tree beside the program.
+ const source = mkdtempSync(join(scratch, "tar-good-links-"));
+ writeFileSync(join(source, "fake-engine"), script(), { mode: 0o755 });
+ mkdirSync(join(source, "lib", "Versions", "3.12"), { recursive: true });
+ writeFileSync(join(source, "lib", "Versions", "3.12", "Python"), "dylib", { mode: 0o644 });
+ symlinkSync(join("Versions", "3.12", "Python"), join(source, "lib", "Current"));
+ symlinkSync(join("..", "..", "outside"), join(source, "escape"));
+ const file = join(scratch, `links-${Math.random().toString(36).slice(2)}.tar.gz`);
+ await tar.c({ gzip: true, file, cwd: source, portable: true }, ["fake-engine", "lib", "escape"]);
+ await expect(install(fixtureRelease({ [standalonePlatformKey()]: serve(readFileSync(file), "tar.gz", "fake-engine", script()) }))).rejects.toThrow(/unsafe/);
+ expect(leftovers()).toEqual([]);
+ await tar.c({ gzip: true, file, cwd: source, portable: true }, ["fake-engine", "lib"]);
+ const installed = await install(fixtureRelease({ [standalonePlatformKey()]: serve(readFileSync(file), "tar.gz", "fake-engine", script()) }));
+ expect(installed.executablePath).toBe(binPath());
+ expect(readFileSync(join(engineDir(), VERSION, "lib", "Current"), "utf8")).toBe("dylib");
+ });
+
it("clears what an interrupted install left before it starts", async () => {
mkdirSync(join(engineDir(), ".staging-old", "deep"), { recursive: true });
mkdirSync(binDir(), { recursive: true });
diff --git a/server/engine-standalone.ts b/server/engine-standalone.ts
index 1f938b59e7..3ca5e477d6 100644
--- a/server/engine-standalone.ts
+++ b/server/engine-standalone.ts
@@ -473,6 +473,15 @@ async function extractTarGz(archivePath: string, staging: string): Promise<boole
const type = "type" in entry ? entry.type : undefined;
const name = path.replace(/^(?:\.\/)+/u, "").replace(/\/$/u, "");
if (name === "" && type === "Directory") return false;
+ if (type === "SymbolicLink") {
+ // A bundled runtime may link inside itself (PyInstaller's Python.framework does); a link out of the folder is
+ // what an unsafe archive hides behind.
+ if (!safeArchivePath(name) || !safeInboundLink(name, "linkpath" in entry ? String(entry.linkpath) : "")) {
+ unsafe = true;
+ return false;
+ }
+ return true;
+ }
if ((type !== "File" && type !== "Directory") || !safeArchivePath(name)) {
unsafe = true;
return false;
@@ -483,6 +492,26 @@ async function extractTarGz(archivePath: string, staging: string): Promise<boole
return !unsafe;
}
+/** True when a link entry resolving to `link` from the entry's own `name` stays inside the unpacked folder: relative,
+ * safe characters, never reaching past the folder root, and never a link to the containing folder itself. */
+function safeInboundLink(name: string, link: string): boolean {
+ if (!link || link.startsWith("/") || link.includes("\\") || link.includes(":")) return false;
+ let depth = name.split("/").slice(0, -1).filter((segment) => segment !== ".").length;
+ let steps = 0;
+ for (const segment of link.split("/")) {
+ if (segment === "" || segment === ".") continue;
+ if (segment === "..") {
+ depth -= 1;
+ if (depth < 0) return false;
+ continue;
+ }
+ if (!safeArchivePath(segment)) return false;
+ depth += 1;
+ steps += 1;
+ }
+ return steps > 0;
+}
+
/** Folders 0755, files 0755 when the archive marked them executable and 0644 otherwise: no setuid, nothing writable by others. */
async function normaliseModes(directory: string): Promise<void> {
for (const entry of await readdir(directory, { withFileTypes: true })) {
@@ -492,9 +521,8 @@ async function normaliseModes(directory: string): Promise<void> {
await normaliseModes(path);
} else if (entry.isFile()) {
await chmod(path, ((await stat(path)).mode & 0o111) !== 0 ? 0o755 : 0o644);
- } else {
- throw Object.assign(new StandaloneInstallError("The archive contains an unexpected or unsafe file. Nothing was installed."), userErrorFields(userError("serverError.install.unsafeArchive")));
}
+ // A link the archive kept (see extractTarGz) was already vetted as one that stays inside; its mode is its target's.
}
}
@@ -635,10 +663,15 @@ async function activate(engineDir: string, release: StandaloneRelease, asset: St
await realFolder(binDir, release);
const name = programName(asset.executable);
const source = executableIn(versionDir, asset.executable);
- const target = join(binDir, name);
+ // A launcher keeps finding its folder beside itself. POSIX can point bin/ at it with a link; Windows refuses a file
+ // symlink without Developer Mode, so there the version folder (the exe beside its bundle) takes bin/'s PATH slot.
+ const winLauncher = release.launcher && process.platform === "win32";
+ const target = winLauncher ? source : join(binDir, name);
const fresh = join(binDir, `${NEW_PREFIX}${randomUUID()}${extname(name)}`);
try {
- if (release.launcher) {
+ if (winLauncher) {
+ // No bin entry to write; a folder check below keeps bin/ clean all the same.
+ } else if (release.launcher) {
// A launcher finds the rest of its folder from where it really is, so bin/ links to it rather than holding a copy.
await symlink(launcherLink(release.version, asset.executable), fresh);
} else try {
@@ -661,7 +694,7 @@ async function activate(engineDir: string, release: StandaloneRelease, asset: St
const pointer: CurrentPointer = { version: release.version, executable: asset.executable, sha256: asset.sha256, executableSha256: programSha256 };
writeFileAtomic(join(engineDir, CURRENT), `${JSON.stringify(pointer)}\n`, { mode: 0o600 });
activeVersions.add(versionDir);
- registerFallbackPathDir(binDir);
+ registerFallbackPathDir(winLauncher ? versionDir : binDir);
resetPathCache();
return { version: release.version, executablePath: target, binDir };
}
diff --git a/src/components/EngineLibrary.tsx b/src/components/EngineLibrary.tsx
index a74d35eaaf..cf51a83603 100644
--- a/src/components/EngineLibrary.tsx
+++ b/src/components/EngineLibrary.tsx
@@ -19,7 +19,7 @@ const providers: Record<string, string> = {
claudeAgent: "Anthropic", codex: "OpenAI", grok: "xAI", grokAgent: "xAI",
kimiAgent: "Moonshot AI", droidAgent: "Factory", cursorAgent: "Cursor",
antigravityAgent: "Google", opencodeGo: "OpenCode", qwenAgent: "Qwen",
- hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", piAgent: "pi.dev", mistral: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", modelgo: "ModelGo", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",
+ hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", piAgent: "pi.dev", mistral: "Mistral AI", mistralVibeAgent: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", modelgo: "ModelGo", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",
};
export function providerName(instance: InstanceInfo): string {