fix: honor model_parameters_url changes in config.json like pricing_url - #4864
Conversation
ResolveFrameworkPricingConfig treated a non-empty DB model_parameters_url as authoritative and never let a changed config.json value override it, unlike pricing_url which already has a file-hash-changed override branch. The config hash that gates that override also omitted model_parameters_url, so a change to it alone was never even detected. Mirror pricing_url in both places: add the override branch and make model_parameters_url a hash trigger.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR updates Changesmodel_parameters_url reconciliation fix
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
transports/bifrost-http/lib/config_test.go (1)
17514-17565: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider adding a regression test for the
skipModelParamsURLBackfill+ unrelated-field-change interaction.None of the new (or existing) subtests cover the case where
model_parameters_urlhas an unresolvedenv.*reference whilepricing_url(or another hashed field) changes in the same restart. As flagged inconfig.go(lines 3952-3961), this combination can currently persist the raw unresolved literal into the DB. A subtest settingPricing.ModelParametersURL = &"env.MISSING_VAR"alongside a changedPricing.PricingURL, then assertingresolvedModelParametersURLstill reflectsdbConfig.ModelParametersURL, would pin down the fix once applied.🤖 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 `@transports/bifrost-http/lib/config_test.go` around lines 17514 - 17565, Add a regression subtest in ResolveFrameworkPricingConfig coverage for the skipModelParamsURLBackfill case when model_parameters_url is an unresolved env reference but another hashed field like pricing_url changes in the same restart. Use the existing ResolveFrameworkPricingConfig and configstore.GenerateFrameworkConfigHash paths to set Pricing.ModelParametersURL to env.MISSING_VAR and change Pricing.PricingURL, then assert the unresolved literal is not written back and the normalized result keeps dbConfig.ModelParametersURL as the resolvedModelParametersURL source. This should live alongside the current pricing/model_parameters_url override subtests in config_test.go.
🤖 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 `@transports/bifrost-http/lib/config.go`:
- Around line 3952-3961: The model_parameters_url override path in config
resolution is missing the same backfill guard used by the MCPLibraryURL branch,
which can persist an unresolved env.* literal into the DB when fileChanged is
triggered by another field. Update the conditional in the model_parameters_url
handling within the config resolution flow to also require
!skipModelParamsURLBackfill before treating fileChanged as a reason to overwrite
the DB, mirroring the surrounding backfill logic and keeping unresolved values
from being persisted.
---
Nitpick comments:
In `@transports/bifrost-http/lib/config_test.go`:
- Around line 17514-17565: Add a regression subtest in
ResolveFrameworkPricingConfig coverage for the skipModelParamsURLBackfill case
when model_parameters_url is an unresolved env reference but another hashed
field like pricing_url changes in the same restart. Use the existing
ResolveFrameworkPricingConfig and configstore.GenerateFrameworkConfigHash paths
to set Pricing.ModelParametersURL to env.MISSING_VAR and change
Pricing.PricingURL, then assert the unresolved literal is not written back and
the normalized result keeps dbConfig.ModelParametersURL as the
resolvedModelParametersURL source. This should live alongside the current
pricing/model_parameters_url override subtests in config_test.go.
🪄 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: CHILL
Plan: Pro Plus
Run ID: 1fda2098-525e-4dfb-a605-485d4da4ec8f
📒 Files selected for processing (3)
transports/bifrost-http/lib/config.gotransports/bifrost-http/lib/config_test.gotransports/changelog.md
Mirror the MCPLibraryURL branch's !skipModelParamsURLBackfill check so an unresolved env.* literal is not persisted over a valid DB value when the file hash changed due to another field. Add a regression test for that case.
* upstream/dev: fix: honor model_parameters_url changes in config.json like pricing_url (maximhq#4864) feat: use `schemas.SecretVar` for virtual key values to support env store (maximhq#4817)
Summary
model_parameters_urlset inconfig.jsonis ignored on restart once the DB value is populated, unlikepricing_urlwhich already followsconfig.jsonon change. This makesmodel_parameters_urlbehave the same way.Changes
ResolveFrameworkPricingConfig, add a "file hash changed → file overrides DB" branch formodel_parameters_url, mirroring the existingpricing_urlbranch.model_parameters_urlin the set of fields that trigger the framework-config hash, so a change tomodel_parameters_urlalone is detected. Previously onlypricing_url/sync/MCP triggered it, even thoughGenerateFrameworkConfigHashalready incorporatesmodel_parameters_url— so without this the override branch above could never fire for amodel_parameters_url-only config.TestResolveFrameworkPricingConfigfor both: file-overrides-DB on change, and themodel_parameters_url-only case.Type of change
Affected areas
How to test
Ran the targeted unit tests locally against a workspace build; both new sub-tests pass, and both fail without the fix (the stale DB value is retained). The full suite needs live provider credentials, so I ran the targeted package tests only.
Breaking changes
Behavior only changes for a config that sets
model_parameters_urland later changes it — that change is now honored. Configs that don't change it behave identically.Related issues
Closes #4863
Security considerations
None. Config reconciliation only; no change to auth or request/response data paths.