Repository navigation
fix(skills): accept a skill.md manifest in GCS skill directories - #7843
Open
adityasingh2400 wants to merge 1 commit into
Open
adityasingh2400 wants to merge 1 commit into
adityasingh2400 wants to merge 1 commit into
Conversation
The local directory and zip loaders accept SKILL.md or skill.md, but _list_skills_in_gcs_dir and _load_skill_from_gcs_dir only looked for SKILL.md, so a skill that loads locally vanished from the listing and failed to load once stored in a bucket. Look up the manifest under both names, in the same order the other loaders use. Fixes google#7842
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
The local directory loader (
_parse_skill_md,_list_skills_in_dir) and the zip loader accept a skill manifest namedSKILL.mdorskill.md._list_skills_in_gcs_dirand_load_skill_from_gcs_dironly looked forSKILL.md. A skill that loads fine locally therefore disappeared from the GCS listing, and loading it raisedFileNotFoundErroronce it was stored in a bucket. The async wrappers delegate to these two functions, so they had the same gap.Solution:
Add
_find_gcs_skill_manifest, which checksSKILL.mdand thenskill.md(the order the other loaders use), and use it in both GCS functions. WhenSKILL.mdexists it is the only blob looked up, exactly as before. The not-found error is unchanged.Testing Plan
Unit Tests:
Added to
tests/unittests/skills/test__utils.py, with the same mockedgoogle.cloud.storageclient the existing GCS tests use:test__list_skills_in_gcs_dir_accepts_lowercase_manifesttest__load_skill_from_gcs_dir_accepts_lowercase_manifest: also asserts thatSKILL.mdis tried first.pre-commit runpasses on the changed files, andmypyreports no issues inskills/_utils.py.Manual End-to-End (E2E) Tests:
I don't have a GCS bucket for a live run. The tests drive both GCS functions through the mocked storage client and check which blobs are looked up.
Checklist
Additional context
#7760 changes
_list_skills_in_dirin the same file. This PR only touches the GCS functions, which are further down, so the two don't conflict.