fix(node): reconcile stale node versions on daemon startup#56
Merged
jacderida merged 1 commit intoWithAutonomi:rc-2026.4.2from Apr 23, 2026
Merged
Conversation
Users who ran an older daemon through an auto-upgrade may have a registry with a stale `version` field: the on-disk binary was replaced but the previous daemon never refreshed the registry. On startup, before bringing the supervisor up, re-read each node's binary with `--version` and persist any differences. Missing binaries and transient `--version` failures are silently skipped so daemon startup never aborts on this pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mickvandijke
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #53. A daemon that ran through an auto-upgrade under an older
antversion left its node registry with staleversionfields — the on-disk binary had been swapped but the registry was never updated. #53 only writes the new version when the supervisor itself drives the restart, so users who were already in the broken state would still see the wrong version after upgrading to the fixed daemon.This PR adds a one-time reconciliation pass on daemon startup: for each registered node, re-read
<binary> --versionand persist any difference. Missing binaries and transient--versionfailures are silently skipped so daemon startup never aborts on this.Changes
ant-core/src/node/daemon/server.rsstart()takesmut registry: NodeRegistryand calls a newreconcile_registry_versionshelper before the supervisor comes up.reconcile_registry_versionsiterates the registry, runsextract_versionon each binary, updates and saves on drift. Errors and missing binaries are skipped.#[cfg(all(test, unix))], using a shell-script fake binary via tempdir): stale version gets updated and persisted; matching version is left alone; missing binary is skipped without panicking.ant-cli/src/commands/node/status.rsVersioncolumn header width (:<10→:<18) with the value rows so the table stays straight once versions like0.10.11-rc.1orcurrent → pendingappear. Divider width bumped from 44 to 52 chars to match.Test plan
cargo test --package ant-core --lib -- --test-threads=1— 144 pass (includes the 3 new reconciliation tests)cargo clippy --all-targets --all-features -- -D warnings— cleancargo fmt --all -- --check— cleanManual smoke test on the local machine (registry containing 6 nodes, some upgraded by the old daemon without the registry being updated):
Before this change, nodes 1–3 and 6 would have continued to report
0.10.1from the registry even though the on-disk binary had already been swapped to0.10.11-rc.1.🤖 Generated with Claude Code