refactor: clear pi-era residue + make CI gate green (harness-neutral cleanup) #158
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "cleanup-pi-zot-residue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Broad sweep for stale naming/defaults left from the pi-only era (the same class as the
pi_binarycompile break that reachedmain). The compiler/clippy can't see most of this — it's names, defaults, and docs.Fixes
cmd_spawn_agent's non-local branch defaulted the binary tohermes-agent(doesn't exist) + hardcoded--mode json(invalid for zot) — reachable viacolibri spawn-agent <provider> <model>. Now defaults tozotand derives argv from a singledefault_agent_args()helper shared with autospawn (kills the duplicated zot-vs-pi logic).pi_session_id→session_idacross glasspane / TUI / client / daemon (zot agents have session ids too).#[serde(alias = "pi_session_id")]keeps deserializing legacy/persisted snapshots.zotversion alongsidepiinRuntimeInventory(detect_zot_version()).COLIBRI_PI_BINARYleftovers.The gate was red on
mainRunning
scripts/ci-checks.shsurfaced thatclippy -D warningsalready failed oncmd_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 existingprepare_spawn_command).ci-checks.shis now green (fmt, clippy -D warnings, tests, markdown).Prevent recurrence (document-the-rule)
AGENTS.mdnow states thatci-checks.shpassing is mandatory before merge while no Forgejo Actions runner enforcesci.ymlserver-side.Noted, not done
pi_type(sibling field next topi_session_idin the same struct) is the same naming class — left out to keep this scoped to the approvedpi_session_idrename. 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
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>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>