Skip to content

Conversation

@mikejgray
Copy link
Collaborator

@mikejgray mikejgray commented Oct 5, 2025

Summary by CodeRabbit

  • Refactor

    • Improved intent evaluation performance with caching and early-exit matching, resulting in faster repeated queries and more responsive results. Confidence handling remains consistent.
  • Chores

    • Updated CI to test on newer Python versions and upgraded action versions for reliability.
    • Added a comprehensive .gitignore for Python projects to reduce noise from build artifacts, caches, and IDE files.

@github-actions github-actions bot added the fix label Oct 5, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 5, 2025

Warning

Rate limit exceeded

@mikejgray has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 3 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1747098 and 332e835.

📒 Files selected for processing (2)
  • .gitignore (1 hunks)
  • padacioso/__init__.py (15 hunks)

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “fix: padacioso speed” succinctly and accurately highlights the primary change—improving the performance of the padacioso module—using concise, clear phrasing that a teammate scanning the history would immediately understand.

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.

@github-actions github-actions bot added fix and removed fix labels Oct 5, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
padacioso/__init__.py (1)

280-280: Unnecessary cache invalidation in context/keyword operations.

exclude_keywords, exclude_context, unexclude_context, require_context, and unrequire_context all mark _cache_dirty = True, but the cache (_intent_list) only contains data from intent_samples. Context and keyword operations don't modify intent_samples, so cache invalidation is unnecessary here.

Remove cache invalidation from these methods (lines 280, 292, 297, 309, 314):

 def exclude_keywords(self, intent_name, samples):
     if intent_name not in self.excluded_keywords:
         self.excluded_keywords[intent_name] = samples
     else:
         self.excluded_keywords[intent_name] += samples
-    self._cache_dirty = True  # Mark cache as needing rebuild

Apply similar changes to exclude_context (line 292), unexclude_context (line 297), require_context (line 309), and unrequire_context (line 314).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2d1daf and 1747098.

📒 Files selected for processing (3)
  • .github/workflows/unit_tests.yml (1 hunks)
  • .gitignore (1 hunks)
  • padacioso/__init__.py (7 hunks)
🔇 Additional comments (4)
.github/workflows/unit_tests.yml (1)

16-23: LGTM! CI workflow updates are appropriate.

The Python version matrix update (3.9-3.13) and GitHub Actions version bumps (checkout v4, setup-python v5) are sensible modernization changes.

padacioso/__init__.py (3)

39-41: LGTM! Cache initialization is well-designed.

The lazy cache pattern with _intent_list and _cache_dirty flag is a sound optimization to avoid repeated list construction on every query.


98-98: LGTM! Cache invalidation on intent removal is correct.

Marking the cache dirty when an intent is removed ensures the cached list stays synchronized with intent_samples.


124-131: LGTM! Cache rebuild implementation is straightforward.

The lazy rebuild approach (only rebuilding when dirty) avoids O(n²) overhead during bulk intent registration.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@JarbasAl JarbasAl merged commit 2b49785 into OpenVoiceOS:dev Oct 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants