Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Offer Claude Opus 5.5 (1M) and compact its sessions at 1M
AdityaUmale72b7c93c38c6
diff --git a/server/drivers/claude-catalog.test.ts b/server/drivers/claude-catalog.test.tsindex 69fef13f95..c0923cb04d 100644--- a/server/drivers/claude-catalog.test.ts+++ b/server/drivers/claude-catalog.test.ts@@ -27,7 +27,13 @@ describe("readClaudeModelCatalog", () => {label: "Claude Opus 5.5",contextWindow: 1_000_000,});- expect(ids.indexOf("claude-opus-5-5")).toBe(ids.indexOf("claude-opus-5") - 1);+ expect(STATIC_CLAUDE_MODELS.options[ids.indexOf("claude-opus-5-5[1m]")]).toEqual({+ id: "claude-opus-5-5[1m]",+ label: "Claude Opus 5.5 (1M)",+ contextWindow: 1_000_000,+ });+ expect(ids.indexOf("claude-opus-5-5[1m]")).toBe(ids.indexOf("claude-opus-5-5") + 1);+ expect(ids.indexOf("claude-opus-5-5[1m]")).toBe(ids.indexOf("claude-opus-5") - 1);expect(STATIC_CLAUDE_MODELS.options[ids.indexOf("claude-sonnet-5-5")]).toEqual({id: "claude-sonnet-5-5",label: "Claude Sonnet 5.5",diff --git a/server/drivers/claude.test.ts b/server/drivers/claude.test.tsindex 0c6a9e8a09..cb284e0bd6 100644--- a/server/drivers/claude.test.ts+++ b/server/drivers/claude.test.ts@@ -1707,6 +1707,20 @@ describe("ClaudeDriver turns (fake CLI)", () => {expect(seen.argv[seen.argv.indexOf("--autocompact") + 1]).toBe("200000");});+ it("compacts a [1m] model's CLI session at 1M", async () => {+ await create();+ await instance.snapshot();+ const dump = join(scratch, "compact-1m.json");+ process.env.FAKE_CLAUDE_DUMP = dump;++ await instance.adapter.sendTurn({ threadId: "t-compact-1m", text: "hi", model: "claude-opus-5-5[1m]" });+ await recorder.until((e) => e.type === "turn.completed");++ const seen = JSON.parse(readFileSync(dump, "utf8"));+ expect(seen.argv[seen.argv.indexOf("--model") + 1]).toBe("claude-opus-5-5[1m]");+ expect(seen.argv[seen.argv.indexOf("--autocompact") + 1]).toBe("1000000");+ });+it("clamps a configured compaction window into the range the CLI accepts", () => {expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "50000" })).toBe("100000");expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "9000000" })).toBe("1000000");@@ -1717,6 +1731,15 @@ describe("ClaudeDriver turns (fake CLI)", () => {expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "off" })).toBe(null);});+ it("compacts at 1M by default only for a model picked with the [1m] suffix", () => {+ expect(autoCompactWindow({}, "claude-opus-5-5[1m]")).toBe("1000000");+ expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "nonsense" }, "claude-opus-5-5[1m]")).toBe("1000000");+ expect(autoCompactWindow({}, "claude-opus-5-5")).toBe("200000");+ expect(autoCompactWindow({}, null)).toBe("200000");+ expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "300000" }, "claude-opus-5-5[1m]")).toBe("300000");+ expect(autoCompactWindow({ OMB_CLAUDE_AUTOCOMPACT: "off" }, "claude-opus-5-5[1m]")).toBe(null);+ });+it("passes no compaction window when it is turned off", async () => {const dump = join(scratch, "compact-off.json");await create(undefined, { FAKE_CLAUDE_DUMP: dump, OMB_CLAUDE_AUTOCOMPACT: "off" });diff --git a/server/drivers/claude.ts b/server/drivers/claude.tsindex a6a01cf007..8427ddd327 100644--- a/server/drivers/claude.ts+++ b/server/drivers/claude.ts@@ -179,14 +179,14 @@ export function readClaudeAuthSettings(}}-/** OMB_CLAUDE_AUTOCOMPACT: a token count, "auto" (the CLI's own window) or "off". The CLI rejects- * a window outside 100k-1M as an argument error, so a configured value is clamped. */-export function autoCompactWindow(env: NodeJS.ProcessEnv): string | null {+/** OMB_CLAUDE_AUTOCOMPACT: a token count, "auto" (the CLI's own window) or "off"; unset, 1M for a `[1m]` model, else 200K.+ * The CLI rejects a window outside 100k-1M as an argument error, so a configured value is clamped. */+export function autoCompactWindow(env: NodeJS.ProcessEnv, model?: string | null): string | null {const raw = (env.OMB_CLAUDE_AUTOCOMPACT ?? "").trim().toLowerCase();if (raw === "off") return null;if (raw === "auto") return "auto";- const parsed = raw ? Number(raw) : DEFAULT_AUTOCOMPACT_TOKENS;- if (!Number.isFinite(parsed) || parsed <= 0) return String(DEFAULT_AUTOCOMPACT_TOKENS);+ const fallback = model && /\[1m\]$/i.test(model) ? 1_000_000 : DEFAULT_AUTOCOMPACT_TOKENS, parsed = raw ? Number(raw) : fallback;+ if (!Number.isFinite(parsed) || parsed <= 0) return String(fallback);return String(Math.min(1_000_000, Math.max(100_000, Math.floor(parsed))));}@@ -1054,12 +1054,12 @@ export const ClaudeDriver: ProviderDriver<ClaudeConfig> = {if (projectSettingsOnly) args.push("--setting-sources", "project");if (turn.userSkillsDir) args.push("--add-dir", turn.userSkillsDir);}- const compactWindow = autoCompactWindow(turnEnvironment);+ const turnModel = config.managed ? turn.model : await resolveClaudeTurnModel(turn.model, turnEnvironment, config.endpointModels);+ const injected = config.managed || config.endpointModels ? { model: turnModel ?? null, injected: false } : applyClaudeInject({ ...turnEnvironment }, turnModel);+ const compactWindow = autoCompactWindow(turnEnvironment, injected.model);const passedAutocompact = Boolean(compactWindow) && ownCli && cliHasAutocompact === true; if (compactWindow && passedAutocompact) args.push("--autocompact", compactWindow);// --resume keeps the recorded system prompt, so every turn refreshes it.if (ownCli && cliVersionChecked && claudeCliSupports(cliVersion, "--system-prompt-snapshot")) args.push("--system-prompt-snapshot", "off");- const turnModel = config.managed ? turn.model : await resolveClaudeTurnModel(turn.model, turnEnvironment, config.endpointModels);- const injected = config.managed || config.endpointModels ? { model: turnModel ?? null, injected: false } : applyClaudeInject({ ...turnEnvironment }, turnModel);if (injected.model) args.push("--model", injected.model);if (turn.effort) args.push("--effort", turn.effort);diff --git a/server/host/warm-summary-host.ts b/server/host/warm-summary-host.tsindex c3f7c07fc5..1715e19d57 100644--- a/server/host/warm-summary-host.ts+++ b/server/host/warm-summary-host.ts@@ -41,7 +41,7 @@ export interface WarmSummaryHostDeps {/** Off with `context.autoCompact: false` or OMB_WARM_SUMMARY=0. */enabled(): boolean;/** Where the engine summarizes by itself, in tokens (Claude Code's --autocompact); undefined when OpenMausBot set none. */- nativeCompactAt(instanceId: string): number | undefined;+ nativeCompactAt(target: WarmSummaryTarget): number | undefined;/** A turn is running or being set up in this conversation, or the bot is busy elsewhere. */busy(botId: string, threadId: string): boolean;memoryShort(): boolean;@@ -127,7 +127,7 @@ export function createWarmSummaryHost(deps: WarmSummaryHostDeps) {const instance = deps.instance(target.instanceId);if (!instance) return null;if (!instance.adapter.cacheKeepWarm?.compact) return { way: "harness", soon: false };- const at = deps.nativeCompactAt(target.instanceId);+ const at = deps.nativeCompactAt(target);if (at === undefined || contextTokens === undefined || contextTokens < Math.min(WARM_SUMMARY_MIN_TOKENS, at / 2)) return null;return { way: "native", soon: contextTokens >= at * NATIVE_SOON_FRACTION };},diff --git a/server/index.ts b/server/index.tsindex 963d592123..d235194968 100644--- a/server/index.ts+++ b/server/index.ts@@ -5208,7 +5208,7 @@ cacheKeepWarmStatus = (threadId) => cacheKeepWarm.status(threadId);// Warm summaries (server/host/warm-summary-host.ts): a long conversation is summarized while it is idle, not at its next turn.const warmSummaries = createWarmSummaryHost({ store, instance: (id) => registry.get(id), queued: hasQueuedSteeredMessages, coordinator, waits: () => botWaits, routines: () => routines,enabled: () => cfg.context?.autoCompact !== false && process.env.OMB_WARM_SUMMARY !== "0" && spendState(cfg, DATA_DIR)?.exceeded !== true, memoryShort: () => engineMemory.headroom() < 0.3,- nativeCompactAt: (id) => { const instance = registry.get(id), at = instance ? nativeCompactTokens(instance) : undefined; return at && Number.isFinite(at) ? at : undefined; },+ nativeCompactAt: ({ botId, threadId, instanceId }) => { const instance = registry.get(instanceId), at = instance ? nativeCompactTokens(instance, botForThread(botId, threadId)?.modelSelection.model) : undefined; return at && Number.isFinite(at) ? at : undefined; },busy: (botId, threadId) => threadBusy(botId, threadId) || botHasActiveTurn(botId), keepWarmUntil: (threadId) => cacheKeepWarm.status(threadId)?.until, book: bookForkUsage, log: (line) => console.info(line), language: threadLanguage,fold: async ({ botId, threadId, instanceId }, idle) => { const bot = store.projectBotForTask(botId, threadId), model = store.taskByThread(botId, threadId)?.lastContextModel, instance = registry.get(instanceId), before = latestCompaction(store.activePath(threadId))?.id;if (bot && instance && model?.startsWith(`${instanceId}:`)) await compactConversation({ bot, threadId, generation: `idle:${randomUUID()}`, instance, model: model.slice(instanceId.length + 1), excludedIds: new Set(), manual: false, idle });@@ -7015,7 +7015,7 @@ async function compactConversation(input: {floor = measurement.tokens;store.patchTask(bot.id, threadId, { contextFloor: floor });}- const nativeCompactAt = nativeCompactTokens(instance);+ const nativeCompactAt = nativeCompactTokens(instance, model);if (!manual && !shouldCompact({ contextTokens: measurement?.tokens, estimatedBytes: bytes,budget: compactBudget(window, cfg.context?.compactAt, nativeCompactAt) * (idle ? HARNESS_IDLE_FRACTION : 1), floor, window, nativeCompactAt })) return;const fold = manual ? { folded: history, firstKeptId: "" } : foldPoint(history);@@ -7053,7 +7053,7 @@ const handoffs = new Handoffs({.filter((m) => m.role === "bot" && m.kind === "text" && !m.from && m.turnId === turnId).map((m) => m.id),});const roomSessions = createRoomSessions({ settings: () => cfg.context, messagesFor: (threadId) => store.messagesFor(threadId) });-const nativeCompactTokens = (instance: { driverKind: string; instanceId: string }) => instance.driverKind === "claudeAgent" ? Number(autoCompactWindow({ ...process.env, ...cfg.instances?.[instance.instanceId]?.environment })) : undefined;+const nativeCompactTokens = (instance: { driverKind: string; instanceId: string }, model: string | null | undefined) => instance.driverKind === "claudeAgent" ? Number(autoCompactWindow({ ...process.env, ...cfg.instances?.[instance.instanceId]?.environment }, model)) : undefined;const loopingEngine = (threadId: string, bot = store.botByThread(threadId)) => bot ? runningTurnInstance(botForThread(bot.id, threadId), threadId)?.adapter : undefined;const canSteerThread = (threadId: string) => {@@ -10263,7 +10263,7 @@ async function runClaimedGroupMemberTurn(const roomToolScope = toolScopeForTurn(readyBot.id), roomUserMcp = claudeUserMcpEnabled(cfg) && !managedPolicy.restrictsMcp();const roomSession = roomSessions.dispatch({threadId, botId: readyBot.id, claimId: internalGeneration, instance, guestConfined: roomGuestConfined, reset: Boolean(roomReset), hooks: Boolean(integrations.hooks),- context: () => ({ ...roomMemberContexts.forThread(threadId)?.[readyBot.id], compactAt: nativeCompactTokens(instance) }),+ context: () => ({ ...roomMemberContexts.forThread(threadId)?.[readyBot.id], compactAt: nativeCompactTokens(instance, readyBot.modelSelection.model) }),config: [roomSystem.stable, cwd, readyBot.modelSelection, turnApprovalMode, roomToolScope, roomUserMcp, integrations],window: roomWindow, tail: roomTail, wrap: (body) => withTurnClock(clock, withRecalled(roomRecalled, roomPick + attachmentsForBox(body, cwd) + roomShareNote.text + devsReports.note(threadId, Boolean(integrations.agents)))),});diff --git a/server/model-manifest/model-manifest.json b/server/model-manifest/model-manifest.jsonindex 0d6a8534a2..2db2fb2d19 100644--- a/server/model-manifest/model-manifest.json+++ b/server/model-manifest/model-manifest.json@@ -1,6 +1,6 @@{"version": 1,- "updatedAt": "2026-11-09T21:02:58Z",+ "updatedAt": "2026-11-17T12:30:00Z","engines": {"claude": {"default": "claude-sonnet-5",@@ -28,6 +28,12 @@"status": "current","contextWindow": 1000000},+ {+ "id": "claude-opus-5-5[1m]",+ "name": "Claude Opus 5.5 (1M)",+ "status": "current",+ "contextWindow": 1000000+ },{"id": "claude-opus-5","name": "Claude Opus 5",