Conversation
The Collective Wisdom revert removed include_editorial from _find_all_skills but left it on the api_server handler. The TypeError was swallowed by a broad except and returned 500, and the existing test mocked the finder so it never saw the kwargs. GET /v1/skills now calls _find_all_skills(skip_disabled=False) only. A regression test hits the real finder instead of a MagicMock.
|
Verified this exact change in production on v0.21.3 (HEAD 2cfb655): applied _sort_skills(_find_all_skills(skip_disabled=False)), restarted the gateway, GET /v1/skills → 200 with 18 skills (previously 500 with TypeError). Downstream it unblocks job creation for a client that gates on /v1/skills. Same one-line change we patched locally, so +1 from a real deployment. |
Open
12 of 19 tasks
15 tasks done
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.
What does this PR do?
GET /v1/skillsalways returned HTTP 500. The Collective Wisdom revert removedinclude_editorialfrom_find_all_skillsbut left it on the api_server handler, and a broadexcept Exceptionturned the TypeError into a generic 500. The existing test mocked the finder with a kwargs-blind MagicMock, so the mismatch never showed up.This drops the leftover kwarg and adds a regression test that calls the real finder.
Related Issue
Fixes #108967
Type of Change
Changes Made
gateway/platforms/api_server.py:_handle_skillscalls_find_all_skills(skip_disabled=False)only.tests/gateway/test_api_server.py:test_skills_enumerates_real_catalogplants a skill under the isolatedHERMES_HOMEand hitsGET /v1/skillswithout mocking the finder.How to Test
scripts/run_tests.sh tests/gateway/test_api_server.py -k TestSkillsEndpoint -qassert 500 == 200andTypeError: _find_all_skills() got an unexpected keyword argument 'include_editorial'.Ran on Windows 11:
TestSkillsEndpoint2 passed. The fulltest_api_server.pyfile had 119 passed and 1 failed (test_security_headers_present). That failure rewrites CSP toinjections.adguard.organd is unrelated local AdGuard injection, not this change.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
N/A