Commit Graph

2 Commits

Author SHA1 Message Date
freemo abf250901f fix(tool): implement tool_type filter in ToolRegistry.list_tools()
CI / lint (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 51s
CI / security (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 53s
CI / unit_tests (pull_request) Failing after 2m4s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 17m4s
CI / integration_tests (pull_request) Successful in 23m32s
CI / coverage (pull_request) Failing after 2m7s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m42s
The tool_type parameter in ToolRegistry.list_tools() was explicitly
silenced with '_ = tool_type', making it a no-op. Both
'agents tool list --type validation' and 'agents tool list --type tool'
returned the full unfiltered tool list.

Changes:
- src/cleveragents/tool/runtime.py: Add tool_type: Literal['tool',
  'validation'] field to ToolSpec (default 'tool') so the registry
  has a discriminator to filter on.
- src/cleveragents/tool/registry.py: Remove '_ = tool_type' no-op and
  implement actual filter: specs = [s for s in specs if s.tool_type == tool_type].
  Update docstring to reflect the parameter is now active.
- features/consolidated_tool.feature: Add 7 comprehensive Behave
  scenarios covering all filter combinations (tool, validation, None,
  default type, exclusion).
- features/steps/tool_runtime_steps.py: Add step definition for
  registering a ToolSpec with an explicit tool_type.
- robot/helper_tool_cli.py: Add tool_list_type_tool() and
  tool_list_type_validation() helper functions that verify the CLI
  passes tool_type through to the service layer.
- robot/tool_cli.robot: Add two Robot test cases for
  'tool list --type tool' and 'tool list --type validation'.

The CLI handler (cli/commands/tool.py) and database repository
(infrastructure/database/repositories.py) already passed tool_type
through correctly — no changes needed there.

ISSUES CLOSED: #2974
2026-04-05 17:49:35 +00:00
freemo 46381750ab feat(cli): add tool and validation commands 2026-02-20 08:49:30 -05:00