Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
docs(limits): describe #6146's rule: a usage limit carries on only with a chosen backup, otherwise the bot waits
milind-sonic654261ec7c8
diff --git a/docs/routine-schedules.md b/docs/routine-schedules.mdindex 19bec3b70a..715a85449c 100644--- a/docs/routine-schedules.md+++ b/docs/routine-schedules.md@@ -264,7 +264,7 @@ use an appropriate event/webhook workflow instead of a fake weekly schedule.starts again; the same run, never a copy.- Its bot or conversation was busy when it started: it waits there,checking every 30 s, for up to an hour.- - A usage limit with another AI that can carry on, or a signed-out AI with a+ - A usage limit with a chosen backup AI that can carry on, or a signed-out AI with abackup AI of the bot's own (or the app-wide one while Automatic recovery ison): the run starts again on that AI after a short wait (see "When an engine runs out" and "When an engine is signedout" in self-hosting.md), and the owner hears once that the bot is using it.diff --git a/docs/self-hosting.md b/docs/self-hosting.mdindex cefe068b24..42848ad38e 100644--- a/docs/self-hosting.md+++ b/docs/self-hosting.md@@ -1125,14 +1125,16 @@ current month to date.When a turn ends on a usage limit (a subscription's 5-hour or weekly limit,one model's own weekly window, a model's extra usage credits), the bot carries-on by itself with another AI the person has set up until that limit resets,-and the person hears it once for that stretch of the limit, as a notification:-"Codex reached its limit until 14:00, so Kai is using Claude meanwhile." With-no AI to carry on, it says the bot waits instead. Nobody is asked.+on by itself with a backup the person chose until that limit resets, and the+person hears it once for that stretch of the limit, as a notification: "Codex+reached its limit until 14:00, so Kai is using Claude meanwhile." With no+chosen backup that can carry on, the bot waits for the reset and the+notification says so ("…no backup you chose can take over"); no other AI is+picked for it. Nobody is asked.- **Which AI.** For one model's own limit, the same AI's default model first;- then the backups chosen for the bot or in Automatic recovery; then the AI a- new bot would get. Only an AI that can run a turn now (installed, signed in,+ then the backups chosen for the bot or in Automatic recovery, in that order.+ Only an AI that can run a turn now (installed, signed in,allowed by your organisation, not limited itself) with the tools and theworking folder the current one has, and one the conversation's approval levelcan move to without asking (Auto-accept edits stays on an AI that has it).diff --git a/server/drivers/acp/quiet-status.ts b/server/drivers/acp/quiet-status.tsindex 2d3488ebae..f7d72c9246 100644--- a/server/drivers/acp/quiet-status.ts+++ b/server/drivers/acp/quiet-status.ts@@ -314,7 +314,7 @@ export function sampleProcessTree(pid: number, since?: number): Promise<ProcessSexport const LIMIT_WORDS = /\b429\b|rate.?limit|too many requests|usage limit|quota|GoUsageLimitError|FreeUsageLimitError|insufficient_quota|credits? (?:exhausted|used up)|out of credits/i;/** How long an engine may stay quiet after a model request failed on a limit before the turn is ended as a usage limit,- * so the bot carries on with another AI: longer than any retry an engine makes without a provider's retry-after+ * so a backup the person chose carries on (or the bot waits for the reset): longer than any retry an engine makes without a provider's retry-after* (OMB_ACP_LIMIT_QUIET_MS overrides). */export const DEFAULT_LIMIT_QUIET_MS = 2 * 60_000;export const limitQuietMs = (): number => knob("OMB_ACP_LIMIT_QUIET_MS", DEFAULT_LIMIT_QUIET_MS);diff --git a/server/quota-switch.ts b/server/quota-switch.tsindex 3820e8444b..2c9c64d657 100644--- a/server/quota-switch.ts+++ b/server/quota-switch.ts@@ -78,8 +78,8 @@ export function turnLimitScope(event: SettledTurn, flags: { limit?: TakeoverScop: flags?.limit ?? (event.stopReason !== "tool_error" && classifyError({ text: cause ?? "" }).reason === "quota" ? "engine" : undefined);}-/** On unless OMB_QUOTA_SWITCH=0: a limited AI's work carries on with another AI by itself. Off, only the backups- * Automatic recovery names take over, as before. */+/** On unless OMB_QUOTA_SWITCH=0: a limited AI's work carries on by itself with a backup the person chose (the bot's own,+ * then Automatic recovery's); with none usable the bot waits for the reset. Off, only Automatic recovery's backups take over. */export function quotaSwitchEnabled(env: NodeJS.ProcessEnv = process.env): boolean {return env.OMB_QUOTA_SWITCH?.trim() !== "0";}