fix: preserve model registry checker package import - #2809
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe model registry freshness checker now resolves the repository root before importing ChangesModel registry and worker metadata
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Workflow source neededPR #2809 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely. Please do one of:
Once a valid source is present, this warning will not be reposted. |
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 `@tools/check_model_registry_freshness.py`:
- Around line 18-25: Add a subprocess-level regression test for directly
executing tools/check_model_registry_freshness.py through its supported CLI,
verifying it completes successfully and can import DEFAULT_SELECTION_PROFILE
from tools.llm_registry. Keep the test focused on the standalone execution path
so future import changes cannot reintroduce the failure.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 35fb682b-5606-4dba-9ce7-c2bd5ef76a40
📒 Files selected for processing (1)
tools/check_model_registry_freshness.py
| _REPO_ROOT = Path(__file__).resolve().parent.parent | ||
|
|
||
| # Direct execution puts tools/, rather than the repository root, on sys.path. | ||
| # Always import through the package so type checking sees one symbol definition. | ||
| if str(_REPO_ROOT) not in sys.path: | ||
| sys.path.insert(0, str(_REPO_ROOT)) | ||
|
|
||
| from tools.llm_registry import DEFAULT_SELECTION_PROFILE |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add a direct-execution regression test.
This change alters the script’s import behavior, but no test exercises running tools/check_model_registry_freshness.py as a standalone script. Add a subprocess-level test using the supported CLI so a future import refactor cannot reintroduce the direct-execution failure.
As per path instructions: “Prioritize correctness, error handling, and test coverage. Flag new or changed behavior with no accompanying test.”
🤖 Prompt for 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.
In `@tools/check_model_registry_freshness.py` around lines 18 - 25, Add a
subprocess-level regression test for directly executing
tools/check_model_registry_freshness.py through its supported CLI, verifying it
completes successfully and can import DEFAULT_SELECTION_PROFILE from
tools.llm_registry. Keep the test focused on the standalone execution path so
future import changes cannot reintroduce the failure.
Source: Path instructions
Automated Status SummaryHead SHA: bdabd23
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
|
Runner dispatch state for autofix on PR #2809. Do not edit. |
Fixes the synced checker\u0027s direct-execution import path without defining
DEFAULT_SELECTION_PROFILEtwice for mypy.\n\nValidation:python -m pytest tests/test_check_model_registry_freshness.py -q;python -m mypy tools/check_model_registry_freshness.py.Summary by CodeRabbit