Skip to content

build-fix - #4584

Merged
akshaydeo merged 3 commits into
mainfrom
dev
Jun 21, 2026
Merged

build-fix#4584
akshaydeo merged 3 commits into
mainfrom
dev

Conversation

@akshaydeo

Copy link
Copy Markdown
Contributor

No description provided.

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@akshaydeo
akshaydeo merged commit 47291ec into main Jun 21, 2026
14 of 17 checks passed
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eb4b864a-2b9f-4181-8581-22cc9b259571

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2c964 and f325e92.

📒 Files selected for processing (2)
  • transports/bifrost-http/handlers/list_models_vk.go
  • transports/bifrost-http/handlers/list_models_vk_test.go

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved virtual key status validation to correctly handle cases where the status indicator is missing or explicitly disabled, preventing potential errors in model list retrieval.
  • Tests

    • Updated test cases to properly validate the enhanced virtual key status handling.

Walkthrough

applyListModelsVirtualKeyProviderFilter now treats a virtual key as inactive when vk.IsActive is nil in addition to when it is explicitly false. Corresponding test fixtures are updated to pass *bool pointer values via new(true) and new(false) instead of bare boolean literals.

Changes

Nil-safe IsActive check and matching test fixtures

Layer / File(s) Summary
Nil guard on vk.IsActive and updated test fixtures
transports/bifrost-http/handlers/list_models_vk.go, transports/bifrost-http/handlers/list_models_vk_test.go
The inactive-check condition in applyListModelsVirtualKeyProviderFilter adds a vk.IsActive == nil guard before dereferencing. Test fixtures for active and inactive virtual key cases are updated from bare bool literals to *bool pointers (new(true) / new(false)) to match the field type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • maximhq/bifrost#3187: Modifies the same list_models_vk.go virtual-key filtering flow, treating inactive or invalid resolved VKs as non-scoping.
  • maximhq/bifrost#4074: Centers on the same applyListModelsVirtualKeyProviderFilter virtual-key scoping logic, replacing the handler-side helper with a governance pre-hook.

Suggested reviewers

  • BearTS
  • danpiths
  • roroghost17

🐇 A pointer was nil, oh what a fright,
IsActive could crash in the dead of the night.
Now we check if it's missing before we dereference,
No more panics — just calm, safe inference.
Hop hop, the tests pass, all booleans aligned! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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"


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

@greptile-apps

greptile-apps Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 3/5

The handler incorrectly bypasses provider filtering for virtual keys whose IsActive field is nil (the DB-default active state), meaning governance restrictions on model listing are silently dropped for those keys.

The nil guard inverts the documented and code-level semantics of IsActive: the struct comment, the DB default, and the existing IsActiveValue() helper all say nil means active, but the handler treats nil as inactive. Any VK stored without an explicit IsActive value will skip provider config enforcement on GET /v1/models, bypassing the filtering this function is meant to enforce.

transports/bifrost-http/handlers/list_models_vk.go — the IsActive nil guard needs to be replaced with the IsActiveValue() helper.

Important Files Changed

Filename Overview
transports/bifrost-http/handlers/list_models_vk.go Migrates IsActive bool field to *bool pointer to match updated schema, but the nil guard inverts the DB-default semantics: nil should be active, but the new condition skips provider filtering for nil IsActive VKs. Should use the existing IsActiveValue() helper instead.
transports/bifrost-http/handlers/list_models_vk_test.go Tests correctly updated to use pointer literals (new(true)/new(false)) for the IsActive field; the nil IsActive case is not tested, leaving the behavior gap undetected.

Comments Outside Diff (1)

  1. transports/bifrost-http/handlers/list_models_vk_test.go, line 27-62 (link)

    P2 Missing nil-IsActive test case

    The test suite covers IsActive: new(true) and IsActive: new(false) but not IsActive: nil. Per the struct definition, nil is the DB-default meaning "active". A test asserting that a VK with IsActive == nil applies provider filtering (same as new(true)) would prevent the regression introduced by the current guard logic from slipping through silently.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Merge branch 'main' into dev" | Re-trigger Greptile

return false
}
if vk == nil || !vk.IsActive {
if vk == nil || vk.IsActive == nil || !*vk.IsActive {

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.

P1 Nil IsActive is semantically active per the field definition (// Nil means true (DB default); false means inactive), but this guard treats it as inactive — provider configs will be silently ignored for any VK whose IsActive field is nil. A helper IsActiveValue() already exists on the struct that handles this correctly; using it eliminates the inversion.

Suggested change
if vk == nil || vk.IsActive == nil || !*vk.IsActive {
if vk == nil || !vk.IsActiveValue() {

abdenasseraroukhsiss added a commit to abdenasseraroukhsiss/bifrost that referenced this pull request Jun 22, 2026
* origin/dev: (76 commits)
  fix: deterministic MCP tool ordering for prompt cache stability (maximhq#4588)
  enterprise changelog (maximhq#4586)
  Adds changelog for v1.5.16 --skip-ci
  transports: update dependencies --skip-ci
  fixes go worspace setup for cost-accuracy and load-test (maximhq#4585)
  plugins/telemetry: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/semanticcache: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/prompts: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/otel: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/modelcatalogresolver: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/mocker: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/maxim: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/logging: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/jsonparser: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/governance: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  plugins/compat: bump core to v1.5.22 and framework to v1.3.22 --skip-ci
  framework: bump core to v1.5.22 --skip-ci
  build fix (maximhq#4584)
  build fix
  chore: regenerate openapi.json --skip-ci
  ...

# Conflicts:
#	.github/workflows/scripts/cost-accuracy-test.sh
#	core/changelog.md
#	tests/config.json
#	tests/integrations/python/config.json
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.

2 participants