feat(update): auto-upgrade bsk when daemon finds a newer version - #77
Merged
Conversation
The daemon's periodic update check now installs a newer release instead of only refreshing the hint cache: it reuses the update.rs install path (download, sha256 verify, extract, replace), skips the round while any agent session is live, and otherwise restarts itself into the new binary (spawns a detached replacement that waits for the old pid, then exits). On by default; BSK_AUTO_UPDATE=off keeps the old cache/hint-only behaviour. Windows can only stage the replacement, so it just logs that a restart is needed. The CLI hint wording reflects the switch.
BB-fat
force-pushed
the
feat/auto-update
branch
from
August 12, 2026 06:49
e01e1eb to
668a472
Compare
This was referenced Aug 12, 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.
mainthen.Motivation
#76 fixed the passive update check so hints actually fire. This PR goes one step further per maintainer decision: instead of only hinting, the daemon upgrades bsk automatically when it finds a newer release.
Behaviour
bsk updateinstall path, no duplicated logic.SessionRegistrythe idle-exit logic uses), the round is postponed and retried on the next tick — automation is never killed mid-task. The session check is deliberately read after the fetch and before the replace to minimise the TOCTOU window.BSK_AUTO_UPDATE=off(case-insensitive, trimmed) restores the fix(update): run periodic update check in daemon so hints actually fire #76 hint-only behaviour. Same convention asBSK_REQUEST_HELP.bsk update"); the manualbsk updatecommand is unchanged.Tests
bsk status; withBSK_AUTO_UPDATE=offonly the cache was written and the binary was untouched.cargo fmt --check,clippy -p bsk-protocol -p bsk --all-targets -D warnings: clean.cargo test -p bsk --lib: 226 passed; the single failure is the pre-existing, environment-dependentsync_continues_on_partial_error(fails identically on cleanmain).