feat(daemon): auto-spawn a Pi agent on startup (Operator Image OOTB) #137

Merged
clawdie merged 1 commit from autospawn-pi-on-boot into main 2026-06-21 18:12:54 +02:00
Owner

Workstream B of the next ISO rebuild plan: the live "Operator Image" should boot with at least one Pi instance live on the Colibri board, no operator action required.

On startup, after the control-plane socket is up, the daemon spawns one DeepSeek-backed Pi when configured. Host-spawn (no jail) — the live image is single-agent, so jails (and their overhead) stay for deployed multi-tenant hosts. The Pi inherits DEEPSEEK_API_KEY from the daemon env (sourced from provider.env by the rc.d service).

Behavior

  • Gated by COLIBRI_AUTOSPAWN_PI (YES/1/true/on); no-op otherwise.
  • Requires DEEPSEEK_API_KEY; logs + skips if absent (operator adds it via Join Hive → the daemon restart then spawns it).
  • Idempotent: skips if a Pi subprocess is already running, so the post-creds service colibri_daemon restart doesn't stack duplicates.
  • Pi binary + argv are env-tunable (COLIBRI_PI_BINARY default pi, COLIBRI_AUTOSPAWN_PI_ARGS default --mode json) so the exact Pi invocation can be finalized on the FreeBSD image without a rebuild.

Design note: reuses cmd_spawn_agent, so glasspane attach, stdout JSONL streaming, and board registration are identical to an operator-issued spawn — no duplicated spawn logic.

Verified: unit tests for the pure helpers (basename, env_truthy); full colibri-daemon suite green (83 + integration); clippy clean.

For Hermes on osa: the one thing that needs real-host confirmation is the default COLIBRI_AUTOSPAWN_PI_ARGS — i.e. the exact Pi CLI invocation that starts a persistent JSON-mode instance (vs a one-shot). The Rust side is correct and tunable via env; if --mode json alone exits immediately, set the right args in the ISO rc.conf (no recompile). The ISO-side rc.conf defaults (COLIBRI_AUTOSPAWN_PI=YES etc.) land in Workstream A/C.

🤖 Generated with Claude Code

**Workstream B** of the next ISO rebuild plan: the live "Operator Image" should boot with at least one Pi instance live on the Colibri board, no operator action required. On startup, after the control-plane socket is up, the daemon spawns one DeepSeek-backed Pi when configured. **Host-spawn (no jail)** — the live image is single-agent, so jails (and their overhead) stay for deployed multi-tenant hosts. The Pi inherits `DEEPSEEK_API_KEY` from the daemon env (sourced from `provider.env` by the rc.d service). **Behavior** - Gated by `COLIBRI_AUTOSPAWN_PI` (`YES`/`1`/`true`/`on`); no-op otherwise. - Requires `DEEPSEEK_API_KEY`; logs + skips if absent (operator adds it via Join Hive → the daemon restart then spawns it). - **Idempotent:** skips if a Pi subprocess is already running, so the post-creds `service colibri_daemon restart` doesn't stack duplicates. - Pi binary + argv are env-tunable (`COLIBRI_PI_BINARY` default `pi`, `COLIBRI_AUTOSPAWN_PI_ARGS` default `--mode json`) so the exact Pi invocation can be finalized on the FreeBSD image **without a rebuild**. **Design note:** reuses `cmd_spawn_agent`, so glasspane attach, stdout JSONL streaming, and board registration are identical to an operator-issued spawn — no duplicated spawn logic. **Verified:** unit tests for the pure helpers (`basename`, `env_truthy`); full `colibri-daemon` suite green (83 + integration); `clippy` clean. **For Hermes on osa:** the one thing that needs real-host confirmation is the default `COLIBRI_AUTOSPAWN_PI_ARGS` — i.e. the exact Pi CLI invocation that starts a *persistent* JSON-mode instance (vs a one-shot). The Rust side is correct and tunable via env; if `--mode json` alone exits immediately, set the right args in the ISO `rc.conf` (no recompile). The ISO-side `rc.conf` defaults (`COLIBRI_AUTOSPAWN_PI=YES` etc.) land in Workstream A/C. 🤖 Generated with Claude Code
clawdie added 1 commit 2026-06-21 18:12:29 +02:00
feat(daemon): auto-spawn a Pi agent on startup (Operator Image OOTB)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
76628eb847
Workstream B of the next ISO rebuild: the live image should boot with at
least one Pi instance live on the Colibri board without operator action.

On startup, after the control-plane socket is up, the daemon spawns one
DeepSeek-backed Pi when configured. Host-spawn (no jail) — the live image is
single-agent; jails remain for deployed multi-tenant hosts. The Pi inherits
DEEPSEEK_API_KEY from the daemon environment (sourced from provider.env by
the rc.d service).

- Gated by COLIBRI_AUTOSPAWN_PI (YES/1/true/on); no-op otherwise.
- Requires a DEEPSEEK_API_KEY; logs and skips if absent (operator adds it via
  Join Hive, then the daemon restart spawns it).
- Idempotent: skips if a Pi subprocess is already running, so the post-creds
  restart does not stack duplicates.
- Pi binary and argv are env-tunable (COLIBRI_PI_BINARY default `pi`,
  COLIBRI_AUTOSPAWN_PI_ARGS default `--mode json`) so the exact invocation can
  be finalized on the FreeBSD image without a rebuild.

Reuses cmd_spawn_agent so glasspane attach, stdout streaming, and board
registration are identical to an operator-issued spawn. Tests for the pure
helpers (basename, env_truthy); full daemon suite green; clippy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
clawdie merged commit 2cc613ea70 into main 2026-06-21 18:12:54 +02:00
clawdie deleted branch autospawn-pi-on-boot 2026-06-21 18:12:55 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#137
No description provided.