chore: remove applyListModelsVirtualKeyProviderFilter VK provider pre-filter from listModels - #4074
Conversation
📝 WalkthroughWalkthroughThis PR relocates virtual-key–based provider filtering from HTTP handler utilities into the governance plugin's request pre-hook. The filter now runs earlier, scoping ChangesVirtual-key provider filtering relocation to governance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Confidence Score: 3/5Not safe to merge in its current state — the handler-layer VK pre-filter was deleted but the governance plugin replacement was never committed, leaving list-models fan-out unscoped for virtual keys. The only behavioral change in this diff is deletion: the VK provider-scoping logic that populated transports/bifrost-http/handlers/inference.go — the removed pre-filter call is the center of the regression; plugins/governance/main.go — the HTTPTransportPreHook needs the bodyless list-models path added before this deletion can land safely. Important Files Changed
Reviews (3): Last reviewed commit: "feat: make use of http pre-hook instead ..." | Re-trigger Greptile |
da8a906 to
d2f170f
Compare
d2f170f to
78b230d
Compare
applyListModelsVirtualKeyProviderFilter VK provider pre-filter from listModels
Merge activity
|
…re-filter from `listModels` (#4074) ## Summary Provider scoping for `GET /v1/models` with a virtual key was previously handled inside the HTTP transport layer via `applyListModelsVirtualKeyProviderFilter` in `handlers/list_models_vk.go`. This approach required direct config store access from the handler and produced noisy, expected errors in request logs whenever governance rejected providers not permitted by the virtual key. This PR removes that transport-layer implementation entirely, eliminating the filter call from `handlers/inference.go` and deleting the associated file and tests. ## Changes - Removed the `applyListModelsVirtualKeyProviderFilter` call from `handlers/inference.go`. - Deleted `transports/bifrost-http/handlers/list_models_vk.go`, which contained the transport-layer VK provider scoping logic for list models. - Deleted `transports/bifrost-http/handlers/list_models_vk_test.go` and all associated unit tests. ## Type of change - [ ] Bug fix - [ ] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [x] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./transports/bifrost-http/handlers/... go test ./... ``` ## Breaking changes - [ ] Yes - [x] No ## Security considerations No changes to authentication or authorization logic. Virtual key resolution and provider scoping responsibility has been removed from the transport layer; ensure the receiving layer correctly handles provider filtering to avoid unintended access. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [ ] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Provider scoping for
GET /v1/modelswith a virtual key was previously handled inside the HTTP transport layer viaapplyListModelsVirtualKeyProviderFilterinhandlers/list_models_vk.go. This approach required direct config store access from the handler and produced noisy, expected errors in request logs whenever governance rejected providers not permitted by the virtual key. This PR removes that transport-layer implementation entirely, eliminating the filter call fromhandlers/inference.goand deleting the associated file and tests.Changes
applyListModelsVirtualKeyProviderFiltercall fromhandlers/inference.go.transports/bifrost-http/handlers/list_models_vk.go, which contained the transport-layer VK provider scoping logic for list models.transports/bifrost-http/handlers/list_models_vk_test.goand all associated unit tests.Type of change
Affected areas
How to test
Breaking changes
Security considerations
No changes to authentication or authorization logic. Virtual key resolution and provider scoping responsibility has been removed from the transport layer; ensure the receiving layer correctly handles provider filtering to avoid unintended access.
Checklist
docs/contributing/README.mdand followed the guidelines