Conversation
`up_to_date` means the on-disk SKILL.md matched the copy bundled in the running binary, so on an old CLI `doctor` reports a stale skill as current. A 0.2.1 install kept a SKILL.md documenting a --full-page flag its own CLI did not support, and doctor still printed "agent skill up to date". That is worse than a wording nit because doctor is the first command an agent runs, and an agent told its instructions are current will follow them. When the check would report plain ok, it now consults the update cache and warns instead if a newer bsk is already known, naming both versions. Keeps the check name: CheckResult derives Serialize and `name` is part of `bsk doctor --json`, so renaming it would break consumers matching on it. Warns rather than fails, because the skill really is synced correctly for the installed build. Adds no network call — cached_newer_version reuses the same read-only, offline cache that print_update_hint_from_cache reads, and keeps its freshness rule, so a missing or stale cache stays quiet instead of claiming the skill is stale when it cannot tell.
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.
Fixes #266.
The report is that
bsk doctorprintsok agent skill up to datewhile theinstalled
SKILL.mdis actually stale. Readingsync_installed_skills, thecheck isn't lying about what it measured —
up_to_datemeans the on-diskSKILL.mdmatched the copy bundled in the running binary. It's just that"up to date" is a claim about the world, and what was verified is a claim about
one build. On an old CLI those two come apart, and the reporter's case is a good
illustration: 0.2.1 bundled a 9,562-byte skill, main had 15,126, and the
installed skill documented a
--full-pageflag that their own CLI didn'tsupport. Doctor said everything was fine.
That matters more than a normal wording nit because
doctoris the first thingan agent runs, and an agent that's told its instructions are current will go
ahead and follow them.
What I changed: when the check would previously report plain
ok, it nowconsults the update cache, and if a newer
bskis already known it returns awarning that names both versions and points at
bsk update.A few things I deliberately didn't do.
I wanted to rename the check to something like "agent skill matches this bsk
build", which says what's actually compared. I didn't, because
CheckResultderives
Serializeandnamegoes out inbsk doctor --json, so anythingmatching on that string would break. The comments around
okvsstatusandthe
navariant made it pretty clear this file treats its JSON shape as acontract, so I left the name alone and changed the verdict instead.
I used
warnrather thanfail, because the skill genuinely is syncedcorrectly for the binary that's installed — nothing is broken, it's just older
than the user probably assumes.
warnalso keepsok: true, so this can't flipanyone's exit code.
I didn't add a network call.
print_update_hint_from_cachealready reads~/.bsk/update-check.jsonread-only and offline, with the daemon as the onlywriter, so I reused that path via a small
cached_newer_versionhelper. Itkeeps the existing freshness rule, which I think is the right default here: a
missing or stale cache reads as "don't know", and doctor stays quiet rather than
claiming the skill is stale when it can't tell.
And this doesn't compare anything against upstream
main— it only tells youyour CLI is behind, which is the actual root cause of a stale bundled skill. The
version-stamping idea in the issue would go further, but that's a bigger change
and I'd rather not fold it into this one.
The one thing I'm unsure about is the wording of the detail line. It currently
reads
...; matches the skill bundled with bsk X, but bsk Y is available, whichis accurate but long next to the other checks. Happy to shorten it if you'd
prefer.
Tests: three added in
doctor.rs— that both previously-okshapes (updatedand
up_to_date) warn when a newer version is known, thatNonestill reportsokwith no hint, and that a newer version doesn't downgrade a sync failure outof
fail. The existingskill_check_from_reportcallers passNone; I madethe newer version a parameter rather than reading the cache inside, so the tests
stay off the filesystem.
Verified with the commands CI runs:
cargo fmt --all -- --checkandcargo clippy --workspace --all-targets --locked -- -D warningsare bothclean, and
cargo test --workspace --locked --no-fail-fastgoes from 708passed / 1 failed to 711 passed / 1 failed — the three new tests, and the same
single failure before and after.
That one failure is
skill_install::sync::tests::sync_continues_on_partial_errorand it's my environment, not your tree: it chmods a directory to
r-xto forcea write error, and I'm running as root, which ignores the permission bits, so
the write succeeds and Codex ends up in
updated. It fails the same way on aclean checkout with my change stashed. Worth knowing if anyone else ever runs
the suite in a container as root.