fix: harden consumer model slot resolution - #2785
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. |
Workflow source neededPR #2785 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. |
|
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:
📝 WalkthroughWalkthroughConfigured model slots now fail closed for invalid or unresolved configurations, benchmark confidence calculations clamp probabilities near their boundaries, GitHub Models errors provide specific guidance, and worker-attempt metadata is refreshed. ChangesModel selection and evaluation safeguards
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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 `@tests/tools/test_evaluate_model_benchmark.py`:
- Around line 108-112: Update test_near_one_confidence_level_has_finite_interval
to assert finiteness of the Wilson lower- and upper-bound metrics in each
result, rather than task_success_rate. Keep the near-one confidence-level setup
and benchmark evaluation unchanged.
🪄 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: a77bb2df-d80a-42a4-99de-4182dad0cd37
📒 Files selected for processing (7)
templates/consumer-repo/tools/llm_provider.pytemplates/consumer-repo/tools/llm_registry.pytests/tools/test_evaluate_model_benchmark.pytests/tools/test_llm_registry_selection.pytools/evaluate_model_benchmark.pytools/llm_provider.pytools/llm_registry.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a933c0738
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR hardens LLM model/slot resolution so consumer “slot allowlists” fail closed under invalid/unusable configurations, prevents empty placeholder models from short-circuiting provider selection, improves the GitHub Models “unavailable” error message, and keeps benchmark confidence bounds finite for extreme (but valid) confidence levels.
Changes:
- Treat malformed/unreadable slot config as an allowlist failure (fail closed) and stop substituting reviewed selections when an explicit legacy pin can’t be resolved.
- Skip empty slot models during
configured_model_for_providerresolution to avoid early short-circuits. - Clamp benchmark confidence math to avoid infinite inverse-CDF outputs near probability=1.0, and improve GitHub Models client error messaging.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/llm_registry.py | Tightens slot allowlist semantics and model pin handling for fail-closed resolution. |
| tools/llm_provider.py | Improves GitHub Models client-unavailable RuntimeError message. |
| tools/evaluate_model_benchmark.py | Clamps inverse-CDF probability to keep confidence bounds finite. |
| tests/tools/test_llm_registry_selection.py | Adds regression tests for invalid slot config and unresolved explicit pins failing closed. |
| tests/tools/test_evaluate_model_benchmark.py | Adds regression test for near-1.0 confidence levels producing finite metrics. |
| templates/consumer-repo/tools/llm_registry.py | Mirrors llm_registry allowlist hardening into the consumer template. |
| templates/consumer-repo/tools/llm_provider.py | Mirrors improved GitHub Models client-unavailable error message into the consumer template. |
Automated Status SummaryHead SHA: dbcd0e9
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 #2785. Do not edit. |
|
Runner dispatch state for codex on PR #2785. Do not edit. |
|
Autofix updated these files:
|
|
Addressed the remaining fail-closed review findings in 016a164: explicit invalid registries and malformed UTF-8 slot configs now fail closed in both source and consumer template; added direct resolve_slots coverage and removed the Ruff regressions. Validation: ruff plus 122 focused tests and validate_template_sync all pass. |
Summary
Validation
/opt/anaconda3/bin/python3.12 -m pytest tests/tools/test_llm_registry_selection.py tests/tools/test_llm_provider.py tests/tools/test_evaluate_model_benchmark.py tests/workflows/test_sync_manifest_delivery.py -q(119 passed)/opt/anaconda3/bin/python3.12 scripts/validate_template_sync.pygit diff --checkThis is source-first remediation for the active
sync/workflows-7a590071b52bconsumer review threads.Summary by CodeRabbit
Bug Fixes
Tests