Repository navigation
fix(s07, s15): skip unreadable skill manifests during startup scan - #671
Open
shuhuNB515 wants to merge 1 commit into
Open
shuhuNB515 wants to merge 1 commit into
shuhuNB515 wants to merge 1 commit into
Conversation
SkillLoader.scan and scan_skills call read_text directly while walking skills/*/SKILL.md at import time. One bad manifest (invalid UTF-8, unreadable permissions/race with a removed file) aborts module import, so the whole agent cannot start and no skill is catalogued. Skip such files with a warning, as the store loaders in other chapters already do for corrupt entries. Keep the s07 README code block in all three languages and the generated web snapshots in sync. Disclosed AI assistance: found during an AI-assisted review.
This branch has not been deployed
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 #669
Problem
SkillLoader.scan()(s07) andscan_skills()(s15) read everyskills/*/SKILL.mdat import time without error handling. A single manifest with invalid UTF-8 bytes, or anOSErrorfrom permissions/a race with a removed file, raised out of module import: neither agent could start and none of the otherwise valid skills were catalogued.Fix
Wrap only the
read_text()call intry/except (OSError, UnicodeError), print a short warning and skip that manifest. Applied to both implementations. Updated the s07scan()code block in all three READMEs (en/zh/ja) and regenerated the embedded copies inweb/src/data/generated/docs.jsonandversions.json; verified each snapshot matches its source byte-for-byte.Verification (real modules)
SKILL.mdUnicodeDecodeErrorpython3 -m pytest tests -q: 503 passed, 118 subtests passed.Disclosed AI assistance: found and fixed during an AI-assisted review; failures were reproduced against both real modules before and after the change.