Skip to content

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

Merge pull request #5220 from leonongoing/leon/fix-acknowledged-model-holds-4875

milind-soni6117d842c62b
diff --cc server/drivers/acp/core.ts
index 5e35ad53b7,16092c4b88..68dc566092
--- a/server/drivers/acp/core.ts
+++ b/server/drivers/acp/core.ts
@@@ -1498,10 -1560,10 +1498,10 @@@ export function createAcpDriver(support
...base(threadId, turnId), type: "runtime.error",
...acpRuntimeFailure(e, support.displayName, accountError ? { message: support.describeAccountError?.(code, cliTurn.model), text: support.accountErrorText?.(code) } : undefined),
...(needsAuth ? { setup: true } : {}), ...((e as any)?.acpPromptStall === true ? { stalled: true } : {}),
- ...((e as any)?.acpUsageLimit === true || (code === "quota_or_region_restriction" && LIMIT_WORDS.test(message)) ? support.limitFacts?.(message, cliTurn.model) ?? { limit: "engine" as const } : {}), // waited out, or the engine gave up: another AI can carry on
+ ...((e as any)?.acpUsageLimit === true || (code === "quota_or_region_restriction" && LIMIT_WORDS.test(message)) ? modelControls.usageLimit((model) => support.limitFacts?.(message, model) ?? { limit: "engine" as const }) : {}), // waited out, or the engine gave up: another AI can carry on
});
// Never replay an accepted prompt (it may have run tools); evict before listeners start the next turn.
- if (!needsAuth && !accountError && ((e as any)?.acpPromptStall === true || (e as any)?.acpUsageLimit === true || (e as any)?.acpSessionFailure === true
+ if (signIn.is(e)) closeSession(threadId, "sign-in-required"); else if (!needsAuth && !accountError && ((e as any)?.acpPromptStall === true || (e as any)?.acpUsageLimit === true || (e as any)?.acpSessionFailure === true
|| code === "upstream_outage") && session.child.exitCode === null && !session.closing) {
closeSession(threadId, (e as any)?.acpPromptStall === true ? "prompt-stall" : "rpc-failure");
} else if (approvalUnconfirmed && session.child.exitCode === null && !session.closing) {