Skip to content

Runaway guard ignores speed limits below 8 clicks per second #149

Closed

Description

@TMHSDigital

Summary

The runaway guard returns early until it has 8 samples, so a configured limit of 1 to 7 presses per second is effectively 7.

Where

  • autoclicker/core/click_engine.py:668-688 (_check_runaway_cps)
  • autoclicker/core/settings_manager.py:487-501
  • README.md:266, :330

Details

if len(ts) < 8: return False runs before len(ts) > self.max_cps_ceiling. Validation accepts ceilings from 1, and the README says the guard stops the run if more than N presses land in any one second.

Impact

Users who set a low ceiling as a safety net get a weaker guard than they configured.

Steps to reproduce

  1. Set the speed limit to 2, interval 0, burst 5 with 0 pause
  2. Start: the guard trips at the 8th press in a second, not the 3rd

Suggested fix

Use min(8, ceiling + 1) as the minimum sample count, or skip the floor when the ceiling is below 8. Add a unit test for ceiling 2.

Acceptance criteria

  • With ceiling 2, the third press inside one second trips the guard
  • Unit test covers ceilings below 8

Getting started

  • Relevant files: autoclicker/core/click_engine.py, tests/test_click_engine.py
  • How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 9968dc8. Severity: low. Effort: S. audit-key: bug|autoclicker/core/click_engine.py|ClickEngine._check_runaway_cps

Activity

  1. added
    bug
    good first issue
    priority: low
    safety
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuepriority: lowsafety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions