🧪 eliminate sys.path.insert hacks — migrate to package-relative imports#270
🧪 eliminate sys.path.insert hacks — migrate to package-relative imports#270sheepdestroyer wants to merge 3 commits into
Conversation
Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Sorry @sheepdestroyer, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe change removes startup ChangesPackage import cleanup
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request cleans up the codebase by removing dynamic sys.path modifications across several benchmark and verification scripts. It also updates the import of circuit_breaker in router/main.py. Feedback suggests using an explicit relative import instead of an absolute import in router/main.py to align with PEP 8 standards for package-relative imports.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/benchmark_classifier.py`:
- Around line 3-10: Update the chat_helpers import in benchmark_classifier.py so
it remains runnable when invoked directly as python
scripts/benchmark_classifier.py, using a sibling-import fallback that preserves
module execution compatibility, or explicitly switch to and document module
execution instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dab2f421-32e7-49f6-914e-5364c9c10697
📒 Files selected for processing (11)
router/__init__.pyrouter/main.pyscripts/benchmark_classifier.pyscripts/benchmark_tokens.pyscripts/classify_direct.pyscripts/reclassify_all.pyscripts/retry_errors.pyscripts/verification/verification_helpers.pyscripts/verification/verify_breaker.pyscripts/verification/verify_canonical_endpoints.pyscripts/verification/verify_ollama_routing.py
💤 Files with no reviewable changes (7)
- scripts/verification/verify_canonical_endpoints.py
- scripts/verification/verify_breaker.py
- scripts/reclassify_all.py
- scripts/verification/verify_ollama_routing.py
- scripts/retry_errors.py
- scripts/verification/verification_helpers.py
- scripts/benchmark_tokens.py
- Revert 'from .circuit_breaker' to 'from router.circuit_breaker' in main.py: relative imports break when main.py is imported directly as 'main' (tests use 'from main import ...' with PYTHONPATH=.:router) - Add try/except ImportError fallback to 'from scripts.chat_helpers' across all 7 scripts (4 in scripts/, 3 in verification/) so they remain runnable via both package import and direct execution
|
Closing in favor of a fresh PR with all review fixes applied: reverted Gemini false-positive relative import (was breaking CI) and added ImportError fallbacks to all chat_helpers imports. See #271. |
🎯 What: This PR removes vestigial sys.path.insert hacks from 9 scripts in the scripts/ directory, migrating them to use standard package-relative imports. This cleanup follows the addition of init.py files in PR #264/#265 and ensures a cleaner, more robust import structure. It also adds a missing init.py to the router/ directory and updates router/main.py to use package-aware imports.
Fixes #266
PR created automatically by Jules for task 565508234636993796 started by @sheepdestroyer
Summary by CodeRabbit