@tdd @di @tool_registry
Feature: DI container resolution for _get_tool_registry_service
  As a developer maintaining the CleverAgents codebase
  I want _get_tool_registry_service to use the DI container directly
  So that service wiring is consistent and not duplicated manually

  Background:
    Given a tdd di tool registry test runner

  # TDD: This scenario should FAIL before the fix is applied.
  # After the fix, _get_tool_registry_service must call
  # container.tool_registry_service() instead of manually constructing
  # the service with create_engine / sessionmaker / repositories.
  Scenario: _get_tool_registry_service delegates to container.tool_registry_service
    Given the DI container has a tool_registry_service provider
    When _get_tool_registry_service is called with the mocked container
    Then the returned service should be the one from container.tool_registry_service
    And no manual engine or sessionmaker construction should have occurred

  Scenario: ToolRegistryService is registered in the DI container
    Given the application DI container is initialised
    When the tool_registry_service provider is accessed on the container
    Then the container should expose a tool_registry_service provider
