Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US

reviews:
profile: assertive
request_changes_workflow: false
high_level_summary: true
review_status: true
auto_review:
enabled: true
drafts: false
path_filters:
- "!dist/**"
- "!tmp/**"
- "!test-reports/**"
- "!playwright-report/**"
- "go.work.sum"
- "**/go.sum"
Comment on lines +17 to +18

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 The go.work.sum and **/go.sum entries in path_filters are missing the ! negation prefix. In CodeRabbit's gitignore-style filter semantics, mixing positive (no !) and negative (!) patterns means CodeRabbit will review only files matching the positive patterns — so only go.work.sum and **/go.sum would be reviewed, while all other changed files (Go source, docs, UI, etc.) would be silently skipped. The intent is almost certainly to exclude these auto-generated sum files, not to exclusively include them.

Suggested change
- "go.work.sum"
- "**/go.sum"
- "!go.work.sum"
- "!**/go.sum"

path_instructions:
- path: "core/**"
instructions: |
Review Go core changes for concurrency safety, provider isolation, pooled object reset discipline, and plugin hook ordering.
Flag channel lifecycle changes that do not follow the ProviderQueue atomic closing/sync.Once pattern.
For provider changes, verify streaming paths use the streaming client and preserve response/error metadata.
- path: "framework/**"
instructions: |
Review persistence, streaming, and shared framework changes for backward-compatible data formats and careful memory ownership.
For logstore/configstore changes, check migration behavior, duration serialization, and map-copy race prevention.
When migrations are added or changed, verify they avoid deadlocks on large tables and create indexes concurrently.
- path: "transports/**"
instructions: |
Treat transports/config.schema.json as the source of truth for config fields.
Verify HTTP handlers preserve SDK compatibility, middleware ordering, context conversion, and route-level middleware behavior.
- path: "plugins/**"
instructions: |
Review plugin changes for hook symmetry, nil response/error handling, fallback behavior, and module-local dependency hygiene.
Each plugin has its own go.mod; do not assume root-level Go module commands apply.
When migrations are added or changed, verify they avoid deadlocks on large tables and create indexes concurrently.
- path: "ui/**"
instructions: |
Preserve existing UI conventions and data-testid attributes used by Playwright tests.
Review interactive changes for expected loading, empty, error, and mobile states.
Alert if frontend code uses the browser crypto APIs because they can fail in non-HTTPS contexts, except localhost and other secure contexts.
- path: "tests/e2e/**"
instructions: |
Verify tests import fixtures from tests/e2e/core/fixtures/base.fixture and use data-testid selectors.
Do not marshal API payloads through Records, maps, Object.fromEntries, or JSON round trips because field order matters.
- path: "docs/**"
instructions: |
Check docs for parity with code, config.schema.json, and provider behavior.
Verify new or renamed Mintlify pages are reflected in docs/docs.json where appropriate.

knowledge_base:
code_guidelines:
enabled: true
filePatterns:
- "AGENTS.md"
- ".greptile/rules.md"

chat:
auto_reply: true
66 changes: 66 additions & 0 deletions .greptile/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"strictness": 2,
"commentTypes": ["logic", "syntax", "style"],
"instructions": "Review Bifrost PRs for correctness, regressions, concurrency bugs, streaming behavior, data races, API compatibility, and missing tests. Prefer high-signal comments tied to concrete behavior over stylistic preferences.",
"rules": [
{
"id": "multi-module-go-workspace",
"rule": "This repository is a multi-module Go workspace. Do not suggest running go mod tidy at the repository root; dependency cleanup belongs in the specific module directory.",
"severity": "medium"
},
{
"id": "provider-streaming-client",
"rule": "Provider streaming paths must use the provider streaming client rather than the unary client, so long-running streams are governed by per-chunk idle timeout instead of whole-response fasthttp deadlines.",
"scope": ["core/providers/**"],
"severity": "high"
},
{
"id": "pooled-object-reset",
"rule": "Every pooled object must have all fields reset before being returned to a pool. Flag stale field leaks and partial resets.",
"scope": ["core/**", "framework/**", "transports/**"],
"severity": "high"
},
{
"id": "provider-queue-lifecycle",
"rule": "Channel lifecycle changes must preserve the ProviderQueue atomic closing flag and sync.Once close/signal pattern to avoid send-on-closed-channel panics.",
"scope": ["core/**"],
"severity": "high"
},
{
"id": "plugin-hook-order",
"rule": "Plugin pre-hooks run in registration order and post-hooks run in reverse order. Flag changes that break this wrapping model or mishandle nil response/error values.",
"scope": ["core/**", "plugins/**", "transports/**"],
"severity": "high"
},
{
"id": "config-schema-source-of-truth",
"rule": "transports/config.schema.json is the source of truth for config fields. New config fields must stay aligned with handlers, docs, and UI behavior.",
"scope": ["transports/**", "docs/**", "ui/**"],
"severity": "medium"
},
{
"id": "migration-large-table-safety",
"rule": "Whenever a migration is added or changed, verify it avoids deadlocks and long blocking locks on large tables. Index creation in migrations must be concurrent where the database supports it.",
"scope": ["**/*migration*", "**/migrations/**", "framework/**", "plugins/**", "transports/**"],
"severity": "high"
},
{
"id": "frontend-crypto-secure-context",
"rule": "Alert when frontend code uses browser crypto APIs such as crypto, crypto.subtle, or globalThis.crypto because they can fail in non-HTTPS contexts, except localhost and other secure contexts.",
"scope": ["ui/**", "docs/**"],
"severity": "medium"
},
{
"id": "preserve-e2e-testid",
"rule": "UI changes must preserve data-testid attributes used by Playwright tests unless tests are updated in the same PR.",
"scope": ["ui/**", "tests/e2e/**"],
"severity": "medium"
},
{
"id": "e2e-payload-order",
"rule": "E2E API payloads must be constructed directly as object literals. Do not serialize through maps, Records, Object.fromEntries, or JSON round trips because field order matters.",
"scope": ["tests/e2e/**"],
"severity": "medium"
}
]
}
18 changes: 18 additions & 0 deletions .greptile/files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"files": [
{
"path": "AGENTS.md",
"description": "Repository architecture, coding conventions, testing commands, and review gotchas for Bifrost."
},
{
"path": "transports/config.schema.json",
"description": "Source of truth for config.json fields.",
"scope": ["transports/**", "docs/**", "ui/**"]
},
{
"path": "go.work",
"description": "Go workspace module layout.",
"scope": ["core/**", "framework/**", "plugins/**", "transports/**", "go.work", "go.work.sum"]
}
]
}
73 changes: 73 additions & 0 deletions .greptile/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Bifrost Review Rules

## Review Priorities

Focus on correctness, regressions, concurrency bugs, streaming behavior, data races, API compatibility, and missing tests. Avoid comments that are only style preferences unless the style issue creates a real maintenance or behavior risk.

When reviewing a PR, first identify which Bifrost area is touched:

- `core/`: provider lifecycle, inference routing, MCP, schemas, provider implementations, pooling.
- `framework/`: persistence, streaming accumulators, vector stores, tracing, encryption.
- `transports/`: HTTP server, handlers, SDK integrations, config schema.
- `plugins/`: governance, logging, telemetry, semantic cache, compatibility plugins.
- `ui/`: React workspace interface and shared components.
- `tests/e2e/`: Playwright end-to-end tests.
- `docs/`: Mintlify documentation.

## Repository Rules

- Cross-module imports work locally through `go.work`, but releaseable module changes still need explicit `require` entries in the relevant module.
- For provider-level tests, prefer `make test-core` over bare `go test` because the Make target runs the shared provider scenario suite.
- Provider converters must remain pure transformation functions with no HTTP calls, logging, or side effects.
- OpenAI provider converter changes affect OpenAI-compatible providers that delegate to OpenAI helpers, including Groq, Cerebras, Ollama, Perplexity, OpenRouter, Parasail, Nebius, xAI, and SGL.
- Streaming provider paths must use the provider streaming client, not the unary client.
- Pooled objects must have every field reset before returning to a pool.
- Channel lifecycle changes must preserve the ProviderQueue atomic closing flag plus `sync.Once` close/signal pattern.
- Plugin pre-hooks run in registration order; post-hooks run in reverse order.
- `AllowedRequests == nil` means all operations are allowed. Non-nil values only allow explicitly true fields.
- Do not set Bifrost reserved context keys from handlers or plugins.
- `transports/config.schema.json` is the source of truth for config fields.
- Whenever a migration is added or changed, verify it avoids deadlocks and long blocking locks on large tables. Index creation in migrations must be concurrent where the database supports it.
- Alert when frontend code uses browser crypto APIs such as `crypto`, `crypto.subtle`, or `globalThis.crypto` because they can fail in non-HTTPS contexts, except localhost and other secure contexts.
- UI changes must preserve `data-testid` attributes used by E2E tests.
- E2E API payloads must be constructed directly as object literals. Do not serialize through maps, Records, `Object.fromEntries`, or JSON round trips.

## Path-Specific Checks

For `core/providers/**`:

- Verify error converters populate provider, model, and request type metadata.
- Verify unsupported operations return the repository's standard unsupported-operation error behavior.
- For new provider operations, check all providers and the provider interface are updated consistently.
- For streaming responses, check idle timeout handling and chunk accumulation behavior.

For `core/mcp/**`:

- Check tool filtering across global, client, tool, and per-request filters.
- Review agent loops for bounded depth, deterministic tool execution behavior, and safe error propagation.

For `framework/streaming/**`:

- Validate delta copying, accumulator ownership, and final response construction.
- Watch for aliasing bugs where chunks or response fields can be mutated after being published.

For `transports/bifrost-http/handlers/**`:

- Verify handler changes keep SDK integration behavior compatible with OpenAI, Anthropic, Bedrock, Google GenAI, LangChain, LiteLLM, and PydanticAI where relevant.
- Check request parsing, error status codes, and middleware ordering.

For `plugins/governance/**`:

- Review budget, rate-limit, virtual key, and RBAC paths for fail-closed behavior where security is involved.
- Check that fallback and retry attempts do not double-count or undercount usage unexpectedly.

For `ui/**`:

- Check interactive workflows for loading, empty, error, and success states.
- Alert on browser crypto API usage because it requires secure contexts and can fail outside HTTPS, except localhost and other secure contexts.
- Preserve existing component conventions and avoid broad visual rewrites in unrelated PRs.

For `docs/**`:

- Check examples against actual config schema, handler names, provider support, and Make targets.
- New docs pages should be included in `docs/docs.json` when they are intended to be navigable.
12 changes: 12 additions & 0 deletions docs/changelogs/helm-v1.7.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "v1.7.0"
description: "Helm v1.7.0 changelog - 2026-01-28"
---

<Update label="Bifrost Helm" description="v1.7.0">

## Changelog

- Previous stable release with Deployment-based architecture for all storage modes

</Update>
43 changes: 43 additions & 0 deletions docs/changelogs/helm-v2.0.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "v2.0.0"
description: "Helm v2.0.0 changelog - 2026-01-31"
---

<Update label="Bifrost Helm" description="v2.0.0 (Breaking Change)">

## Changelog

#### StatefulSet for SQLite with Persistence

This release fixes the multi-attach volume error when running multiple replicas with SQLite storage mode.

#### What Changed

- When using `storage.mode: sqlite` with `storage.persistence.enabled: true`, Bifrost now deploys as a **StatefulSet** instead of a Deployment
- Each pod gets its own dedicated PersistentVolumeClaim (e.g., `data-bifrost-0`, `data-bifrost-1`, `data-bifrost-2`)
- A headless service is created for StatefulSet DNS resolution
- HorizontalPodAutoscaler now correctly references StatefulSet or Deployment based on storage configuration

#### Who Is Affected

- Users running SQLite mode with persistence enabled and multiple replicas
- Users upgrading existing SQLite deployments need to migrate (see below)

#### Who Is NOT Affected

- Users running PostgreSQL mode (`storage.mode: postgres`) - no changes, still uses Deployment
- Users running SQLite without persistence (`storage.persistence.enabled: false`)
- Users running SQLite with an existing PVC claim (`storage.persistence.existingClaim`)

#### Migration Guide for Existing SQLite Deployments

Since Kubernetes doesn't allow in-place conversion from Deployment to StatefulSet, you need to:

1. Back up your data (if needed)
2. Uninstall the existing release: `helm uninstall bifrost`
3. Delete the old PVC: `kubectl delete pvc bifrost-data`
4. Install with the new chart version: `helm install bifrost bifrost/bifrost --set image.tag=<latest-image>`

**Note:** For production high-availability setups, we recommend using PostgreSQL mode which scales horizontally without these concerns.

</Update>
14 changes: 14 additions & 0 deletions docs/changelogs/helm-v2.0.1.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "v2.0.1"
description: "Helm v2.0.1 changelog - 2026-01-31"
---

<Update label="Bifrost Helm" description="v2.0.1">

## Changelog

- Added missing StatefulSet template for SQLite with persistence mode
- Added headless service for StatefulSet DNS resolution
- v2.0.0 documented StatefulSet support but the template was not included - this release fixes that

</Update>
16 changes: 16 additions & 0 deletions docs/changelogs/helm-v2.0.10.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "v2.0.10"
description: "Helm v2.0.10 changelog - 2026-03-03"
---

<Update label="Bifrost Helm" description="v2.0.10">

## Changelog

- Added missing plugin config properties from Go implementations:
- governance: `required_headers`, `is_enterprise`
- logging: `disable_content_logging`, `logging_headers`
- otel: `headers`, `tls_ca_cert`, `insecure`
- telemetry: `custom_labels`

</Update>
12 changes: 12 additions & 0 deletions docs/changelogs/helm-v2.0.11.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "v2.0.11"
description: "Helm v2.0.11 changelog - 2026-03-05"
---

<Update label="Bifrost Helm" description="v2.0.11">

## Changelog

- Bumped appVersion to 1.4.11

</Update>
12 changes: 12 additions & 0 deletions docs/changelogs/helm-v2.0.12.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "v2.0.12"
description: "Helm v2.0.12 changelog - 2026-03-06"
---

<Update label="Bifrost Helm" description="v2.0.12">

## Changelog

- Fixed health probe paths to use `/health` instead of `/metrics`

</Update>
20 changes: 20 additions & 0 deletions docs/changelogs/helm-v2.0.13.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "v2.0.13"
description: "Helm v2.0.13 changelog - 2026-03-11"
---

<Update label="Bifrost Helm" description="v2.0.13">

## Changelog

- Added missing client config properties: `asyncJobResultTTL`, `requiredHeaders`, `loggingHeaders`, `allowedHeaders`, `mcpAgentDepth`, `mcpToolExecutionTimeout`, `mcpCodeModeBindingLevel`, `mcpToolSyncInterval`, `hideDeletedVirtualKeysInFilters`
- Added MCP new fields: top-level `toolSyncInterval`, per-client `clientId`, `isCodeModeClient`, `toolSyncInterval`, `isPingAvailable`, `toolPricing`, and `codeModeBindingLevel` in tool manager config
- Added governance `modelConfigs` and `providers` top-level properties
- Added cluster `region` property
- Added guardrail provider `timeout` field (was missing from schema and template rendering)
- Fixed `isPingAvailable` rendering bug in `_helpers.tpl` (was using wrong key name)
- Added `is_ping_available` and `tool_pricing` to `config.schema.json` MCP client config
- Added new CI script `validate-go-config-fields.sh` for Go struct-to-schema drift detection
- Expanded all 3 existing CI validation scripts with Gap 1-8 property coverage

</Update>
15 changes: 15 additions & 0 deletions docs/changelogs/helm-v2.0.14.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "v2.0.14"
description: "Helm v2.0.14 changelog - 2026-03-20"
---

<Update label="Bifrost Helm" description="v2.0.14">

## Changelog

- Added `placement` and `order` fields to custom plugin schema and template rendering
- Added plugin property completeness check to `validate-helm-schema.sh`
- Added custom plugin placement/order rendering tests to `validate-helm-templates.sh`
- Added `PluginConfig` struct validation to `validate-go-config-fields.sh`

</Update>
22 changes: 22 additions & 0 deletions docs/changelogs/helm-v2.0.15.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: "v2.0.15"
description: "Helm v2.0.15 changelog - 2026-04-07"
---

<Update label="Bifrost Helm" description="v2.0.15">

## Changelog

- Synced helm schema with transport `config.schema.json` — added missing properties:
- `client.mcpDisableAutoToolInject` — disable automatic MCP tool injection
- `governance.budgets[].calendar_aligned` — snap budget resets to calendar boundaries
- `governance.pricingOverrides` — scoped pricing overrides for the model catalog
- `mcp.clientConfigs[].allowedExtraHeaders` — header allowlist per MCP client
- `mcp.clientConfigs[].allowOnAllVirtualKeys` — make MCP server accessible to all virtual keys
- `mcp.toolManagerConfig.disableAutoToolInject` — disable auto tool injection at manager level
- `networkConfig.beta_header_overrides` — override Anthropic beta header support per provider
- `websocket` — full WebSocket gateway tuning (connections, pool, transcript buffer)
- Fixed SSE `connectionString` not being rendered in `_helpers.tpl` for MCP clients
- Added template rendering for all new properties in `_helpers.tpl`

</Update>
Loading
Loading