Skip to content

fix: add missing settings fields required by action_classifier#93

Merged
Devnil434 merged 1 commit into
Devnil434:mainfrom
Ryzen-Starbit:fix/settings-missing-fields
May 20, 2026
Merged

fix: add missing settings fields required by action_classifier#93
Devnil434 merged 1 commit into
Devnil434:mainfrom
Ryzen-Starbit:fix/settings-missing-fields

Conversation

@Ryzen-Starbit
Copy link
Copy Markdown
Contributor

@Ryzen-Starbit Ryzen-Starbit commented May 19, 2026

Fixes #92

What this PR does:

Adds 5 missing fields to the Settings class in libs/config/settings.py that action_classifier.py reads at module level. Without these fields, importing action_classifier raises an AttributeError immediately, which also breaks pipeline.py via cascade import.

Fields added:

  • lingering_threshold_sec: float = 5.0
  • movement_threshold_px: float = 10.0
  • near_keypad_dist_px: float = 80.0
  • keypad_center_x: int = 320
  • keypad_center_y: int = 240

Defaults justified by:

  • lingering_threshold_sec: matches ActionHint docstring "dwell > 5s" and existing reasoning_dwell_threshold_seconds = 5.0 in settings.py
  • keypad_center_x/y: center of a standard 640x480 frame

Tested:

Verified that after this fix, importing action_classifier no longer raises AttributeError:
(venv) PS C:\Users\ankit\OneDrive\Desktop\work\Projects\New folder\Eagle> python -c "from libs.config.settings import settings; print(settings.lingering_threshold_sec)"
5.0

Summary by CodeRabbit

  • Chores
    • Updated configuration settings with new parameters for action detection, including thresholds for lingering detection, movement sensitivity, and keypad proximity settings.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5498d9fd-c1b3-481e-9cf0-621f8afee277

📥 Commits

Reviewing files that changed from the base of the PR and between 535615c and 80d617b.

📒 Files selected for processing (1)
  • libs/config/settings.py

📝 Walkthrough

Walkthrough

This PR adds five missing configuration fields to the Settings model in libs/config/settings.py to resolve import failures in action_classifier.py. The fields define action classification thresholds and keypad geometry with sensible defaults.

Changes

Action Classifier Configuration

Layer / File(s) Summary
Add action classifier configuration defaults
libs/config/settings.py
Settings class gains five new configuration fields: lingering_threshold_sec (float, default 5.0), movement_threshold_px (float, default 10.0), near_keypad_dist_px (float, default 80.0), keypad_center_x (int, default 320), and keypad_center_y (int, default 240). These fields resolve AttributeError crashes when action_classifier.py attempts to read them at module import time.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

Five thresholds and a keypad's heart,
Configuration fields set apart,
No more crashes on that import line—
The defaults make it work just fine! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding five missing Settings fields required by action_classifier module.
Linked Issues check ✅ Passed All five missing Settings fields from issue #92 were added with the exact proposed defaults, resolving the AttributeError import failure.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #92 requirements; only the five missing configuration fields were added to Settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Devnil434 Devnil434 merged commit 7329631 into Devnil434:main May 20, 2026
1 check passed
@Ryzen-Starbit
Copy link
Copy Markdown
Contributor Author

Hi @Devnil434, the CI failure on this PR is from pre-existing lint errors in services/memory/memory.py (undefined names
TrackEvent, TrackSequence ) that were present before my change. My fix only touched libs/config/settings.py.

Could you confirm if the gssoc:approved label needs to be added for scoring, or if the merge already counts?

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.

[Bug]: AttributeError: Settings object missing 5 fields required by action_classifier.py

2 participants