Skip to content

fix(ai-red-teaming): rename errors.py helper to _errors.py to clear degraded-component warning - #144

Merged
rdheekonda merged 1 commit into
mainfrom
fix/airt-errors-helper-underscore
Sep 15, 2026
Merged

rdheekonda merged 1 commit into
mainfrom
fix/airt-errors-helper-underscore

Conversation

@rdheekonda

Copy link
Copy Markdown
Contributor

Summary

The ai-red-teaming capability shows a degraded component in the UI: "errors.py imported but defined no tools."

Root cause: tools/errors.py is a shared helper - it defines safe_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_tool tools. But capability.yaml globs the whole tools/ dir, so the loader's tool discovery scans errors.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_prefixed in packages/sdk/dreadnode/capabilities/loader.py), and the warning itself hints "rename shared helpers with a leading underscore."

Change

  • Rename tools/errors.py -> tools/_errors.py (git rename, 100% similarity).
  • Update the nine tool modules that load it by path (assessment, attacks, environments, goals, honeytoken, results, session, skills_manager, workflows) and the test.
  • Bump capability.yaml 1.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 passed
  • No remaining references to the old errors.py path (code, tests, or docs)

…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.
@rdheekonda
rdheekonda merged commit a8d2002 into main Sep 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant