Skip to content

fix(skill): retry registry fetches and tolerate blocked backup cleanup - #185

Merged
duck-bubi-ya merged 1 commit into
mainfrom
fix/skill-init-issue
Sep 1, 2026
Merged

fix(skill): retry registry fetches and tolerate blocked backup cleanup#185
duck-bubi-ya merged 1 commit into
mainfrom
fix/skill-init-issue

Conversation

@gujieye

@gujieye gujieye commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes two issues in bl skill init:

  1. Index fetch has a 10s timeout and no retry
    • INDEX_TIMEOUT_MS raised from 10s to 30s; fetchSkillsIndex / downloadSkillAsset now go through withRetry (3 attempts by default; network/timeout/5xx/404 errors are retried)
    • Added an optional attempts parameter so the silent advisor background channel passes 1 and stays fail-fast, without stalling bl advisor recommend
  2. Upgrading a large skill is misreported as a failed install by host safe-delete guards
    • The old bailian-docs-llm-wiki has 1583 files. After atomicSwap completes, deleting the .old-* backup trips the host guard (">500 files deleted per turn requires confirmation"), and the error bubbles up: an install that already succeeded is reported as failed and the lock entry is never updated
    • Backup deletion after a successful swap is now best-effort (try/catch): when the guard blocks it, the install still succeeds. Leftover .old-* dirs are inert (status scans already ignore them). The duplicated logic in postinstall.js is fixed the same way
    • Also made temp-dir cleanup best-effort so cleanup failures no longer mask the real error

Test plan

  • 5 new cases in skills-installer.test.ts: guard-blocked backup deletion still installs, cleanup failure does not mask the original error, index fetch retries then succeeds, attempts=1 disables retries, asset download retries transient HTTP errors; existing 404 case now asserts the 3 retries are exhausted
  • vp check passes (0 errors)
  • skill e2e 12/12 passed (including add/list/remove lifecycle against the real registry)

Known issues

advisor-sync (1 case) and skills-agents (8 cases) fail on this machine — pre-existing environment issues (/etc/codex and other real agent dirs on this host break detection expectations), reproduced on unmodified code, unrelated to this change.

- bl skill init: raise index timeout 10s→30s and retry transient network
  failures (3 attempts); advisor sync silent channel stays fail-fast
- make post-swap backup deletion best-effort so host safe-delete guards
  cannot fail a completed install (postinstall.js mirror included)
- add unit coverage for guard-blocked cleanup and registry retry policy
@duck-bubi-ya
duck-bubi-ya merged commit b5dec92 into main Sep 1, 2026
2 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.

2 participants