@mock_only
Feature: Fast sleep patch — type-safe implementation
  As a CleverAgents developer
  I want _install_fast_sleep_patch() to cap sleep durations without type suppressions
  So that Pyright strict mode passes and test execution remains fast

  # These scenarios verify the observable behaviour of _install_fast_sleep_patch()
  # after the # type: ignore suppressions were replaced with type-safe setattr()
  # calls and local typed variables (issue #9993).

  Scenario: time.sleep is capped at the 10ms maximum
    When I call time.sleep with 5.0 seconds
    Then the call should complete in under 500ms

  Scenario: time._original_sleep is accessible for tests that need real delays
    Then time._original_sleep should be a callable

  Scenario: asyncio._original_sleep is accessible for tests that need real delays
    Then asyncio._original_sleep should be a callable

  Scenario: _install_fast_sleep_patch is idempotent when called multiple times
    When I call _install_fast_sleep_patch a second time
    Then time._original_sleep should remain the same callable after the second call
