// PART 06
Background services
botserver is not alone inside its own process: a set of background loops keeps Drive, git sources and counters fresh. Knowing their cadences explains most “why hasn’t it picked up my change” questions.
Drive monitors
botserver/src/main_module/drive_monitors/ runs two kinds of loops:
- Full discovery scan — every cycle performs a full ListBuckets plus a
walk (and
drive_filesupsert) of every.gborgbucket. The cadence is 30 seconds by default (DRIVE_SCAN_INTERVAL), deliberately slower than the early 5 s loop which saturated a core on busy instances; on errors it backs off, up to 300 seconds. This loop is what registers brand-new buckets and orgs. - Per-bot monitors — watch each bot’s objects on their own cadence and
reload
config.csvon ETag change (~10 seconds). Never restart botserver for aconfig.csvedit; the monitor picks it up.
Git monitor (git-owned bots)
For bots backed by an ALM repository, .gbdialog/ and .gbot/ come from the
bot’s repo, pulled by git_bot_monitor every 15 seconds by default
(GB_VIBE_GIT_MONITOR_SECS overrides) and materialized into
work/{branch}.gborg/{branch}.gbai/{bot}.gbdialog|{bot}.gbot/. A change made
straight in Drive is out-of-band and gets archived to
{bucket}/archive/{bot}-{stamp}/. The monitor logs its start
([git_monitor] started (interval {secs}s) — bot sources come from git, not Drive).
Installer-managed components worth knowing
| Component | Behavior | Source |
|---|---|---|
timeseries_db |
runs the upstream influxd binary, storing under {{DATA_PATH}}/timeseries (engine/, influxd.bolt); HTTP API 8086, RPC 8083; INFLUXD_ENGINE_PATH/INFLUXD_BOLT_PATH point at the paths |
installer_regs/register_databases.rs::register_timeseries_db |
observability |
depends on timeseries_db, runs vector with {{CONF_PATH}}/monitoring/vector.toml, health on 8686 |
installer_regs/register_observability.rs::register_observability |
host |
host preparation via Incus only: incus admin init, incus storage, incus profile device, and a socket proxy (unix:/var/lib/incus/unix.socket → unix:/tmp/incus.sock in containers) |
installer_regs/register_observability.rs::register_host |
remote_desktop |
Xvfb + XRDP + XFCE, RDP on 3389; the former remote_terminal key was renamed with no alias |
installer_regs/register_workspace.rs::register_remote_desktop |
devtools was a no-op placeholder and is no longer registered, so it does not
appear in botserver install or component listings.
What runs where — quick table
| Loop | Cadence | Override | What it does |
|---|---|---|---|
| Drive discovery scan | 30 s | DRIVE_SCAN_INTERVAL |
registers new buckets/orgs/bots |
| Per-bot drive monitor | ~10 s on ETag change | — | reloads config.csv, scripts, KB |
| Git monitor | 15 s | GB_VIBE_GIT_MONITOR_SECS |
pulls bot sources from ALM repos |
| Ops metrics flusher | 30 s | — | writes ops_request_metrics, deploy markers |
| Trash purge | hourly job | GB_TRASH_PURGE_SECS |
Drive trash retention |
| Terminal audit purge | 90-day retention | GB_TERMINAL_AUDIT_PURGE_SECS |
computer-use audit records |
Operational guidance
- After uploading a brand-new
.gborgbucket, expect registration on the next discovery pass (≤ 30 s) — not instantly. - A bot that “ignores” an edited prompt is usually a git-owned bot whose change went to Drive instead of the repo; check the archive pass.
- Restarting botserver does not lose counters: the ops middleware rewrites deploy markers at boot, so the Traffic panel shows the restart.