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
8 changes: 3 additions & 5 deletions core/changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Feat: Stream token latency sent back in extra fields.
- Feat: Plugin interface extended with TransportInterceptor method.
- Feat: Add Anthropic thinking parameter
- Feat: Add Custom key selector logic and send back request latency in extra fields.
- Bug: Fallbacks not working occasionally.
- Feat: Responses streaming added across all providers.
- Fix: Bedrock chat streaming decoding fixes.
- Feat: Added raw response support for all streaming requests.
2 changes: 1 addition & 1 deletion core/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.5
1.2.6
16 changes: 8 additions & 8 deletions docs/changelogs/v1.3.0-prerelease6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "v1.3.0-prerelease6 changelog"
---
<Update label="Bifrost(HTTP)" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
- Feat: Added Anthropic thinking parameter in responses API.
- Feat: Added Anthropic text completion integration support.
- Fix: Extra fields sent back in streaming responses.
Expand Down Expand Up @@ -37,37 +37,37 @@ description: "v1.3.0-prerelease6 changelog"
</Update>
<Update label="jsonparser" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="logging" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="maxim" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="mocker" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="otel" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="semanticcache" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6

</Update>
<Update label="telemetry" description="v1.3.0-prerelease6">

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
- Feat: Added First Token and Inter Token latency metrics for streaming requests.

</Update>
4 changes: 2 additions & 2 deletions framework/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5
- Feat: User table added to config store.
- Upgrade dependency: core to 1.2.6
- Feat: Moved the migrator package to a more general location and added database migrations for the logstore to standardize object type values.
2 changes: 1 addition & 1 deletion framework/configstore/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/maximhq/bifrost/framework/configstore/migrator"
"github.com/maximhq/bifrost/framework/migrator"
"gorm.io/gorm"
)

Expand Down
2 changes: 1 addition & 1 deletion framework/configstore/rdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"

"github.com/maximhq/bifrost/core/schemas"
"github.com/maximhq/bifrost/framework/configstore/migrator"
"github.com/maximhq/bifrost/framework/migrator"
"github.com/maximhq/bifrost/framework/logstore"
"github.com/maximhq/bifrost/framework/vectorstore"
"gorm.io/gorm"
Expand Down
2 changes: 1 addition & 1 deletion framework/configstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

"github.com/maximhq/bifrost/core/schemas"
"github.com/maximhq/bifrost/framework/configstore/migrator"
"github.com/maximhq/bifrost/framework/migrator"
"github.com/maximhq/bifrost/framework/logstore"
"github.com/maximhq/bifrost/framework/vectorstore"
"gorm.io/gorm"
Expand Down
132 changes: 132 additions & 0 deletions framework/logstore/migrations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
package logstore

import (
"context"
"fmt"

"github.com/maximhq/bifrost/framework/migrator"
"gorm.io/gorm"
)

// Migrate performs the necessary database migrations.
func triggerMigrations(ctx context.Context, db *gorm.DB) error {
if err := migrationInit(ctx, db); err != nil {
return err
}
if err := migrationUpdateObjectColumnValues(ctx, db); err != nil {
return err
}

return nil
}

// migrationInit is the first migration
func migrationInit(ctx context.Context, db *gorm.DB) error {
m := migrator.New(db, migrator.DefaultOptions, []*migrator.Migration{{
ID: "logs_init",
Migrate: func(tx *gorm.DB) error {
tx = tx.WithContext(ctx)
migrator := tx.Migrator()
if !migrator.HasTable(&Log{}) {
if err := migrator.CreateTable(&Log{}); err != nil {
return err
}
}

return nil
},
Rollback: func(tx *gorm.DB) error {
tx = tx.WithContext(ctx)
migrator := tx.Migrator()
// Drop children first, then parents (adjust if your actual FKs differ)
if err := migrator.DropTable(&Log{}); err != nil {
return err
}
return nil
},
}})
err := m.Migrate()
if err != nil {
return fmt.Errorf("error while running db migration: %s", err.Error())
}
return nil
}

// migrationUpdateObjectColumnValues updates the object column values from old format to new format
func migrationUpdateObjectColumnValues(ctx context.Context, db *gorm.DB) error {
opts := *migrator.DefaultOptions
opts.UseTransaction = true
m := migrator.New(db, &opts, []*migrator.Migration{{
ID: "logs_init_update_object_column_values",
Migrate: func(tx *gorm.DB) error {
tx = tx.WithContext(ctx)

updateSQL := `
UPDATE logs
SET object_type = CASE object_type
WHEN 'chat.completion' THEN 'chat_completion'
WHEN 'text.completion' THEN 'text_completion'
WHEN 'list' THEN 'embedding'
WHEN 'audio.speech' THEN 'speech'
WHEN 'audio.transcription' THEN 'transcription'
WHEN 'chat.completion.chunk' THEN 'chat_completion_stream'
WHEN 'audio.speech.chunk' THEN 'speech_stream'
WHEN 'audio.transcription.chunk' THEN 'transcription_stream'
WHEN 'response' THEN 'responses'
WHEN 'response.completion.chunk' THEN 'responses_stream'
ELSE object_type
END
WHERE object_type IN (
'chat.completion', 'text.completion', 'list',
'audio.speech', 'audio.transcription', 'chat.completion.chunk',
'audio.speech.chunk', 'audio.transcription.chunk',
'response', 'response.completion.chunk'
)`

result := tx.Exec(updateSQL)
if result.Error != nil {
return fmt.Errorf("failed to update object_type values: %w", result.Error)
}

return nil
},
Rollback: func(tx *gorm.DB) error {
tx = tx.WithContext(ctx)

// Use a single CASE statement for efficient bulk rollback
rollbackSQL := `
UPDATE logs
SET object_type = CASE object_type
WHEN 'chat_completion' THEN 'chat.completion'
WHEN 'text_completion' THEN 'text.completion'
WHEN 'embedding' THEN 'list'
WHEN 'speech' THEN 'audio.speech'
WHEN 'transcription' THEN 'audio.transcription'
WHEN 'chat_completion_stream' THEN 'chat.completion.chunk'
WHEN 'speech_stream' THEN 'audio.speech.chunk'
WHEN 'transcription_stream' THEN 'audio.transcription.chunk'
WHEN 'responses' THEN 'response'
WHEN 'responses_stream' THEN 'response.completion.chunk'
ELSE object_type
END
WHERE object_type IN (
'chat_completion', 'text_completion', 'embedding', 'speech',
'transcription', 'chat_completion_stream', 'speech_stream',
'transcription_stream', 'responses', 'responses_stream'
)`

result := tx.Exec(rollbackSQL)
if result.Error != nil {
return fmt.Errorf("failed to rollback object_type values: %w", result.Error)
}

return nil
},
}})

err := m.Migrate()
if err != nil {
return fmt.Errorf("error while running object column migration: %s", err.Error())
}
return nil
}
3 changes: 2 additions & 1 deletion framework/logstore/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func newSqliteLogStore(ctx context.Context, config *SQLiteConfig, logger schemas
if err != nil {
return nil, err
}
if err := db.WithContext(ctx).AutoMigrate(&Log{}); err != nil {
// Run migrations
if err := triggerMigrations(ctx, db); err != nil {
return nil, err
}
return &RDBLogStore{db: db, logger: logger}, nil
Expand Down
2 changes: 1 addition & 1 deletion framework/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.5
1.1.6
3 changes: 1 addition & 2 deletions plugins/governance/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Chore: using core 1.2.5 and framework 1.1.5
- Feat: Added provider routing TransportInterceptor.
- Chore: using core 1.2.6 and framework 1.1.6
2 changes: 1 addition & 1 deletion plugins/governance/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
2 changes: 1 addition & 1 deletion plugins/jsonparser/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/jsonparser/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the necessity of this version bump.

The patch version bump from 1.3.5 to 1.3.6 appears unrelated to the main PR changes (migrator refactoring and logstore migrations). While the AI summary mentions this is part of broader version bumps across modules, it's unclear whether the jsonparser plugin has any actual changes that warrant a version bump.

Please confirm:

  1. Are there actual changes to the jsonparser plugin that require this version bump?
  2. If this is a coordinated release, is there a changelog or release notes documenting what changed in version 1.3.6?
  3. Have all dependent modules been updated to reference the new version if needed?

🏁 Script executed:

#!/bin/bash
# Description: Check for actual code changes in the jsonparser plugin and look for changelog updates

# Search for jsonparser plugin files to see if there are code changes
fd -e go -p 'plugins/jsonparser' --exec echo "File: {}"

# Look for changelog or version-related documentation
fd -e md -p 'plugins/jsonparser' | head -20

# Check if other files reference the jsonparser version
rg -n 'jsonparser.*1\.3\.[56]'

Length of output: 108


🏁 Script executed:

#!/bin/bash
# Verify changelog entry for version 1.3.6
grep -nE '^##\s*1\.3\.6' plugins/jsonparser/changelog.md || echo "No entry for 1.3.6"

# Show diff for plugin source files to see actual changes
git diff origin/main...HEAD -- plugins/jsonparser/main.go plugins/jsonparser/plugin_test.go

Length of output: 18


Document or revert jsonparser patch bump The patch bump to 1.3.6 in plugins/jsonparser/version has no corresponding code changes and no entry in plugins/jsonparser/changelog.md. Add release notes for v1.3.6 or revert this bump.

🤖 Prompt for AI Agents
In plugins/jsonparser/version around lines 1 to 1, the version was bumped to
1.3.6 but there are no corresponding code changes or an entry in
plugins/jsonparser/changelog.md; either add a changelog entry describing the
1.3.6 changes and any relevant release notes to plugins/jsonparser/changelog.md
(including date and concise bullet points) and keep the version bump, or revert
plugins/jsonparser/version back to the previous version number so the repository
state matches existing changes; commit the chosen fix with a clear message
(e.g., "chore(jsonparser): add changelog for v1.3.6" or "chore(jsonparser):
revert accidental v1.3.6 bump").

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the necessity of this version bump.

The jsonparser plugin version has been incremented to 1.3.6, but the PR objectives and summary indicate no functional changes to the jsonparser plugin itself. Since this PR focuses on migrator and logstore changes, please confirm:

  1. Does the jsonparser plugin depend on core or framework versions that were updated in this PR (core 1.2.5→1.2.6, framework 1.1.5→1.1.6)?
  2. Is there a corresponding changelog entry documenting why this version was bumped?
  3. Does this follow the project's versioning policy for coordinated releases?

Run the following script to check for dependency updates and changelog entries:


🏁 Script executed:

#!/bin/bash
# Description: Verify jsonparser dependencies and changelog for version 1.3.6

# Check go.mod for core/framework dependencies
if [ -f "plugins/jsonparser/go.mod" ]; then
  echo "=== jsonparser dependencies ==="
  rg -A 2 'github.com/maximhq/bifrost/(core|framework)' plugins/jsonparser/go.mod
fi

# Check for changelog entries
echo "=== Checking for changelog ==="
fd -t f 'CHANGELOG|changelog|HISTORY|history' plugins/jsonparser/

# Check for version references in plugin files
echo "=== Version references in jsonparser ==="
rg -n '1\.3\.[56]' plugins/jsonparser/

Length of output: 228


🏁 Script executed:

#!/bin/bash
# Verify changelog entry for version 1.3.6 in jsonparser plugin

echo "=== Changelog entries around 1.3.6 ==="
rg -n '1\.3\.6' -C2 plugins/jsonparser/changelog.md || echo "No entries found for 1.3.6"

Length of output: 65


Add missing changelog entry and update dependency

  • Document the 1.3.6 bump in plugins/jsonparser/changelog.md explaining its purpose.
  • Update plugins/jsonparser/go.mod to require github.com/maximhq/bifrost/core v1.2.6 (or revert the version bump if unintended).
🤖 Prompt for AI Agents
In plugins/jsonparser/version around line 1, the version was bumped to 1.3.6 but
there is no changelog entry and the dependency requirement may be inconsistent;
add an entry to plugins/jsonparser/changelog.md documenting the 1.3.6 bump and
its purpose (what changed and why), and update plugins/jsonparser/go.mod to
require github.com/maximhq/bifrost/core v1.2.6 if the dependency change is
intended (or revert the version in plugins/jsonparser/version back to the
previous version if the bump was accidental).

2 changes: 1 addition & 1 deletion plugins/logging/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/logging/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
2 changes: 1 addition & 1 deletion plugins/maxim/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/maxim/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.5
1.4.6
2 changes: 1 addition & 1 deletion plugins/mocker/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/mocker/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
2 changes: 1 addition & 1 deletion plugins/otel/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/otel/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.5
1.0.6
2 changes: 1 addition & 1 deletion plugins/semanticcache/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
2 changes: 1 addition & 1 deletion plugins/semanticcache/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
4 changes: 2 additions & 2 deletions plugins/telemetry/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Feat: Added First Token and Inter Token latency metrics for streaming requests.
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
- Fix: Removed last token's accumulated latency from inter token latency metric.
2 changes: 1 addition & 1 deletion plugins/telemetry/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.6
13 changes: 5 additions & 8 deletions transports/changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<!-- The pattern we follow here is to keep the changelog for the latest version -->
<!-- Old changelogs are automatically attached to the GitHub releases -->

- Upgrade dependency: core to 1.2.5 and framework to 1.1.5
- Feat: Added Anthropic thinking parameter in responses API.
- Feat: Added Anthropic text completion integration support.
- Fix: Extra fields sent back in streaming responses.
- Feat: Latency for all request types (with inter token latency for streaming requests) sent back in Extra fields.
- Feat: UI websocket implementation generalized.
- Feat: TokenInterceptor interface added to plugins.
- Fix: Middlewares added to integrations route.
- Upgrade dependency: core to 1.2.6 and framework to 1.1.6
- Added Responses streaming across all providers.
- Fixed bedrock chat streaming decoding issues.
- Added raw response support for all streaming requests.
- Removed last token's accumulated latency from inter token latency metric.
2 changes: 1 addition & 1 deletion transports/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0-prerelease6
1.3.0-prerelease7