Skip to content

fix(python): align skills discovery and catalog ownership - #6546

Closed
jabrailkhalil wants to merge 6 commits into
genkit-ai:mainfrom
jabrailkhalil:jabrailkhalil/skills-python-parity
Closed

jabrailkhalil wants to merge 6 commits into
genkit-ai:mainfrom
jabrailkhalil:jabrailkhalil/skills-python-parity

Conversation

@jabrailkhalil

@jabrailkhalil jabrailkhalil commented Oct 3, 2026 •

Copy link
Copy Markdown

I align Python skill discovery and catalog ownership with the existing activation-tool contract: Skills() scans .agents/skills before skills, later directories win duplicate names, and explicit skill_paths replace the defaults. I name use_skill in the catalog, record skillsActivationTool, refresh same-owner/legacy catalogs and preserve foreign catalogs.

This addresses the discovery/catalog portions of #6510 as the Python counterpart to #6544. I also test the existing recoverable unknown-name response.

I merged main 8ee17216 into 706e7378. Upstream removed Tool.action(), so I updated the response assertions to call the tool through its public API. The net diff remains the skills handler, tests and README.

Current-head Linux validation checks out 706e73783cff93913ef18d3e8409098f32fe1410:

  • Full Python suites: 3.10 7,020 passed; 3.11 7,021; 3.12/3.13 7,022 each; 3.14 7,027. Each also has 5 passing subtests and 39–46 existing skips. Clean main on 3.12 passes 7,004, with 5 subtests and 44 skips.
  • Package Ruff lint/format, scoped Ty, wheel/sdist builds and Twine checks pass on all five versions. Lock and generated-typing checks pass. I checked the captured Ty exit codes: all are zero on both the candidate and baseline.
  • On Python 3.12, restoring only the main skills handler produces exactly 13 expected assertion failures, with no errors. Restoring the patch passes all 26 skills tests. I keep negative-control coverage separate; the unchanged 78% project threshold passes.

The first current-main run caught the obsolete test API call; the linked run includes its correction. Live-provider tests retain their existing skips. I have not repeated the updated wheel checks on Windows or exercised live providers; upstream CI authorization and review are still required.

@github-actions github-actions Bot added docs Improvements or additions to documentation python Python labels Oct 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the skill discovery mechanism to scan both .agents/skills and skills directories by default, and introduces a metadata key (skillsActivationTool) to track the activation tool associated with injected prompts. It also adds comprehensive unit tests for these features. The feedback suggests simplifying redundant dictionary type checks on the metadata variable in _skills.py to improve code readability.

@jabrailkhalil

Copy link
Copy Markdown
Author

Resolved the conflict with current main in 3f3221e. The merge preserves main's new Tool-handle API and description while keeping catalog ownership/discovery behavior. The unknown-name regression now executes through the handle's Action; expected output is unchanged.

All 26 skills tests pass. With these same tests and clean current-main packages, 13 fail as expected. Full middleware validation is 95 passed / 1 failed on the PR versus 77 passed / the same 1 failed on main: an existing Windows path-separator assertion. Changed-file Ty, package Ruff and formatting pass; wheel/sdist build. Package-wide Ty's one fallback/ActionKind diagnostic also reproduces on main. No unrelated failures or dependency versions were patched.

Could a maintainer review the integration head and approve the upstream workflows? The description distinguishes fresh Windows evidence from earlier Linux validation.

@MichaelDoyle

Copy link
Copy Markdown
Contributor

Hi @jabrailkhalil — heads up that Genkit Python SDK development has moved to https://github.com/genkit-ai/genkit-python! Could you re-open this PR over there (file paths map 1:1 after stripping the leading py/ prefix; note genkit-ai/genkit-python#52 also updated _skills.py recently), and link/close this PR once moved? cc @huangjeff5

@jabrailkhalil

Copy link
Copy Markdown
Author

Thanks, Michael. I moved this to genkit-ai/genkit-python#166 and kept the discovery behavior from #52 in the new repo. Closing this copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants