Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Cap: the chat line says this computer, a person's word
milind-sonicafdfdb249a4
diff --git a/docs/self-hosting.md b/docs/self-hosting.mdindex 176c37de75..d166730f1b 100644--- a/docs/self-hosting.md+++ b/docs/self-hosting.md@@ -603,7 +603,7 @@ twice its fair share of the server's memory (the memory over the turns thatmay run at once), at least 1,900 MB and at most 80% of it. A bot over thatfor two checks in a row (every 5 seconds), or 50% over it once, has itsengine stopped and its own browser closed; its running turn ends with a line-saying which bot used more memory than this server allows for one bot.+saying which bot used more memory than this computer allows for one bot.Engines and browsers several bots share are never stopped this way. Set`OMB_BOT_MEMORY_MAX_MB` to a number of MB, or to `off`; the desktop app hasno cap unless it is set. The server enforces the cap itself by reading itsdiff --git a/server/chat-notices.ts b/server/chat-notices.tsindex 10ff0afbb3..31ca6ab728 100644--- a/server/chat-notices.ts+++ b/server/chat-notices.ts@@ -151,7 +151,7 @@ export const CHAT_NOTICE = {"chat.notice.memoryReclaimedBrowser": "Ran out of room, so I closed the browser to keep everything else running.","chat.notice.memoryReclaimedTask": "Ran out of room, so I stopped this task to keep everything else running.","chat.notice.botMemoryCap":- "{bot} used more memory than this server allows for one bot ({used} MB of {cap} MB), so I stopped this task to keep the other bots running. Send the message again to start over; if it keeps happening, give this task less to do at once, or give the server more memory.",+ "{bot} used more memory than this computer allows for one bot ({used} MB of {cap} MB), so I stopped this task to keep the other bots running. Send the message again to start over; if it keeps happening, give this task less to do at once, or give this computer more memory.","chat.notice.memoryReclaimedBrowserDetail": "Ran out of room, so I closed the browser to keep everything else running. ({detail})","chat.notice.memoryReclaimedTaskDetail": "Ran out of room, so I stopped this task to keep everything else running. ({detail})","chat.notice.outOfProcesses": "There is no room to start another program ({code}), so this task could not run. Nothing was sent to the AI. It starts again by itself when there is room.",diff --git a/server/host-fault.ts b/server/host-fault.tsindex 6f61e7534e..987dbaf098 100644--- a/server/host-fault.ts+++ b/server/host-fault.ts@@ -20,7 +20,7 @@ const OUT_OF_ROOM = new RegExp(String.raw`|\bexited null\b|\bexited 137\b|\(signal SIGKILL\)|\bkilled by (?:the kernel|signal SIGKILL)\b` +String.raw`|\b(?:never sent|sent nothing|did not send) (?:its|a|any) first (?:frame|event|output|message)\b`, "i");/** bot-memory-cap.ts's own line (chat.notice.botMemoryCap), after the bot's name. */-const BOT_MEMORY = /\bused more memory than this server allows for one bot\b/i;+const BOT_MEMORY = /\bused more memory than this computer allows for one bot\b/i;const DISK_FULL = /\bno space left on device\b|\bENOSPC\b|\bdisk quota exceeded\b|\bEDQUOT\b/i;const TOOL_SERVER = new RegExp(String.raw`\bMCP server\b[^\n]*\b(?:could not start|couldn't be set up|failed to start|exited|input closed|stdin (?:is )?closed|is not connected|session expired|needs (?:a sign-in|authentication)|refused the sign-in)\b` +@@ -59,5 +59,5 @@ export const HOST_FAULT_WHY: Readonly<Record<HostFault, string>> = {disk_full: "this server's disk is full",tool_server: "one of its tool servers is not running or not signed in",signed_out: "its AI is signed out",- bot_memory: "it used more memory than this server allows for one bot",+ bot_memory: "it used more memory than this computer allows for one bot",};diff --git a/server/idle-and-cap.test.ts b/server/idle-and-cap.test.tsindex 479611adbd..c21c72570d 100644--- a/server/idle-and-cap.test.ts+++ b/server/idle-and-cap.test.ts@@ -338,8 +338,8 @@ describe("a memory cap per bot", () => {emit({ threadId: "tb", turnId: "t", type: "runtime.error", message: "the process running this turn's AI ended" });emit({ threadId: "tb", turnId: "t", type: "turn.completed", ok: false, stopReason: "exit_before_result" });emit({ threadId: "ta", turnId: "t", type: "runtime.error", message: "something else" });- const line = "Researcher used more memory than this server allows for one bot (1700 MB of 1000 MB), so I stopped this task to keep the other bots running. "- + "Send the message again to start over; if it keeps happening, give this task less to do at once, or give the server more memory.";+ const line = "Researcher used more memory than this computer allows for one bot (1700 MB of 1000 MB), so I stopped this task to keep the other bots running. "+ + "Send the message again to start over; if it keeps happening, give this task less to do at once, or give this computer more memory.";expect(shown()).toEqual([line, "turn.completed", "something else"]);expect(seen[0]).toMatchObject({ text: { key: "chat.notice.botMemoryCap", params: { bot: "Researcher", used: "1700", cap: "1000" } } });// A fault a retry cannot fix: no automatic retry or Chief retry starts the bot into the same cap again.diff --git a/src/locales/en.json b/src/locales/en.jsonindex 0bd6ac40bf..3f1fee9cfc 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -10167,7 +10167,7 @@"native.home.bringUnavailable": "Your bots can't be brought together there now.","chat.notice.memoryReclaimedBrowser": "Ran out of room, so I closed the browser to keep everything else running.","chat.notice.memoryReclaimedTask": "Ran out of room, so I stopped this task to keep everything else running.",- "chat.notice.botMemoryCap": "{bot} used more memory than this server allows for one bot ({used} MB of {cap} MB), so I stopped this task to keep the other bots running. Send the message again to start over; if it keeps happening, give this task less to do at once, or give the server more memory.",+ "chat.notice.botMemoryCap": "{bot} used more memory than this computer allows for one bot ({used} MB of {cap} MB), so I stopped this task to keep the other bots running. Send the message again to start over; if it keeps happening, give this task less to do at once, or give this computer more memory.","chat.notice.memoryReclaimedBrowserDetail": "Ran out of room, so I closed the browser to keep everything else running. ({detail})","chat.notice.memoryReclaimedTaskDetail": "Ran out of room, so I stopped this task to keep everything else running. ({detail})","chat.notice.outOfProcesses": "There is no room to start another program ({code}), so this task could not run. Nothing was sent to the AI. It starts again by itself when there is room.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 12ee3ccb77..75bea4f200 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -10079,7 +10079,7 @@"native.home.bringUnavailable": "Não é possível reunir seus bots lá agora.","chat.notice.memoryReclaimedBrowser": "Faltou memória, então fechei o navegador para manter o restante funcionando.","chat.notice.memoryReclaimedTask": "Faltou memória, então interrompi esta tarefa para manter o restante funcionando.",- "chat.notice.botMemoryCap": "{bot} usou mais memória do que este servidor permite para um bot ({used} MB de {cap} MB), então interrompi esta tarefa para manter os outros bots funcionando. Envie a mensagem de novo para recomeçar; se continuar acontecendo, dê menos trabalho de uma vez a esta tarefa ou mais memória ao servidor.",+ "chat.notice.botMemoryCap": "{bot} usou mais memória do que este computador permite para um bot ({used} MB de {cap} MB), então interrompi esta tarefa para manter os outros bots funcionando. Envie a mensagem de novo para recomeçar; se continuar acontecendo, dê menos trabalho de uma vez a esta tarefa ou mais memória a este computador.","chat.notice.memoryReclaimedBrowserDetail": "Faltou memória, então fechei o navegador para manter o restante funcionando. ({detail})","chat.notice.memoryReclaimedTaskDetail": "Faltou memória, então interrompi esta tarefa para manter o restante funcionando. ({detail})","chat.notice.outOfProcesses": "Não há espaço para iniciar outro programa ({code}), então esta tarefa não pôde rodar. Nada foi enviado à IA. Ela começa de novo sozinha quando houver espaço.",