Repository navigation
Conversation
…o prevent conflicts with vendor asset tags
…ronment variable precedence
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR removes the unprefixed ChangesEnvironment Variable Precedence for Model Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openhuman/config/schema/load_tests.rs (1)
426-447: ⚡ Quick winAdd a whitespace-only
OPENHUMAN_MODELregression assertion here.This test already covers precedence/alias behavior; adding
" "keeps guard behavior locked so blank-like values cannot overridedefault_model.🤖 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 `@src/openhuman/config/schema/load_tests.rs` around lines 426 - 447, In the test env_overlay_model_only_honours_namespaced_var, add a case that ensures a whitespace-only OPENHUMAN_MODEL value does not override Config::default_model: create a HashMapEnv with ("OPENHUMAN_MODEL", " "), call cfg.apply_env_overlay_with(&env) on a fresh Config (or compare to a saved original = cfg.default_model.clone()), and assert cfg.default_model equals the original; this uses the same function names (env_overlay_model_only_honours_namespaced_var, Config::apply_env_overlay_with, default_model, HashMapEnv) so the blank-like OPENHUMAN_MODEL cannot clobber the model.
🤖 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 `@src/openhuman/config/schema/load.rs`:
- Around line 1000-1003: The current branch sets self.default_model from
env.get("OPENHUMAN_MODEL") without trimming, allowing whitespace-only values;
update the logic around env.get("OPENHUMAN_MODEL")/model so you .trim() the
retrieved string and only assign Some(trimmed) to self.default_model when the
trimmed string is non-empty (i.e., check trimmed.is_empty() before setting);
keep the same variable names (model, self.default_model) and the same
conditional structure but use the trimmed value for the emptiness check and
assignment.
---
Nitpick comments:
In `@src/openhuman/config/schema/load_tests.rs`:
- Around line 426-447: In the test
env_overlay_model_only_honours_namespaced_var, add a case that ensures a
whitespace-only OPENHUMAN_MODEL value does not override Config::default_model:
create a HashMapEnv with ("OPENHUMAN_MODEL", " "), call
cfg.apply_env_overlay_with(&env) on a fresh Config (or compare to a saved
original = cfg.default_model.clone()), and assert cfg.default_model equals the
original; this uses the same function names
(env_overlay_model_only_honours_namespaced_var, Config::apply_env_overlay_with,
default_model, HashMapEnv) so the blank-like OPENHUMAN_MODEL cannot clobber the
model.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 949e53b0-dde1-4673-83dd-075017387f76
📒 Files selected for processing (2)
src/openhuman/config/schema/load.rssrc/openhuman/config/schema/load_tests.rs
…default model assignment
Summary
Problem
Solution
Submission Checklist
.github/workflows/coverage.yml. Run pnpm test:coverage and pnpm test:rust locally; PRs below 80% on changed lines will not merge.docs/TEST-COVERAGE-MATRIX.mdreflect this change (or N/A: behaviour-only change)docs/RELEASE-MANUAL-SMOKE.md)Impact
Related
Summary by CodeRabbit