doctor --fix: nested-runtime panic + behind==0 short-circuit + stale-agent prune target #295
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#295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
colibri doctor --fix+colibri upgradeshipped in #294, but the fix-dispatchpath is never exercised by the gates, so two bugs merged green. Both defeat the
exact scenario the feature exists for (osa's stale-baked binary after the
v0.12.0 tag). Plus the originally-planned second dispatch target.
All in
crates/colibri-client/src/bin/colibri.rs.1. Nested-runtime panic (crash) — blocker
fix_fixableis sync and called from theasync fn runarm, but does:block_onfrom inside the#[tokio::main](multi-thread) runtime panics"Cannot start a runtime from within a runtime." So
doctor --fixaborts themoment it finds a fixable check to act on. The "nothing to fix" path never hits
it — which is why tests pass.
Fix: make
fix_fixableasyncand.await cmd_upgrade(false, true)directly; drop the nested
Runtime.2.
behind == 0short-circuit (logic) — blockercmd_upgradereturns "already at latest" when the source tree is at HEAD:But
binary_vs_git_versionfires when the binary is stale vs the source —orthogonal to the source being behind origin. That's osa right now: checkout
at HEAD (0 behind), installed binary still bakes
v0.11.0-383. So--fix→ "already at latest" → leaves the WARN. The git-behind gate conflates "source
behind origin" with "binary behind source."
Fix: for the
binary_vs_git_versioncase, force rebuild+swap regardless ofbehind-count (the binary, not the repo, is what's stale).
3. Minor (fold into the same PR)
is already overwritten — a bad build bricks the daemon.
cpcurrent binaryto
.bakbefore swap, restore on failed post-restart verify.@{u}vsorigin/mainmismatch.git_behind_countmeasuresHEAD..@{u}while the pull targets
origin/main. On a detached/non-main checkout thesediverge or
@{u}fails →None→0→ silent "already at latest." Pin bothto
origin/main.git fetch(one incmd_upgrade, two ingit_behind_count) — harmless noise.4. Planned: second
--fixdispatch target — stale-agent pruneOriginally deferred to after #292/#294. Give
doctor --fixa target beyondcolibri upgrade: prune store agents that have no live handle(
registration_linkageWARN — osa showed 17 stale). Eithercolibri agents prunewired into thefixableset, or a dedicated check withwith_fixable()whose fix is the prune. Mark the new checkfixable: trueso--fixdispatches to it the same waybinary_vs_git_version→colibri upgrade.Bugs 1 and 2 compound to make
doctor --fixnon-functional on first real use.The manual stop → cp → start flow still works in the meantime, so nothing is
operationally blocked.
Cross-host evidence for the stale-agent prune target.
registration_linkageWARN seen on both platforms after live runs: osa (FreeBSD) 17 stale, debby (Linux) 4 stale. Confirms the seconddoctor --fixdispatch target (colibri agents prune/ a fixable registration_linkage check) is worth building — it is the most-evidenced remaining item here.