Download the missing CLIs of agent providers on a hosted server at start

A hosted server got a download only for an outdated system CLI. A pool
machine or a restored server has no CLI, so each provider that an agent
uses showed that its CLI was not downloaded. Now the server also
downloads the CLI of each provider that an agent uses, is not off and
has no CLI. This lets the pool and boat archives leave the provider
runtimes out.
This commit is contained in:
NB😈
2026-11-20 09:36:48 +01:00
parent d5597bc8dc
commit 7985a6c71b
3 changed files with 22 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
### Changed
- A hosted server downloads, at start, the CLI of each provider that its agents use when the CLI is
missing. Before, the provider showed that its CLI was not downloaded, and the user had to download
it.
+6 -4
View File
@@ -1196,8 +1196,9 @@ server got the machine in that moment.
A machine of the pool is not the boat image:
- It has no agent CLI for all users (`claude`, `codex`, `pi`) and no `node`. A provider shows that
its CLI is not downloaded, and the user downloads it in OpenBot.
- It has no agent CLI for all users (`claude`, `codex`, `pi`) and no `node`. At start, a hosted
server downloads the CLI of each provider that an agent uses and that is not off. The user
downloads the CLI of another provider in OpenBot.
- It has no Docker and no boat desktop. OpenBot uses its own virtual displays.
- It shows the storage of a moved server (25, 75 and 150 GB), which is more than the plan table of
the pricing page.
@@ -1464,8 +1465,9 @@ The VPS is not the same machine as the sandbox:
- The boat image has commands that npm installed for all users (`claude`, `codex` and `pnpm` on
2026-11-11). The VPS has none. The move copies the agent CLIs that the customer signed in to, and
`import` names each other one that is missing. A provider that used a missing command shows that
its CLI is not downloaded, and the user downloads it in OpenBot.
`import` names each other one that is missing. At start, a hosted server downloads the CLI of each
provider that an agent uses and that is not off. The user downloads the CLI of another provider in
OpenBot.
- `prepare` makes only the primary group of `user`, and the VPS has no Docker. `import` names each
group that `user` had in the sandbox (`docker` and `ascii-streaming-audio` on 2026-11-11). An
agent of the customer that used Docker does not have it after the move.
+11 -5
View File
@@ -9,6 +9,7 @@ import { isManagedRuntimeProvider, type ManagedProviderId } from "@openbot/contr
import { leadingAddress } from "@openbot/contracts/chat-tag-references";
import { selfHostedApiOrigin } from "@openbot/contracts/invite-links";
import type {
AgentProviderStatus,
AgentStatus,
AppVariant,
BrowserDisplayState,
@@ -2479,20 +2480,25 @@ export async function createApplicationServices({
libraryFolders.reconcileFiles(new Set(mailbox.listStoredFiles().map((stored) => stored.attachment.id))),
);
const replacedOutdatedSystemClis = new Set<ManagedProviderId>();
const hostedCliDownloads = new Set<ManagedProviderId>();
const hasNoCli = (provider: AgentProviderStatus) =>
(provider.state === "not-installed" || provider.state === "error") &&
provider.cliSource === undefined &&
provider.version === null;
const trackSystemCliVersions = (status: AgentStatus): void => {
let copyInUse = false;
const agentProviders = hostedServer === null ? null : new Set(service.listAgents().map((agent) => agent.provider));
for (const provider of status.providers ?? []) {
if (!isManagedRuntimeProvider(provider.id)) continue;
const version = provider.cliSource === "system" ? (provider.version ?? null) : null;
if (providerRuntimes.setSystemVersion(provider.id, version, provider.cliIncomplete === true)) copyInUse = true;
if (
hostedServer !== null &&
provider.state === "outdated" &&
!replacedOutdatedSystemClis.has(provider.id) &&
agentProviders !== null &&
(provider.state === "outdated" || (hasNoCli(provider) && agentProviders.has(provider.id))) &&
!hostedCliDownloads.has(provider.id) &&
!providerUse.off().includes(provider.id)
) {
replacedOutdatedSystemClis.add(provider.id);
hostedCliDownloads.add(provider.id);
Effect.runFork(providerRuntimes.download(provider.id).pipe(Effect.ignore));
}
}