feat(client): colibri prune-agents + doctor --fix stale-agent prune #303
No reviewers
Labels
No labels
doctor-fix
first-proof blocker
hardening
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
clawdie/colibri!303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat-agents-prune"
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?
Implements the stale-agent prune from #295 — the second
doctor --fixdispatch target, alongsidebinary_vs_git_version → upgrade.What a stale agent is
registration_linkage(doctor.rs) flags store agents whose name has no live handle instate.agents— DB rows left behind when an agent process exits/crashes/restarts. They accumulate (osa 17, debby 4) and were previously unfixable without hand-editing SQLite.Changes
delete_agent(id): idempotentDELETE FROM agents(returns false for absent ids).PruneAgentsRPC: recomputes stale exactly like the doctor check (store agents not in the live handle map), deletes them, returns{ pruned, agents: [{id, name}] }. Live agents are never touched.colibri prune-agentscommand +DaemonClient::prune_agents.registration_linkageWARN is now.with_fixable()with acolibri prune-agentshint.registration_linkage → prune_agents(auto-prune in--fix, per the chosen design).Safety
Auto-prune only ever removes rows with no live handle, so it can never drop a running agent. (The narrow register-before-handle race was the reason the grace-window option existed; we chose plain auto-prune — a just-registered agent without a handle yet is the same race the check itself already reports.)
Gates
cargo fmt --all --checkclean;cargo clippy --workspace --all-targets -- -D warningscleantest_delete_agent_is_idempotentCloses the prune item in #295.
🤖 Generated with Claude Code
Gives doctor --fix its second dispatch target (after binary_vs_git_version → upgrade): registration_linkage WARN now self-heals by pruning stale agent registrations — store rows whose name has no live handle (osa 17, debby 4). - ledger: delete_agent(id) — idempotent DELETE FROM agents - daemon: PruneAgents RPC — recomputes stale exactly like the doctor check (store agents not in the live handle map), deletes them, returns {pruned, agents}; live agents are never touched - client: colibri prune-agents command + DaemonClient::prune_agents - doctor: registration_linkage WARN now .with_fixable() + hint - fix_fixable: dispatches registration_linkage → prune_agents, alongside the existing binary_vs_git_version → upgrade Closes the prune item in #295. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Closing as superseded by #304, which shipped the same stale-agent prune (parallel implementation, already merged to main). No unique content here — main already has
colibri agents prune+ the doctor --fix dispatch.Pull request closed