feat: add --dotenv flag to override model profile with .env values#59
feat: add --dotenv flag to override model profile with .env values#59haroldship wants to merge 12 commits into
Conversation
…des and apply_model_config
|
Warning Review limit reached
More reviews will be available in 13 minutes and 23 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR implements a Changes--dotenv Feature Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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.
🧹 Nitpick comments (1)
benchmarks/helpers/tests/test_model_config.sh (1)
30-30: 💤 Low valueConsider single-quoting trap commands to defer variable expansion.
Lines 30, 50, 60, 83, 94, and 105 use
trap "rm -f $TMP" EXIT, which expands$TMPat trap-set time. While functionally correct here (since$TMPdoesn't change), shellcheck SC2064 recommendstrap 'rm -f "$TMP"' EXITto make the deferred expansion explicit and avoid potential pitfalls if the variable were modified later.♻️ Recommended fix for shell hygiene
- TMP=$(mktemp); trap "rm -f $TMP" EXIT + TMP=$(mktemp); trap 'rm -f "$TMP"' EXITApply this pattern to all six occurrences.
Also applies to: 50-50, 60-60, 83-83, 94-94, 105-105
🤖 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 `@benchmarks/helpers/tests/test_model_config.sh` at line 30, The trap commands use double quotes causing $TMP to be expanded immediately; update each occurrence of TMP created via mktemp where you call trap "rm -f $TMP" EXIT to use single-quoted deferred expansion (e.g., change to trap 'rm -f "$TMP"' EXIT) so the removal happens with the variable evaluated at trap execution time—apply this change for all six occurrences that reference TMP.Source: Linters/SAST tools
🤖 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.
Nitpick comments:
In `@benchmarks/helpers/tests/test_model_config.sh`:
- Line 30: The trap commands use double quotes causing $TMP to be expanded
immediately; update each occurrence of TMP created via mktemp where you call
trap "rm -f $TMP" EXIT to use single-quoted deferred expansion (e.g., change to
trap 'rm -f "$TMP"' EXIT) so the removal happens with the variable evaluated at
trap execution time—apply this change for all six occurrences that reference
TMP.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bce075a7-17f0-49d1-b06c-8b6ead0a4486
📒 Files selected for processing (9)
README.mdbenchmarks/appworld/compare.shbenchmarks/bpo/compare.shbenchmarks/helpers/common.shbenchmarks/helpers/tests/test_model_config.shbenchmarks/m3/compare.shbenchmarks/oak_health_insurance/compare.shscripts/compare.shscripts/eval.sh
|
Fixed in 6f4be7f — all six |
Summary
--dotenvflag to alleval.shandcompare.shscripts (top-level dispatchers and all four per-benchmark scripts).--dotenvis set, after applying the named model profile, the entire.envis re-read and force-exported — so.envalways wins over the profile for model configuration.--model-profileis given alongside--dotenv, defaults togpt-ossas the base profile.--model-name,--openai-base-url) still take highest precedence.Precedence order (lowest → highest):
Example usage:
Closes #58
Test plan
benchmarks/helpers/tests/test_model_config.sh)apply_dotenv_model_overrides: overrides vars, no-op when.envmissing, strips quotes/comments, handlesexport-prefixed linesapply_model_config:USE_DOTENV=falsebehaves like profile-only;USE_DOTENV=truewith profile →.envwins;.envomits var → profile value kept; no profile +USE_DOTENV=true→ defaults togpt-oss--dotenvalone showsgpt-ossprofile applied then.envforce-exports on top--model-profile gpt4o --dotenvshows gpt4o profile applied first, then.envoverrides MODEL_NAME--model-profile gpt-oss(no--dotenv) shows no.envoverrides section — existing behaviour unchangedSummary by CodeRabbit
New Features
--dotenvcommand-line flag to eval and comparison scripts for using.envfile values to override model profile configuration.Documentation
--dotenvflag documentation and usage examples.Tests
.envoverride behavior.