refactor: clear pi-era residue + make CI gate green (harness-neutral cleanup) #158

Merged
clawdie merged 1 commit from cleanup-pi-zot-residue into main 2026-06-24 00:36:29 +02:00
Owner

Broad sweep for stale naming/defaults left from the pi-only era (the same class as the pi_binary compile break that reached main). The compiler/clippy can't see most of this — it's names, defaults, and docs.

Fixes

  • Latent bug (#1): cmd_spawn_agent's non-local branch defaulted the binary to hermes-agent (doesn't exist) + hardcoded --mode json (invalid for zot) — reachable via colibri spawn-agent <provider> <model>. Now defaults to zot and derives argv from a single default_agent_args() helper shared with autospawn (kills the duplicated zot-vs-pi logic).
  • Stale wire field (#2): pi_session_idsession_id across glasspane / TUI / client / daemon (zot agents have session ids too). #[serde(alias = "pi_session_id")] keeps deserializing legacy/persisted snapshots.
  • Provenance (#3): record zot version alongside pi in RuntimeInventory (detect_zot_version()).
  • Comments (#4): harness-neutral the "Pi agent" / "hermes-agent" / COLIBRI_PI_BINARY leftovers.

The gate was red on main

Running scripts/ci-checks.sh surfaced that clippy -D warnings already failed on cmd_spawn_agent ("too many arguments 8/7") — independent of these changes. That means the CI gate was red and effectively unenforceable, which is part of why staleness crept in. Applied #[allow(clippy::too_many_arguments)] (matching the existing prepare_spawn_command). ci-checks.sh is now green (fmt, clippy -D warnings, tests, markdown).

Prevent recurrence (document-the-rule)

AGENTS.md now states that ci-checks.sh passing is mandatory before merge while no Forgejo Actions runner enforces ci.yml server-side.

Noted, not done

  • pi_type (sibling field next to pi_session_id in the same struct) is the same naming class — left out to keep this scoped to the approved pi_session_id rename. Easy follow-up.

Validation

./scripts/ci-checks.sh → green. Stacks on #157 (zot-rpc driver) and #156 (0.12 build fix); merge those first.

🤖 Generated with Claude Code

Broad sweep for stale naming/defaults left from the **pi-only era** (the same class as the `pi_binary` compile break that reached `main`). The compiler/clippy can't see most of this — it's names, defaults, and docs. ## Fixes - **Latent bug (#1):** `cmd_spawn_agent`'s non-local branch defaulted the binary to **`hermes-agent`** (doesn't exist) + hardcoded `--mode json` (invalid for zot) — reachable via `colibri spawn-agent <provider> <model>`. Now defaults to `zot` and derives argv from a single **`default_agent_args()`** helper shared with autospawn (kills the duplicated zot-vs-pi logic). - **Stale wire field (#2):** `pi_session_id` → `session_id` across glasspane / TUI / client / daemon (zot agents have session ids too). `#[serde(alias = "pi_session_id")]` keeps deserializing legacy/persisted snapshots. - **Provenance (#3):** record `zot` version alongside `pi` in `RuntimeInventory` (`detect_zot_version()`). - **Comments (#4):** harness-neutral the "Pi agent" / "hermes-agent" / `COLIBRI_PI_BINARY` leftovers. ## The gate was red on `main` Running `scripts/ci-checks.sh` surfaced that `clippy -D warnings` **already failed** on `cmd_spawn_agent` ("too many arguments 8/7") — independent of these changes. That means the CI gate was red and effectively unenforceable, which is part of *why* staleness crept in. Applied `#[allow(clippy::too_many_arguments)]` (matching the existing `prepare_spawn_command`). **`ci-checks.sh` is now green** (fmt, clippy -D warnings, tests, markdown). ## Prevent recurrence (document-the-rule) `AGENTS.md` now states that `ci-checks.sh` passing is **mandatory before merge** while no Forgejo Actions runner enforces `ci.yml` server-side. ## Noted, not done - `pi_type` (sibling field next to `pi_session_id` in the same struct) is the same naming class — left out to keep this scoped to the approved `pi_session_id` rename. Easy follow-up. ## Validation `./scripts/ci-checks.sh` → green. Stacks on **#157** (zot-rpc driver) and **#156** (0.12 build fix); merge those first. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clawdie added 3 commits 2026-06-23 18:05:12 +02:00
fix: colibri 0.12.0 build — stale pi_binary refs + Cargo.lock sync
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
a9d0aed89e
The harness-neutral rename (COLIBRI_AUTOSPAWN_PI → COLIBRI_AUTOSPAWN,
pi_binary → agent_binary) left two references to the old pi_binary name in
autospawn_agent_if_configured, so colibri-daemon failed to compile:

  error[E0425]: cannot find value `pi_binary` — socket.rs:449, 493

Rename both to agent_binary. Also refresh Cargo.lock: workspace members were
still pinned 0.11.0 while the manifests are 0.12.0, so --locked builds (used
for release staging) refused the tree.

Verified: full workspace builds clean and the entire test suite passes
(~230 tests, 0 failures); cargo metadata --locked is back in sync.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(daemon): zot-rpc spawn driver + binary-aware autospawn args (colibri#143)
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
0e9b16456b
The spawner spawned every agent with stdin(Stdio::null()) and read stdout
only, so it could only host self-driving emitters (pi --mode json). zot's
only structured persistent mode is `zot rpc`, which is a request/response
peer that blocks on stdin — so it could never autospawn. Worse, 0.12.0
defaulted COLIBRI_AUTOSPAWN_BINARY=zot while args defaulted to --mode json,
which is not a zot flag, so the OOTB image would spawn a broken/no agent.

Add a stdin RPC driver:
- AgentSpawnConfig.rpc_stdin: when set, the spawner pipes stdin and keeps the
  writer; otherwise stdin stays null (unchanged path for pi).
- cmd_spawn_agent auto-detects rpc mode from argv (`rpc`/`--rpc`).
- AgentHandle gains a cloneable RpcSender (Arc-backed) so prompts can be sent
  without holding the agent-registry lock across the async write.
  build_rpc_prompt emits zot's wire format: {"id","type":"prompt","message"}.
- Autospawn picks default argv per harness: zot -> `rpc`, pi -> `--mode json`
  (corrects the invalid --mode-json-for-zot default), and optionally sends a
  one-time bootstrap prompt when COLIBRI_AUTOSPAWN_RPC_PROMPT is set (default
  boot spends no tokens). Log strings de-pi-fied (autospawn-pi -> autospawn).

Tests: build_rpc_prompt framing + escaping, rpc_stdin default, sender presence
by mode. Full workspace: 250 tests, 0 failures. Live zot rpc smoke pending
(wire format matches docs/ZOT-RPC-TRANSCRIPT.md real-key capture).

Stacks on the 0.12.0 compile/lock fix (PR #156).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
refactor: clear pi-era residue from the harness-neutral agent path
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
06601a09c4
Sweep for stale naming/defaults left over from the pi-only era (the same
class of bug as the pi_binary compile break):

- socket.rs: non-local spawn defaulted the binary to `hermes-agent` (a binary
  that does not exist) and hardcoded `--mode json` (invalid for zot) — a
  reachable latent bug via `colibri spawn-agent <provider>`. Default to zot and
  derive argv from a single default_agent_args() helper, shared with autospawn
  (removes the duplicated zot-vs-pi arg logic).
- glasspane/tui/client/daemon: rename the stale wire field `pi_session_id` →
  `session_id` (zot agents have session ids too). `#[serde(alias =
  "pi_session_id")]` keeps deserializing legacy/persisted snapshots.
- contracts + runtime_inventory: record `zot` version alongside `pi` for
  complete agent provenance (detect_zot_version()).
- Harness-neutral stale comments ("Pi agent", "hermes-agent" example,
  COLIBRI_PI_BINARY in a test doc).
- cmd_spawn_agent: #[allow(clippy::too_many_arguments)] — this lint was already
  failing `clippy -D warnings`, i.e. the CI gate was red on main and thus
  unenforceable. The gate (scripts/ci-checks.sh) now passes green.
- AGENTS.md: document that ci-checks.sh passing is mandatory before merge while
  no Actions runner enforces .forgejo/workflows/ci.yml.

Validated: ./scripts/ci-checks.sh green (fmt, clippy -D warnings, tests, md).

Stacks on #157 (zot-rpc driver) and #156 (0.12 build fix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
clawdie merged commit 6f784008da into main 2026-06-24 00:36:29 +02:00
clawdie deleted branch cleanup-pi-zot-residue 2026-06-24 00:36:29 +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#158
No description provided.