Skip to content

fix(skills): stop repeat auto-downloads (parse + stale guard)#69

Merged
eddietejeda merged 1 commit into
mainfrom
fix/skill-autoupdate-loop
Apr 29, 2026
Merged

fix(skills): stop repeat auto-downloads (parse + stale guard)#69
eddietejeda merged 1 commit into
mainfrom
fix/skill-autoupdate-loop

Conversation

@eddietejeda
Copy link
Copy Markdown
Contributor

Summary

  • Bug: parse_version_from_skill_md used ? on strip_prefix("version:") inside a loop, so the first frontmatter line (name:) returned None from the whole parser → read_installed_version() was always None → auto-update thought refresh was always needed → downloaded on every command.
  • Fix: Only treat lines that actually start with version:; accept UTF-8 BOM, ---\\r\\n, and optional v on the version string.
  • Stale tarball: If download + extract still leaves skills not matching the CLI (e.g. released skills.tar.gz lags the binary), write ~/.hotdata/skills/.skill_auto_update_suppressed_for_cli for this CLI version and skip further auto-download spam; clear on successful sync or when running hotdata skills install / install --project.

Test plan

  • cargo test (includes new parse tests)
  • Manual: cargo run sandbox twice — should not download twice when skills already match.

…l guard)

- Fix parse_version_from_skill_md: CRLF/BOM opening lines, optional v prefix, and do not use ? on non-version lines (was returning None on first line).
- After auto-update download, if skills still do not match CLI, suppress further auto attempts for this CLI version until skills install or CLI changes.
- Clear suppression when synced or when running skills install.
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 48.00000% with 39 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/skill.rs 48.00% 39 Missing ⚠️

📢 Thoughts on this report? Let us know!

@eddietejeda eddietejeda merged commit f2713b4 into main Apr 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant