First-Run Wizard (Desktop Edition)
The desktop edition ships a dedicated first-run wizard that runs before the local stack exists. It is static HTML/CSS/JS bundled with the application and rendered by its own window, so it never depends on botserver, botui, Vault, PostgreSQL, OtterIO or the network.
Issues: #1586 (placement), #1587 (shell), #1588 (services), #1589 (provisioning), #1590 (privacy data map), #1591 (acceptance matrix).
Where it lives
| Piece | Path |
|---|---|
| Static page | botui/ui/wizard/index.html |
| Styles | botui/ui/wizard/wizard.css |
| Controller | botui/ui/wizard/modules/ (00_core β 70_init; wizard.js loader is gone) |
| Step rendering | botui/ui/wizard/wizard-steps.js |
| State and provider copy | botui/ui/wizard/wizard-state.js |
| Tauri bridge | botui/ui/wizard/wizard-bridge.js |
| Headless checks | botui/ui/wizard/selftest.html |
| Tauri backend | botapp/src/desktop/wizard/ |
| Provisioning mode | botserver/src/main_module/wizard_provision.rs |
The page is served at /wizard/index.html. In a packaged build it resolves
from the Tauri asset protocol; in development botui serves
botui/ui/wizard/ at /wizard.
Platform prerequisites
The packaged desktop edition is built for Linux x86_64 and Linux arm64 (preview), and, best effort, Windows x64 and macOS arm64. The host check is read-only and installs nothing:
| Platform | Check | Agent backend |
|---|---|---|
| Windows | .\PROD-DEPENDENCIES.ps1 -Check |
WSL2 distro (GBO_WSL_DISTRO, default Debian) with systemd and Incus |
| Linux | ./PROD-DEPENDENCIES.sh --check |
Incus on the host, user in the incus-admin group |
| macOS | ./PROD-DEPENDENCIES.sh --check |
Remote Incus (incus remote add) or a Linux VM; Incus cannot run containers natively on macOS |
On macOS the unsigned dmg is best effort. The wizard must mark the service
stack components (PostgreSQL, Valkey, OtterIO/oc, Qdrant, Vault, Zitadel and
llama.cpp) unavailable instead of failing provisioning, because they have no
darwin builds. BotModels has no darwin pythonbox yet, and the agent backend
needs remote Incus or a Linux VM. Gatekeeper blocks the unsigned app until the
user right-clicks -> Open or runs
xattr -dr com.apple.quarantine "/Applications/General Bots.app".
On Windows the payload includes installers/ for OtterIO + oc, Redis (cache),
Qdrant, Zitadel, Caddy and the Windows BotModels pythonbox
(botmodels-pythonbox-windows-x86_64.zip). The wizard downloads PostgreSQL,
Vault, llama.cpp and models once unless GB_DESKTOP_OFFLINE=1; with that flag
it names the missing file instead of attempting a network call. The AI media
service builds its virtual environment from the bundled win_amd64 wheelhouse on
first use, so vision/STT/TTS also work without network access.
PROD-DEPENDENCIES.ps1 -Check exits 0 when the desktop shell and agent mode
can run, 1 when the desktop shell cannot run (WebView2, VC++ 2015-2022 x64
runtime or libpq.dll missing), 2 when desktop Chat/Drive can run but agent
mode cannot (WSL2, distro, systemd, Incus or its storage pool missing), and 3
on another operating system. -Install prints the remediation commands and
performs no download or install.
The database component downloads the theseus-rs PostgreSQL 18 binaries. Their
bundled libstdc++ is built against Debian 12 and needs glibc 2.36; on an older
host C library (Ubuntu 22.04 ships 2.35) the dynamic loader aborts before
initdb runs. The tables post-install therefore probes initdb --version and,
only when the bundled copy fails, removes lib/libstdc++.so.6 so the host copy
is used. A missing pgdata is created before the wizard starts the database,
and a failed post-install step is reported with its command and stderr
instead of being counted as installed.
Before starting any bundled service, the wizard runs the matching check read-only
(wizard_host_check in botapp/src/desktop/wizard/hostcheck/) and renders
Desktop shell / Agent VM / Media tools readiness plus the exact remediation
command. Only a failing desktop-shell result disables Start setup and the
Next button. Agent and media gaps are generally optional and may expose
Continue anyway; on Windows, when agent-related setup is selected and the
agent backend/WSL2 prerequisites are not ready, the wizard blocks that agent
path (no Continue-anyway bypass for that case), shows remediation (for example
wsl --install -d Debian), and offers Skip ALL Agentic Work for a
Chat/Drive-only setup. A missing script, an unsupported platform or a timed-out
check never blocks setup.
On Windows, botagent executes a single binary name. It cannot read incus
from the Windows PATH, so agent mode also requires AGENT_INCUS_BIN to point
at a WSL wrapper (for example a script that runs
wsl -d <distro> -u root -- incus) or at a remote Incus client. botvibe
attempts to provision WSL2 and Incus itself
(crates/botvibe/src/vm_incus/windows.rs); the Windows check reports whether
systemd is actually enabled. botagent::agent_backend_unavailable() returns
the platform reason that /api/product should expose as
agent_backend_unavailable. The wiring point is get_product_config() in
botserver/src/main_module/routes/product_handlers.rs, next to the existing
compiled_features merge: under #[cfg(feature = "agent-vm")], set
value["agent_backend_unavailable"] = serde_json::json!(botagent::agent_backend_unavailable());.
Without that field, call the same function from the agent error path before
spawning Incus.
The BotModels pythonbox releases publish
botmodels-pythonbox-linux-x86_64.tar.gz and
botmodels-pythonbox-windows-x86_64.zip. On Linux arm64 and macOS,
vision/STT/TTS cannot be provisioned: there is no aarch64/darwin archive, so
the desktop-local package manager refuses the runtime download ("not found in
bundled installers"). Those features stay unavailable until that pythonbox
exists. /api/product always returns media_capabilities with
botmodels.available and the platform reason, and the wizard marks the AI media
service unavailable instead of trying to install (and failing or hanging on) an
archive that cannot run.
The Windows self-extracting payload bundles OtterIO + oc, Redis, Qdrant, Zitadel,
Caddy and the Windows pythonbox under installers/; PostgreSQL, Vault and
llama.cpp (when the local model is selected) are downloaded once on first run.
GB_DESKTOP_OFFLINE=1 refuses those downloads and names the missing archive.
The MSI/NSIS packages get the same installers/ resources from
botserver/botserver-installers.
An offline install that needs the malware gate must also stage the ClamAV 1.5.5
archives from [components.clamav] in 3rdparty.toml into that same cache:
clamav-1.5.5.linux.x86_64.deb or clamav-1.5.5.linux.aarch64.deb on Linux,
clamav-1.5.5.win.x64.zip on Windows. Each has a GitHub-verified SHA-256 pin
enforced by scripts/check_component_checksums.py. Without the matching archive
the packaged scanner is unavailable and malware scans fail closed; desktop-local
never falls back to a network download.
Detection
The wizard opens only when both are true:
- desktop mode β the
desktop-localfeature is compiled,GB_DESKTOP_MODE=1is set, orstack/.product.desktop-localexists; - first run β
stack/.initializedis absent.
There are no heuristics based on a slow API. A non-desktop build never opens the wizard.
Lifecycle
app start
ββ first run β wizard window (main window stays hidden)
β steps 1β4 collect choices
β step 5 shows the data map
β step 6 checks host prerequisites, then runs provisioning
β wizard spawns `botserver --provision-stack`
β vault β tables β cache β drive β vector_db β llm (if local)
β wizard starts the normal sidecar and waits for /api/product
β the Finish screen connects the Claude/ChatGPT choice from step 2 (optional)
β wizard stores OAuth clients through the API (if any)
β handoff: write stack/.initialized, show suite, close wizard
ββ otherwise β start sidecar and show the suite (previous behaviour)
Provisioning is idempotent: an installed and running component is reported
ready without being restarted. Progress is written to
stack/.wizard-progress.json after every component, so a crash resumes at the
first incomplete component. A failed component keeps the stack folder, names
the component and exposes Open log folder, Retry and Reset stack
(typed confirmation naming the exact folder).
Nothing is downloaded at runtime in the desktop edition. Missing bundled binaries produce a named error from the package manager instead of a download.
Privacy data map
Step 5 renders the data map from the draft configuration, not from static marketing copy:
| Data | Destination | Trigger |
|---|---|---|
| Conversations, generated files, database | the chosen workspace folder | always |
| API keys, OAuth tokens | the local vault in the stack folder | on save |
| Prompts and answers | the model chosen in step 2 β nothing when the bundled local model is selected | every message |
| Mail and files | connected providers, only for requested actions | per request |
| Shared links | this network, your own domain, or a free General Bots address β only when the recipient can reach the host | per link, until revoked or expired |
| Crash reports | nowhere unless the opt-in checkbox is on | opt-in |
Assistant model options
Step 2 offers five large cards. Claude Code and ChatGPT plan use the user's subscription and are connected on the Finish screen; the bundled local model (llama.cpp + DeepSeek-R1-Distill-Qwen-1.5B) is the only option that installs a local runtime. For low-memory machines, setup can skip that bundle entirely:
| Option | Key | Local bundle | Where prompts go |
|---|---|---|---|
| Claude Code | none (subscription) | not installed | the user's agent VM |
| ChatGPT plan | none (subscription) | not installed | the user's ChatGPT plan through the local loopback |
| Bundled local model | β | installed | nowhere (this machine) |
| Free hosted API | Kilo Code needs no key | not installed | the free gateway named in the card |
| My own provider key | required | not installed | the endpoint the user enters |
The free endpoints are third-party services governed by their own terms; the
wizard states that they have no SLA and should not receive confidential data.
The Test button calls the chosen endpoint before Next is enabled. The choice is
written to the stack's LLM secret (gbo/llm) during provisioning, so the
assistant uses it immediately.
Administrator credentials
The finish screen shows the administrator account created by setup (email and a
generated password) before the suite opens. Saving it writes
stack/conf/directory/admin-credentials.json with user-only permissions; the
password is never logged and is not persisted in the setup draft. The login
fallback reads that file from BOTSERVER_STACK_PATH as well as the process
working directory, so a packaged desktop install can sign in with the account
the wizard displayed.
AI accounts
Step 2 offers Claude Code and ChatGPT plan as large provider cards with their brand marks, alongside the local model, the free gateway and the own-key options. Selecting a subscription records the provider; the account is connected on the Finish screen, after the services are installed:
| Provider | Store | Login flow |
|---|---|---|
| Claude Code | the agent VM (/home/claude/.claude, 0700) |
claude setup-token runs under the claude user; the URL is shown in the wizard, and the pasted code is forwarded to the VM |
| ChatGPT plan | the local Vault (gbo/users/{user_id}/chatgpt-plan) |
loopback OAuth on 127.0.0.1:1455 (OPENAI_OAUTH_CLIENT_ID / OPENAI_OAUTH_REDIRECT) |
Connecting is optional and can be done later in Settings β AI accounts. When it succeeds, the wizard selects the provider as the bot's chat model.
Acceptance
botui/ui/wizard/selftest.html runs the real controller against the in-browser
bridge with the stack stopped and no network. It asserts:
- the wizard renders and the rail exposes seven steps with
aria-current; - copy names no operating system;
- step 2 blocks an own-key setup without a key and passes with the local model;
- workspace writability is reported;
- the redirect URI shown matches the backend callback;
- the data map reflects the selected model;
- provisioning reaches
readyand every component reportsready; - step 2 renders the Claude Code and ChatGPT plan cards with their logos;
- the finish step summarises the choices.
The matrix in #1591 (operating systems, offline, invalid keys, interruptions) is executed per release; the headless harness covers the deterministic scenarios on every build.