fix(ai-red-teaming): rename errors.py helper to _errors.py to clear degraded-component warning - #144
Merged
Merged
Conversation
…egraded-component warning tools/errors.py is a shared helper (safe_tool, fmt_asr) that defines no tools, so the capability loader's tool discovery flagged it as "imported but defined no tools" and surfaced it as a degraded component in the UI. Per the loader's own convention (_is_support_module / leading-underscore), rename it to _errors.py so it is treated as a support module and skipped by tool discovery. Update the nine tool modules and the test that load it by path. No functional change.
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.
Summary
The
ai-red-teamingcapability shows a degraded component in the UI: "errors.py imported but defined no tools."Root cause:
tools/errors.pyis a shared helper - it definessafe_tool,fmt_asr, and error-formatting utilities that the other tool modules import by path (spec_from_file_location(parent / "errors.py")). It intentionally exports no@tool/@safe_tooltools. Butcapability.yamlglobs the wholetools/dir, so the loader's tool discovery scanserrors.py, finds zero tools, and records a degraded-component health entry.The loader already has the intended mechanism for this: modules with a leading underscore are treated as support modules (
_is_support_module/_is_underscore_prefixedinpackages/sdk/dreadnode/capabilities/loader.py), and the warning itself hints "rename shared helpers with a leading underscore."Change
tools/errors.py->tools/_errors.py(git rename, 100% similarity).assessment,attacks,environments,goals,honeytoken,results,session,skills_manager,workflows) and the test.capability.yaml1.16.0->1.16.1.No functional change - same helper, same imports, just an underscore so tool discovery skips it.
Test plan
pytest tests/test_errors_safe_tool.py- 19 passederrors.pypath (code, tests, or docs)