Skip to content

fix(api_server): drop nonexistent include_editorial kwarg from GET /v1/skills - #117048

Closed
chrisworksai wants to merge 1 commit into
NousResearch:mainfrom
chrisworksai:fix/api-server-skills-typeerror
Closed

chrisworksai wants to merge 1 commit into
NousResearch:mainfrom
chrisworksai:fix/api-server-skills-typeerror

Conversation

@chrisworksai

Copy link
Copy Markdown

What does this PR do?

Fixes a hard HTTP 500 on GET /v1/skills. _handle_skills passed include_editorial=True to _find_all_skills, which only accepts skip_disabled:

  • Call site: gateway/platforms/api_server.py:2710
  • Definition: tools/skills_tool.py:183 — def _find_all_skills(*, skip_disabled: bool = False)
TypeError: _find_all_skills() got an unexpected keyword argument 'include_editorial'

The broad except Exception in the handler swallowed the TypeError and rewrote it as a generic "Failed to enumerate skills" 500, so every api_server client saw an empty skills list with no useful error. The Hermes Browser Extension's SKILLS panel is permanently empty as a result.

Why drop the argument rather than add the parameter: include_editorial appears nowhere else in the tree (git grep finds only that one line), and git log -S include_editorial -- tools/skills_tool.py is empty, so the keyword was never a parameter of _find_all_skills. There is no behavior to preserve. The four other callers (hermes_cli/banner.py, skills_config.py, skills_hub.py, web_server.py) all pass only skip_disabled. Implementing an include_editorial feature here would be inventing one.

Related Issue

Fixes #117046

Related: #108967 reports the same 500, with open PRs #108968 / #113058 / #115681. Happy to close this in favor of whichever the maintainers prefer — this one additionally hardens the test that let the bug ship.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • gateway/platforms/api_server.py — _handle_skills now calls _find_all_skills(skip_disabled=False); removed the include_editorial=True keyword.
  • tests/gateway/test_api_server.py — TestSkillsEndpoint::test_skills_returns_list_envelope now patches with autospec=True. The existing plain MagicMock accepted any keyword, so the test stayed green while the live route answered 500. With autospec=True the mock enforces the real signature and the test fails on unpatched main.

How to Test

  1. Reproduce on main:
    $ python -c "from tools.skills_tool import _find_all_skills; _find_all_skills(skip_disabled=False, include_editorial=True)"
    TypeError: _find_all_skills() got an unexpected keyword argument 'include_editorial'
  2. Confirm the hardened test is a real regression test — with the test change applied but the source fix reverted:
    $ python -m pytest tests/gateway/test_api_server.py::TestSkillsEndpoint -q
    TypeError: got an unexpected keyword argument 'include_editorial'
    FAILED tests/gateway/test_api_server.py::TestSkillsEndpoint::test_skills_returns_list_envelope
    1 failed in 1.20s
  3. With the full fix applied:
    $ python -m pytest tests/gateway/test_api_server.py -q
    125 passed in 11.79s
  4. Real call through the fixed path, unmocked:
    $ python -c "from tools.skills_tool import _find_all_skills, _sort_skills; s=_sort_skills(_find_all_skills(skip_disabled=False)); print(len(s), [x['name'] for x in s[:3]])"
    52 ['claude-code', 'codex', 'computer-use']

Checklist

Code

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) — N/A, no platform-specific code
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

…1/skills

_handle_skills passed include_editorial=True to _find_all_skills, which only
accepts skip_disabled. Every request raised TypeError, was swallowed by the
broad except Exception, and returned HTTP 500 with an empty skills list for
all API-server clients.

The existing endpoint test patched _find_all_skills with a kwargs-blind
MagicMock, so it accepted the bogus keyword and stayed green. Patch with
autospec=True so the mock enforces the real signature.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery tool/skills Skills system (list, view, manage) duplicate This issue or pull request already exists labels Sep 20, 2026
@chrisworksai

Copy link
Copy Markdown
Author

Closing as a duplicate. #108967 already tracks this with three independent reproductions, and #108968 / #113058 / #115681 are open against it — a fourth fix is noise.

One correction I owe this thread before closing: the issue I opened alongside this PR claimed include_editorial never existed on _find_all_skills. That was wrong, produced from a shallow clone with truncated history. Full history shows @Adolanium's original account in #108967 was correct — added in a6ee31f (Collective Wisdom V1, #94266), removed in 0dcadf6 (the revert), while the call site kept passing it. Apologies for the noise.

The one piece here that may still be worth salvaging is the test approach; I've left it as a note on #108967 rather than pressing this PR.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET /v1/skills always returns HTTP 500: _handle_skills passes nonexistent include_editorial kwarg to _find_all_skills (0.21.3)

2 participants