Skip to content

fix(llm): run model evaluation pilot as a module - #2766

Merged
stranske merged 3 commits into
mainfrom
codex/2740-pilot-import-fix
Jul 13, 2026
Merged

fix(llm): run model evaluation pilot as a module#2766
stranske merged 3 commits into
mainfrom
codex/2740-pilot-import-fix

Conversation

@stranske

@stranske stranske commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Follow-up to #2740 and failed pilot run #29220735966.

The workflow invoked tools/run_model_eval_pilot.py as a file, which placed tools/ rather than the repository root on sys.path and caused ModuleNotFoundError: scripts. This changes the command to python -m tools.run_model_eval_pilot, adds a workflow contract test, and makes the always-run summary/upload steps report a missing result artifact without masking the root execution failure.

Validation:

  • 3 passed for the workflow contract and pilot runner tests
  • workflow YAML validation passed
  • Ruff, Black, and diff checks passed

Summary by CodeRabbit

  • Bug Fixes

    • Improved model evaluation pilot workflow handling when results are not produced.
    • Workflow summaries now clearly indicate when a pilot run finishes without generating results.
    • Missing result artifacts now emit a warning instead of failing the workflow.
  • Tests

    • Added coverage to ensure the pilot runs as an importable module and validates the missing-results shell guard and artifact warning configuration.

Copilot AI review requested due to automatic review settings July 13, 2026 03:03
@stranske
stranske temporarily deployed to agent-high-privilege July 13, 2026 03:04 — with GitHub Actions Inactive
@stranske-keepalive

Copy link
Copy Markdown
Contributor

Workflow source needed

PR #2766 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:

  • Add <!-- meta:issue:123 --> or a normal Closes #123 / Related to #123 line.
  • Check one Workflow Source option in the PR body.
  • Add a hidden marker such as <!-- workflow-source:local_request -->, <!-- workflow-source:manual_remote -->, <!-- workflow-source:review_followup -->, <!-- workflow-source:sync_campaign -->, or <!-- workflow-source:dependabot -->.
  • Add a workflow source label such as workflow:source-direct-pr, workflow:source-local-request, workflow:source-review-followup, workflow:source-sync, or workflow:no-automation.

Once a valid source is present, this warning will not be reposted.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 51 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b79302c8-8dc3-4a31-9cce-a5dbfd5bdeb8

📥 Commits

Reviewing files that changed from the base of the PR and between ee079f1 and eea2529.

📒 Files selected for processing (1)
  • tests/workflows/test_model_eval_pilot_workflow.py
📝 Walkthrough

Walkthrough

The model evaluation pilot workflow now invokes its module form, handles missing result artifacts without failing summary or upload steps, and adds a test asserting these workflow settings.

Changes

Model evaluation pilot

Layer / File(s) Summary
Pilot execution and artifact handling
.github/workflows/maint-78-model-evaluation-pilot.yml
The pilot runs with python -m tools.run_model_eval_pilot; missing pilot-results.json produces a step-summary message, and artifact upload warns instead of failing.
Workflow configuration validation
tests/workflows/test_model_eval_pilot_workflow.py
The new test verifies module invocation, missing-result handling, and warning-based artifact upload configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: copilot

🚥 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 title clearly matches the main change: switching the model evaluation pilot to run as a Python module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/2740-pilot-import-fix

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the model evaluation pilot workflow execution by invoking the pilot runner as an importable module (python -m ...) so the repository root stays on sys.path, preventing ModuleNotFoundError failures from incorrect module resolution. It also hardens the always-run post-steps so missing result artifacts are reported clearly without overriding the original failure signal.

Changes:

  • Update the pilot workflow to run tools.run_model_eval_pilot via python -m ... instead of executing the file path directly.
  • Add an always-run summary guard that writes an explicit “missing results artifact” message when pilot-results.json was not produced.
  • Add a workflow contract test to lock in the intended invocation and missing-artifact handling behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/maint-78-model-evaluation-pilot.yml Switches the pilot runner to module execution and improves always-run summary/artifact steps when results are missing.
tests/workflows/test_model_eval_pilot_workflow.py Adds a contract test asserting the workflow uses module invocation and warns (not errors) on missing artifacts.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/workflows/test_model_eval_pilot_workflow.py`:
- Around line 4-13: Update test_model_eval_pilot_runs_as_importable_module to
inspect the workflow’s summary and upload step blocks individually, asserting
each contains if: always() alongside its relevant command or configuration.
Replace whole-file substring checks for pilot-results.json and
if-no-files-found: warn with step-scoped assertions or structured YAML parsing,
while preserving the existing module-invocation checks.
🪄 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: 94db0db3-bd3c-4a93-9b51-98841821f2a3

📥 Commits

Reviewing files that changed from the base of the PR and between 7a9e289 and b63ed3b.

📒 Files selected for processing (2)
  • .github/workflows/maint-78-model-evaluation-pilot.yml
  • tests/workflows/test_model_eval_pilot_workflow.py

Comment thread tests/workflows/test_model_eval_pilot_workflow.py Outdated
@stranske-keepalive

stranske-keepalive Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: 6820b9f
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 75.58%
Baseline 85.00%
Delta -9.42%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
scripts/issue_dedup_smoke.py 0.0% 4
scripts/runner_lib/__main__.py 0.0% 3
scripts/validate_template_sync.py 0.0% 81
scripts/langchain/topic_splitter.py 19.1% 57
tools/codex_log_analyzer.py 19.6% 140
scripts/repo_review_round2_runner.py 25.1% 344
scripts/prune_agent_stubs.py 39.7% 26
scripts/repo_review_round1_runner.py 40.7% 133
tools/ensure_workflow_timeout_variables.py 42.1% 74
scripts/sync_label_docs.py 42.9% 64
tools/discover_model_catalog.py 43.8% 54
tools/ci_failure_triage.py 44.2% 123
scripts/repo_review_backlog_scan.py 45.3% 116
scripts/repo_review_body_writer.py 46.5% 86
tools/codex_session_analyzer.py 47.9% 59

Low Coverage Files (<50.0%)

File Coverage Missing
scripts/issue_dedup_smoke.py 0.0% 4
scripts/runner_lib/__main__.py 0.0% 3
scripts/validate_template_sync.py 0.0% 81
scripts/langchain/topic_splitter.py 19.1% 57
tools/codex_log_analyzer.py 19.6% 140
scripts/repo_review_round2_runner.py 25.1% 344
scripts/prune_agent_stubs.py 39.7% 26
scripts/repo_review_round1_runner.py 40.7% 133
tools/ensure_workflow_timeout_variables.py 42.1% 74
scripts/sync_label_docs.py 42.9% 64
tools/discover_model_catalog.py 43.8% 54
tools/ci_failure_triage.py 44.2% 123
scripts/repo_review_backlog_scan.py 45.3% 116
scripts/repo_review_body_writer.py 46.5% 86
tools/codex_session_analyzer.py 47.9% 59

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske temporarily deployed to agent-high-privilege July 13, 2026 03:07 — with GitHub Actions Inactive
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.

3 participants